I'm trying to figure out how to enroll users into a course. I'm trying to figure out exactly how I get the context id for a course that the function moodle_role_assign requires . It doesn't appear there is any way to do this. I see work is being done on a new function (http://tracker.moodle.org/browse/MDL-26250), but it too appears to require a context id. Am I overlooking a function to get a context id for a course?
That's great for enrolling users. What about unenrolling them? The only external service function currently available for that is the simple role_unassign one under /enrol/externallib.php, and it, too, requires a contextid to function.
Will there be a simple unenroll service as there is for enrolling?
Will there be a simple unenroll service as there is for enrolling?