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


Public Member Functions | |
| make_behaviour (question_attempt $qa, $preferredbehaviour) | |
| get_format_renderer (moodle_page $page) | |
| get_expected_data () | |
| summarise_response (array $response) | |
| get_correct_response () | |
| is_complete_response (array $response) | |
| is_same_response (array $prevresponse, array $newresponse) | |
| check_file_access ($qa, $options, $component, $filearea, $args, $forcedownload) | |
Data Fields | |
| $responseformat | |
| $responsefieldlines | |
| $attachments | |
| $graderinfo | |
| $graderinfoformat | |
Represents an essay question.
Definition at line 36 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 95 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 80 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 56 of file question.php.
| get_format_renderer | ( | moodle_page $ | page | ) |
| moodle_page | the page we are outputting to. |
Definition at line 52 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 84 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 88 of file question.php.

| make_behaviour | ( | question_attempt $ | qa, |
| $ | preferredbehaviour | ||
| ) |
Creat the appropriate behaviour for an attempt at this quetsion, given the desired (archetypal) behaviour.
This default implementation will suit most normal graded questions.
If your question is of a patricular type, then it may need to do something different. For example, if your question can only be graded manually, then it should probably return a manualgraded behaviour, irrespective of what is asked for.
If your question wants to do somthing especially complicated is some situations, then you may wish to return a particular behaviour related to the one asked for. For example, you migth want to return a qbehaviour_interactive_adapted_for_myqtype.
| question_attempt | $qa | the attempt we are creating an behaviour for. |
| string | $preferredbehaviour | the requested type of behaviour. |
Reimplemented from question_definition.
Definition at line 43 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 69 of file question.php.

| $attachments |
Definition at line 39 of file question.php.
| $graderinfo |
Definition at line 40 of file question.php.
| $graderinfoformat |
Definition at line 41 of file question.php.
| $responsefieldlines |
Definition at line 38 of file question.php.
| $responseformat |
Definition at line 37 of file question.php.