Saltar al contenido principal

Function: importQuestions()

function importQuestions(
context,
siteUrl,
activityId,
__namedParameters
): Promise<{
changed: string;
questions: BankQuestion[];
}>;

Defined in: areas/questions/banks.ts:218

Imports questions into a bank from a GIFT or Moodle XML file (a local path) or text, through the bank's import form; returns the questions created. A file Moodle can't parse comes back as a QuestionBankError with its messages, and nothing is imported.

Parameters​

ParameterType
contextBrowserContext
siteUrlstring
activityIdnumber
__namedParameters{ categoryId?: number; file?: string; format: "gift" | "xml"; text?: string; }
__namedParameters.categoryId?number
__namedParameters.file?string
__namedParameters.format"gift" | "xml"
__namedParameters.text?string

Returns​

Promise<{ changed: string; questions: BankQuestion[]; }>