I need to remove an user programmatically from everything he is related with a group, like notes and everything. I removed the user from the table mdl_user_enrollments but he's still enrolled and when he logs in all data of the group is still being displayed. I want to remove everything this user has related with the group, so i can enroll he again and he'll start all over.
How to remove programmatically all participation of a student in a Moodle 2.5 group?
1k views Asked by Edgar Froes At
1
Don't know if this is exactly what you are looking for but the procedure bellow removes users data from course. Not from all installed moodle modules that will vary for each Moodle configuration) but you can add a few querys for your extra modules as well.
This procedure is based on the operations made by course/reset.php it receives two parameters: the course id and the user id. Add/remove the modules related querys depending on you Moodle configuration.