Skip to main content

Function: createActivity()

function createActivity(
context,
siteUrl,
input
): Promise<CourseChange>;

Defined in: areas/activities/build.ts:157

Creates an activity or resource of any type at the end of a section, through Moodle's own form, hidden from students unless visibility says otherwise. files are local paths uploaded to a file resource or folder (a DraftUpload puts one in a folder's subfolder); a SCORM (type: "scorm") or an H5P activity (type: "h5pactivity") takes the first as its package.

Parameters​

ParameterType
contextBrowserContext
siteUrlstring
inputActivityFields & object

Returns​

Promise<CourseChange>