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


Public Member Functions | |
| __construct () | |
| get_expected_data () | |
| summarise_response (array $response) | |
| is_complete_response (array $response) | |
| get_validation_error (array $response) | |
| is_same_response (array $prevresponse, array $newresponse) | |
| get_answers () | |
| compare_response_with_answer (array $response, question_answer $answer) | |
| check_file_access ($qa, $options, $component, $filearea, $args, $forcedownload) | |
Static Public Member Functions | |
| static | compare_string_with_wildcard ($string, $pattern, $ignorecase) |
Data Fields | |
| $usecase | |
| $answers = array() | |
Represents a short answer question.
Definition at line 36 of file question.php.
| __construct | ( | ) |
Constructor. Normally to get a question, you call question_bank::load_question(), but questions can be created directly, for example in unit test code.
Reimplemented from question_definition.
Definition at line 43 of file question.php.
| check_file_access | ( | $ | qa, |
| $ | options, | ||
| $ | component, | ||
| $ | filearea, | ||
| $ | args, | ||
| $ | forcedownload | ||
| ) |
Checks whether the users is allow to be served a particular file.
| question_attempt | $qa | the question attempt being displayed. |
| question_display_options | $options | the options that control display of the question. |
| string | $component | the name of the component we are serving files for. |
| string | $filearea | the name of the file area. |
| array | $args | the remaining bits of the file path. |
| bool | $forcedownload | whether the user must be forced to download the file. |
Reimplemented from question_definition.
Definition at line 104 of file question.php.

| compare_response_with_answer | ( | array $ | response, |
| question_answer $ | answer | ||
| ) |
| array | $response | the response. |
| question_answer | $answer | an answer. |
Implements question_response_answer_comparer.
Definition at line 80 of file question.php.

| static compare_string_with_wildcard | ( | $ | string, |
| $ | pattern, | ||
| $ | ignorecase | ||
| ) | [static] |
| get_answers | ( | ) |
Implements question_response_answer_comparer.
Definition at line 76 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 47 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 64 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 59 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 71 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 51 of file question.php.
| $answers = array() |
Definition at line 41 of file question.php.
| $usecase |
Definition at line 39 of file question.php.