Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

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

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: 666 lines (30 kb)
Included or required:0 times
Referenced: 3 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.