Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
core_question_external Class Reference

Question external functions. More...

Inheritance diagram for core_question_external:

Static Public Member Functions

static get_random_question_summaries ( $categoryid, $includesubcategories, $tagids, $contextid, $limit=0, $offset=0)
 Gets the list of random questions for the given criteria.
 
static get_random_question_summaries_parameters ()
 Returns description of method parameters.
 
static get_random_question_summaries_returns ()
 Returns description of method result value.
 
static submit_tags_form ($questionid, $contextid, $formdata)
 Handles the tags form submission.
 
static submit_tags_form_is_deprecated ()
 Marking the method as deprecated.
 
static submit_tags_form_parameters ()
 Returns description of method parameters.
 
static submit_tags_form_returns ()
 Returns description of method result value.
 
static update_flag ($qubaid, $questionid, $qaid, $slot, $checksum, $newstate)
 Update the flag state of a question attempt.
 
static update_flag_parameters ()
 Returns description of method parameters.
 
static update_flag_returns ()
 Returns description of method result value.
 

Detailed Description

Question external functions.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Since
Moodle 3.1

Member Function Documentation

◆ get_random_question_summaries()

static core_question_external::get_random_question_summaries ( $categoryid,
$includesubcategories,
$tagids,
$contextid,
$limit = 0,
$offset = 0 )
static

Gets the list of random questions for the given criteria.

The questions will be exported in a summaries format and won't include all of the question data.

Parameters
int$categoryidCategory id to find random questions
bool$includesubcategoriesInclude the subcategories in the search
int[]$tagidsOnly include questions with these tags
int$contextidThe context id where the questions will be rendered
int$limitMaximum number of results to return
int$offsetNumber of items to skip from the beginning of the result set.
Return values
arrayThe list of questions and total question count.

◆ get_random_question_summaries_parameters()

static core_question_external::get_random_question_summaries_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters.

◆ submit_tags_form()

static core_question_external::submit_tags_form ( $questionid,
$contextid,
$formdata )
static

Handles the tags form submission.

Parameters
int$questionidThe question id.
int$contextidThe editing context id.
string$formdataThe question tag form data in a URI encoded param string
Return values
arrayThe created or modified question tag
Deprecated
since Moodle 4.0
See also
qbank_tagquestion\external\qbank_tagquestion_external
Todo
Final deprecation on Moodle 4.4 MDL-72438

◆ submit_tags_form_is_deprecated()

static core_question_external::submit_tags_form_is_deprecated ( )
static

Marking the method as deprecated.

Return values
bool
Todo
Final deprecation on Moodle 4.4 MDL-72438

◆ submit_tags_form_parameters()

static core_question_external::submit_tags_form_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters.
Deprecated
since Moodle 4.0
See also
qbank_tagquestion\external\qbank_tagquestion_external
Todo
Final deprecation on Moodle 4.4 MDL-72438

◆ submit_tags_form_returns()

static core_question_external::submit_tags_form_returns ( )
static

Returns description of method result value.

Deprecated
since Moodle 4.0
See also
qbank_tagquestion\external\qbank_tagquestion_external
Todo
Final deprecation on Moodle 4.4 MDL-72438

◆ update_flag()

static core_question_external::update_flag ( $qubaid,
$questionid,
$qaid,
$slot,
$checksum,
$newstate )
static

Update the flag state of a question attempt.

Parameters
int$qubaidthe question usage id.
int$questionidthe question id.
int$qaidthe question_attempt id.
int$slotthe slot number within the usage.
string$checksumchecksum, as computed by get_toggle_checksum() corresponding to the last three arguments and the users username.
bool$newstatethe new state of the flag. true = flagged.
Return values
array(success infos and fail infos)
Since
Moodle 3.1

◆ update_flag_parameters()

static core_question_external::update_flag_parameters ( )
static

Returns description of method parameters.

Return values
external_function_parameters
Since
Moodle 3.1

◆ update_flag_returns()

static core_question_external::update_flag_returns ( )
static

Returns description of method result value.

Return values
external_description
Since
Moodle 3.1

The documentation for this class was generated from the following file: