Saltar al contenido principal

Function: answerQuizQuestions()

function answerQuizQuestions(
context,
siteUrl,
attemptId,
answers,
__namedParameters?
): Promise<{
attemptId: number;
changed: string;
questions: Question[];
}>;

Defined in: areas/quizzes/attempts.ts:375

Saves answers in an attempt in progress without finishing it, and gives its questions afterwards. With the realistic trail, it first takes the time a reader needs for the questions and their options (ADR-005), calling onProgress with the seconds elapsed and the total.

Parameters​

ParameterType
contextBrowserContext
siteUrlstring
attemptIdnumber
answersobject[]
__namedParameters{ onProgress?: (elapsed, total) => void; trail?: "realistic" | "fast"; }
__namedParameters.onProgress?(elapsed, total) => void
__namedParameters.trail?"realistic" | "fast"

Returns​

Promise<{ attemptId: number; changed: string; questions: Question[]; }>