Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)

Functions

 question_preview_action_url ($questionid, $qubaid, question_preview_options $options, $context)
 The the URL to use for actions relating to this preview.
 
 question_preview_form_url ($questionid, $context, $previewid=null)
 The the URL to use for actions relating to this preview.
 
 question_preview_question_pluginfile ($course, $context, $component, $filearea, $qubaid, $slot, $args, $forcedownload, $fileoptions)
 Called via pluginfile.php -> question_pluginfile to serve files belonging to a question in a question_attempt when that attempt is a preview.
 
 restart_preview ($previewid, $questionid, $displayoptions, $context)
 Delete the current preview, if any, and redirect to start a new preview.
 

Detailed Description

Function Documentation

◆ question_preview_action_url()

question_preview_action_url ( $questionid,
$qubaid,
question_preview_options $options,
$context )

The the URL to use for actions relating to this preview.

Parameters
int$questionidthe question being previewed.
int$qubaidthe id of the question usage for this preview.
question_preview_options$optionsthe options in use.
context$context
Deprecated
since Moodle 4.0
See also
qbank_previewquestion\helper\question_preview_action_url()
Todo
Final deprecation on Moodle 4.4 MDL-72438

◆ question_preview_form_url()

question_preview_form_url ( $questionid,
$context,
$previewid = null )

The the URL to use for actions relating to this preview.

Parameters
int$questionidthe question being previewed.
context$contextthe current moodle context.
int$previewidoptional previewid to sign post saved previewed answers.
Deprecated
since Moodle 4.0
See also
qbank_previewquestion\helper\question_preview_form_url()
Todo
Final deprecation on Moodle 4.4 MDL-72438

◆ question_preview_question_pluginfile()

question_preview_question_pluginfile ( $course,
$context,
$component,
$filearea,
$qubaid,
$slot,
$args,
$forcedownload,
$fileoptions )

Called via pluginfile.php -> question_pluginfile to serve files belonging to a question in a question_attempt when that attempt is a preview.

Parameters
stdClass$coursecourse settings object
stdClass$contextcontext object
string$componentthe name of the component we are serving files for.
string$fileareathe name of the file area.
int$qubaidthe question_usage this image belongs to.
int$slotthe relevant slot within the usage.
array$argsthe remaining bits of the file path.
bool$forcedownloadwhether the user must be forced to download the file.
array$fileoptions
Return values
voidfalse if file not found, does not return if found - justsend the file
Deprecated
since Moodle 4.0
See also
qbank_previewquestion\helper\question_preview_question_pluginfile()
Todo
Final deprecation on Moodle 4.4 MDL-72438

◆ restart_preview()

restart_preview ( $previewid,
$questionid,
$displayoptions,
$context )

Delete the current preview, if any, and redirect to start a new preview.

Parameters
int$previewid
int$questionid
object$displayoptions
object$context
Deprecated
since Moodle 4.0
See also
qbank_previewquestion\helper\restart_preview()
Todo
Final deprecation on Moodle 4.4 MDL-72438