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 310 and 311] [Versions 311 and 400] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

Question type class for the multi-answer question type.

Copyright: 1999 onwards Martin Dougiamas {@link http://moodle.com}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 660 lines (30 kb)
Included or required:0 times
Referenced: 2 times
Includes or requires: 0 files

Defines 2 classes


Class: qtype_multianswer  - X-Ref

The multi-answer question type class.

deleted_subquestion_replacement()   X-Ref
Generate a subquestion replacement question class.

Due to a bug, subquestions can be lost (see MDL-54724). This class exists to take
the place of those lost questions so that the system can keep working and inform
the user of the corrupted data.

return: question_automatically_gradable The replacement question class.

Class: implements  - X-Ref

__construct()   X-Ref
No description

name()   X-Ref
No description

is_gradable_response(array $response)   X-Ref
No description

is_complete_response(array $response)   X-Ref
No description

is_same_response(array $prevresponse, array $newresponse)   X-Ref
No description

summarise_response(array $response)   X-Ref
No description

un_summarise_response(string $summary)   X-Ref
No description

classify_response(array $response)   X-Ref
No description

get_validation_error(array $response)   X-Ref
No description

grade_response(array $response)   X-Ref
No description

get_hint($hintnumber, question_attempt $qa)   X-Ref
No description

get_right_answer_summary()   X-Ref
No description

can_analyse_responses()   X-Ref
No description

get_question_options($question)   X-Ref
No description

save_question_options($question)   X-Ref
No description

save_question($authorizedquestion, $form)   X-Ref
No description

make_hint($hint)   X-Ref
No description

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

initialise_question_instance(question_definition $question, $questiondata)   X-Ref
No description

get_random_guess_score($questiondata)   X-Ref
No description

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

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

qtype_multianswer_initialise_multichoice_subquestion($wrapped)   X-Ref
Initialise subquestion fields that are constant across all MULTICHOICE
types.

param: objet $wrapped  The subquestion to initialise

qtype_multianswer_extract_question($text)   X-Ref
No description

qtype_multianswer_validate_question(stdClass $question)   X-Ref
Validate a multianswer question.

param: object $question  The multianswer question to validate as returned by qtype_multianswer_extract_question
return: array Array of error messages with questions field names as keys.