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


Public Member Functions | |
| get_renderer (moodle_page $page) | |
| get_min_fraction () | |
| clear_wrong_from_response (array $response) | |
| get_num_parts_right (array $response) | |
| get_expected_data () | |
| summarise_response (array $response) | |
| classify_response (array $response) | |
| get_correct_response () | |
| is_same_response (array $prevresponse, array $newresponse) | |
| is_complete_response (array $response) | |
| is_gradable_response (array $response) | |
| get_num_selected_choices (array $response) | |
| get_num_correct_choices () | |
| grade_response (array $response) | |
| get_validation_error (array $response) | |
| get_hint ($hintnumber, question_attempt $qa) | |
| get_response (question_attempt $qa) | |
| is_choice_selected ($response, $value) | |
Protected Member Functions | |
| field ($key) | |
| disable_hint_settings_when_too_many_selected (question_hint_with_parts $hint) | |
Represents a multiple choice question where multiple choices can be selected.
Definition at line 242 of file question.php.
| classify_response | ( | array $ | response | ) |
Categorise the student's response according to the categories defined by get_possible_responses.
| $response | a response, as might be passed to grade_response(). |
Reimplemented from question_with_responses.
Definition at line 309 of file question.php.

| clear_wrong_from_response | ( | array $ | response | ) |
Given a response, rest the parts that are wrong.
| array | $response | a response |
Reimplemented from question_definition.
Definition at line 251 of file question.php.

| disable_hint_settings_when_too_many_selected | ( | question_hint_with_parts $ | hint | ) | [protected] |
Disable those hint settings that we don't want when the student has selected more choices than the number of right choices. This avoids giving the game away.
| question_hint_with_parts | $hint | a hint. |
Definition at line 412 of file question.php.

| field | ( | $ | key | ) | [protected] |
| int | $key | choice number |
Definition at line 282 of file question.php.

What data would need to be submitted to get this question correct. If there is more than one correct answer, this method should just return one possibility. If it is not possible to compute a correct response, this method should return null.
Reimplemented from question_definition.
Definition at line 327 of file question.php.

What data may be included in the form submission when a student submits this question in its current state?
This information is used in calls to optional_param. The parameter name has question_attempt::get_field_prefix() automatically prepended.
Reimplemented from question_definition.
Definition at line 286 of file question.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. |
Reimplemented from question_graded_automatically.
Definition at line 417 of file question.php.

| get_min_fraction | ( | ) |
Some questions can return a negative mark if the student gets it wrong.
This method returns the lowest mark the question can return, on the fraction scale. that is, where the maximum possible mark is 1.0.
Reimplemented from question_definition.
Definition at line 247 of file question.php.
Definition at line 379 of file question.php.


| get_num_parts_right | ( | array $ | response | ) |
Return the number of subparts of this response that are right.
| array | $response | a response |
Reimplemented from question_definition.
Definition at line 262 of file question.php.

| get_num_selected_choices | ( | array $ | response | ) |
| array | $response | responses, as returned by question_attempt_step::get_qt_data(). |
Definition at line 366 of file question.php.

| get_renderer | ( | moodle_page $ | page | ) |
| moodle_page | the page we are outputting to. |
Reimplemented from question_definition.
Definition at line 243 of file question.php.

| get_response | ( | question_attempt $ | qa | ) |
Reimplemented from qtype_multichoice_base.
Definition at line 431 of file question.php.

| get_validation_error | ( | array $ | response | ) |
In situations where is_gradable_response() returns false, this method should generate a description of what the problem is.
Implements question_automatically_gradable.
Definition at line 400 of file question.php.

| 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(). |
Implements question_automatically_gradable.
Definition at line 389 of file question.php.

| is_choice_selected | ( | $ | response, |
| $ | value | ||
| ) |
Reimplemented from qtype_multichoice_base.
Definition at line 435 of file question.php.
| is_complete_response | ( | array $ | response | ) |
Used by many of the behaviours, to work out whether the student's response to the question is complete. That is, whether the question attempt should move to the COMPLETE or INCOMPLETE state.
| array | $response | responses, as returned by question_attempt_step::get_qt_data(). |
Implements question_manually_gradable.
Definition at line 348 of file question.php.


| 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(). |
Reimplemented from question_graded_automatically.
Definition at line 357 of file question.php.


| is_same_response | ( | array $ | prevresponse, |
| array $ | newresponse | ||
| ) |
Use by many of the behaviours to determine whether the student's response has changed. This is normally used to determine that a new set of responses can safely be discarded.
| array | $prevresponse | the responses previously recorded for this question, as returned by question_attempt_step::get_qt_data() |
| array | $newresponse | the new responses, in the same format. |
Implements question_manually_gradable.
Definition at line 338 of file question.php.

| summarise_response | ( | array $ | response | ) |
Produce a plain text summary of a response.
| $response | a response, as might be passed to grade_response(). |
Implements question_manually_gradable.
Definition at line 294 of file question.php.
