Skip to main content

Function: updateCourse()

function updateCourse(
context,
siteUrl,
courseId,
__namedParameters
): Promise<{
changed: string;
course?: Course;
}>;

Defined in: areas/courses/list.ts:93

Changes a course's full name, short name, summary (HTML) or any other setting by its form field name, through the course's settings form; returns the course as listCourses gives it. embed takes local files the summary names (<img src="shot.png">), put in it as Moodle's editor does. Moodle's refusals (a short name already taken) come back as FormError by field.

Parameters​

ParameterType
contextBrowserContext
siteUrlstring
courseIdnumber
__namedParameters{ embed?: string[]; fullName?: string; settings?: Record<string, FieldValue>; shortName?: string; summary?: string; }
__namedParameters.embed?string[]
__namedParameters.fullName?string
__namedParameters.settings?Record<string, FieldValue>
__namedParameters.shortName?string
__namedParameters.summary?string

Returns​

Promise<{ changed: string; course?: Course; }>