Saltar al contenido principal

Function: unenrolUser()

function unenrolUser(
context,
siteUrl,
courseId,
userId
): Promise<{
changed: string;
kept: string[];
removed: string[];
}>;

Defined in: areas/participants/enrolments.ts:171

Unenrols a user from a course: removes every enrolment of theirs the person may remove (its unenrol link on the participants page), with their roles and group memberships in the course, as that link does. changed and removed say which ones (by enrolment method's name), kept those the person may not remove (a cohort sync, another teacher's method). Throws EnrolmentError when the user isn't enrolled.

Parameters​

ParameterType
contextBrowserContext
siteUrlstring
courseIdnumber
userIdnumber

Returns​

Promise<{ changed: string; kept: string[]; removed: string[]; }>