Is there a way to get un-enrolled users from courses?

Is there a way to get un-enrolled users from courses?

by Dulitha Rajapaksha -
Number of replies: 5

I need to get the student details who got un-enrolled from course. As I can see user_enrollments or enrol tables do not have un-enrolled student data. Is there a way to do this? Perhaps a sql query?

Average of ratings: -
In reply to Dulitha Rajapaksha

Re: Is there a way to get un-enrolled users from courses?

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers
An SQL query that hits up the log tables should be able to give that information. I'll try and have a look over the weekend, but someone may well get there quicker than I'll be able to (and with better sql experience ;) )
In reply to Richard Oelmann

Re: Is there a way to get un-enrolled users from courses?

by Dulitha Rajapaksha -
Thanks a lot Richard. Please post if you find a way to do this smile
In reply to Dulitha Rajapaksha

Re: Is there a way to get un-enrolled users from courses?

by John Provasnik -
Picture of Particularly helpful Moodlers Picture of Testers

You can through logs within Moodle, or if you do an sql statement, maybe you can look for only logs that contain certain text (simply manually unenroll a test user from a course then look at the logs to see the exact verbiage used)

In reply to John Provasnik

Re: Is there a way to get un-enrolled users from courses?

by Dulitha Rajapaksha -
My log tables were empty. Checked both log and log_queries tables. Running on moodle 3.8
In reply to John Provasnik

Re: Is there a way to get un-enrolled users from courses?

by Dulitha Rajapaksha -
I think I found the correct log table. Its logstore_standard_log and looks like it has everything I needed. Can query with target='user_enrolment' AND action='deleted' smile Thanks for the support
Average of ratings: Useful (2)