|
Moodle
2.2.1
http://www.collinsharper.com
|


Public Member Functions | |
| is_gradable_response (array $response) | |
| get_validation_error (array $response) | |
| grade_response (array $response) | |
| get_hint ($hintnumber, question_attempt $qa) | |
| get_right_answer_summary () | |
Interface that a question_definition must implement to be usable by the various automatic grading behaviours.
Definition at line 470 of file questionbase.php.
| get_hint | ( | $ | hintnumber, |
| question_attempt $ | qa | ||
| ) |
Get one of the question hints. The question_attempt is passed in case the question type wants to do something complex. For example, the multiple choice with multiple responses question type will turn off most of the hint options if the student has selected too many opitions.
| int | $hintnumber | Which hint to display. Indexed starting from 0 |
| question_attempt | $qa | The question_attempt. |
Implemented in question_graded_automatically, qtype_multichoice_multi_question, and qtype_missingtype_question.
Generate a brief, plain-text, summary of the correct answer to this question. This is used by various reports, and can also be useful when testing. This method will return null if such a summary is not possible, or inappropriate.
Implemented in question_graded_automatically, and qtype_missingtype_question.
| get_validation_error | ( | array $ | response | ) |
In situations where is_gradable_response() returns false, this method should generate a description of what the problem is.
Implemented in qtype_multichoice_multi_question, qtype_multichoice_single_question, qtype_match_question, qtype_multianswer_question, qtype_numerical_question, qtype_truefalse_question, qtype_shortanswer_question, and qtype_missingtype_question.
| grade_response | ( | array $ | response | ) |
Grade a response to the question, returning a fraction between get_min_fraction() and 1.0, and the corresponding question_state right, partial or wrong.
| array | $response | responses, as returned by question_attempt_step::get_qt_data(). |
Implemented in question_graded_by_strategy, qtype_multichoice_multi_question, qtype_match_question, qtype_numerical_question, qtype_multianswer_question, qtype_multichoice_single_question, qtype_truefalse_question, and qtype_missingtype_question.

| is_gradable_response | ( | array $ | response | ) |
Use by many of the behaviours to determine whether the student has provided enough of an answer for the question to be graded automatically, or whether it must be considered aborted.
| array | $response | responses, as returned by question_attempt_step::get_qt_data(). |
Implemented in question_graded_automatically, qtype_multichoice_multi_question, qtype_match_question, qtype_multichoice_single_question, qtype_multianswer_question, qtype_numerical_question, and qtype_missingtype_question.