How to Unenroll a Student from multiple courses from database

How to Unenroll a Student from multiple courses from database

by Amanda Hefner -
Number of replies: 1
Trying to locate a table in the database to unenroll each user from many courses... or remove their "student" role from many courses...

We have a large problem after using the batch user uploader. Upon upload, the "default user" status was set to "student." This caused all users to become enrolled in ALL courses immediately on login.

How can we unenroll them from all extra courses using the database? Or remove their "student" role from many courses?

Previously, we used the _user_student table to drop enrollment errors. However, this table does not exist is 1.7.

Please advise, if you know how we can locate this data in the 1.7 database.

Thanks!
Amanda Hefner
Northside ISD, San Antonio, TX
Average of ratings: -
In reply to Amanda Hefner

Re: How to Unenroll a Student from multiple courses from database

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Amanda - With roles it is a little more complicated. Basically you will be using the mdl_role_assignments table; however, before doing that you have to find the context for the course in the mdl_contexts table. Let me know if you have further questions about the details of this. Peace - Anthony