Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

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

Question type class for the embedded element in question text question types.

Copyright: 2011 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 353 lines (13 kb)
Included or required:0 times
Referenced: 3 times
Includes or requires: 0 files

Defines 1 class


Class: qtype_gapselect_base  - X-Ref

The embedded element in question text question type class.

save_question_options($question)   X-Ref
Choices are stored in the question_answers table, and any options need to
be put into the feedback field somehow. This method is responsible for
converting all the options to a single string for this purpose. It is used
by {@link save_question_options()}.

param: array $choice the form data relating to this choice.
return: string ready to store in the database.

get_question_options($question)   X-Ref
No description

delete_question($questionid, $contextid)   X-Ref
No description

initialise_question_instance(question_definition $question, $questiondata)   X-Ref
Used by {@link initialise_question_instance()} to set up the choice-specific data.

param: object $choicedata as loaded from the question_answers table.
return: object an appropriate object for representing the choice.

make_hint($hint)   X-Ref
No description

get_random_guess_score($questiondata)   X-Ref
No description

get_array_of_choices($question)   X-Ref
This method gets the choices (answers)
in a 2 dimentional array.

param: object $question
return: array of groups

get_array_of_groups($question, $state)   X-Ref
This method gets the choices (answers) and sort them by groups
in a 2 dimentional array.

param: object $question
param: object $state Question state object
return: array of groups

get_correct_answers($question)   X-Ref
This method gets the correct answers in a 2 dimentional array.

param: object $question
return: array of groups

get_array_of_placeholders($question)   X-Ref
Return the list of groups used in a question.

param: stdClass $question the question data.
return: array the groups used, or false if an error occurs.

get_group_of_players($question, $state, $subquestions, $group)   X-Ref
No description

get_possible_responses($questiondata)   X-Ref
No description

move_files($questionid, $oldcontextid, $newcontextid)   X-Ref
No description

delete_files($questionid, $contextid)   X-Ref
No description