unenrolling or suspending?

unenrolling or suspending?

by Brad Nielsen -
Number of replies: 2

I'm a little confused, does: 

unenrol_user($instance, $user->id);

delete a users enrolment or suspend a user's enrolment.

and then does $enrol_user($instance, $user->id) 

enrol new users, as well as unsuspending any suspended users?

Are there better function to use?

cheers,

Brad

Average of ratings: -
In reply to Brad Nielsen

Re: unenrolling or suspending?

by Azmat Ullah -
Picture of Plugin developers

unenrol_user($instance, $user->id) - It will remove a user from specific instance not suspend

enrol_user($instance, $user->id) - It will enroll a user on specific instance 



In reply to Azmat Ullah

Re: unenrolling or suspending?

by Brad Nielsen -
Thanks Azmat, so what is the best way to suspend a user's enrolment in a course (or to unenrol them without deleting grades)?


And does the enrol_user function unsuspend a user or is there another function?