Skip to main content

Function: createGroup()

function createGroup(
context,
siteUrl,
courseId,
settings
): Promise<{
changed: string;
groupId: number;
}>;

Defined in: areas/participants/groups.ts:97

Creates a group in a course with its group form (group/group.php). Throws FormError with Moodle's reason when it refuses (a name already used, an enrolment key another group has).

Parameters​

ParameterType
contextBrowserContext
siteUrlstring
courseIdnumber
settingsGroupSettings & object

Returns​

Promise<{ changed: string; groupId: number; }>