Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403]

External question API

Copyright: 2016 Pau Ferrer <pau@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 317 lines (13 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: core_question_external  - X-Ref

Question external functions

update_flag_parameters()   X-Ref
Returns description of method parameters

return: external_function_parameters

update_flag($qubaid, $questionid, $qaid, $slot, $checksum, $newstate)   X-Ref
Update the flag state of a question attempt.

param: int $qubaid the question usage id.
param: int $questionid the question id.
param: int $qaid the question_attempt id.
param: int $slot the slot number within the usage.
param: string $checksum checksum, as computed by {@link get_toggle_checksum()}
param: bool $newstate the new state of the flag. true = flagged.
return: array (success infos and fail infos)

update_flag_returns()   X-Ref
Returns description of method result value

return: external_description

submit_tags_form_parameters()   X-Ref
Returns description of method parameters.

return: external_function_parameters.

submit_tags_form($questionid, $contextid, $formdata)   X-Ref
Handles the tags form submission.

param: int $questionid The question id.
param: int $contextid The editing context id.
param: string $formdata The question tag form data in a URI encoded param string
return: array The created or modified question tag

submit_tags_form_returns()   X-Ref
Returns description of method result value.


get_random_question_summaries_parameters()   X-Ref
Returns description of method parameters.

return: external_function_parameters.

get_random_question_summaries($categoryid,$includesubcategories,$tagids,$contextid,$limit = 0,$offset = 0)   X-Ref
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.

param: int $categoryid Category id to find random questions
param: bool $includesubcategories Include the subcategories in the search
param: int[] $tagids Only include questions with these tags
param: int $contextid The context id where the questions will be rendered
param: int $limit Maximum number of results to return
param: int $offset Number of items to skip from the beginning of the result set.
return: array The list of questions and total question count.

get_random_question_summaries_returns()   X-Ref
Returns description of method result value.