Moodle  2.2.1
http://www.collinsharper.com
qtype_missingtype_question Class Reference
Inheritance diagram for qtype_missingtype_question:
Collaboration diagram for qtype_missingtype_question:

Public Member Functions

 get_expected_data ()
 get_correct_response ()
 is_complete_response (array $response)
 is_gradable_response (array $response)
 get_validation_error (array $response)
 is_same_response (array $prevresponse, array $newresponse)
 get_right_answer_summary ()
 summarise_response (array $response)
 classify_response (array $response)
 start_attempt (question_attempt_step $step, $variant)
 grade_response (array $response)
 get_hint ($hintnumber, question_attempt $qa)

Detailed Description

This question definition class is used when the actual question type of this question cannot be found.

Why does this this class implement question_automatically_gradable? I am not sure at the moment. Perhaps it is important for it to work with as many behaviours as possible.

Definition at line 41 of file question.php.


Member Function Documentation

classify_response ( array response)

Categorise the student's response according to the categories defined by get_possible_responses.

Parameters:
$responsea response, as might be passed to grade_response().
Returns:
array subpartid => question_classified_response objects. returns an empty array if no analysis is possible.

Implements question_manually_gradable.

Definition at line 75 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.

Returns:
array|null parameter name => value.

Reimplemented from question_definition.

Definition at line 47 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.

Returns:
array|string variable name => PARAM_... constant, or, as a special case that should only be used in unavoidable, the constant question_attempt::USE_RAW_DATA meaning take all the raw submitted data belonging to this question.

Reimplemented from question_definition.

Definition at line 43 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.

Parameters:
int$hintnumberWhich hint to display. Indexed starting from 0
question_attempt$qaThe question_attempt.

Implements question_automatically_gradable.

Definition at line 89 of file question.php.

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.

Returns:
string|null a plain text summary of the right answer to this question.

Implements question_automatically_gradable.

Definition at line 67 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.

Returns:
string the message.

Implements question_automatically_gradable.

Definition at line 59 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.

Parameters:
array$responseresponses, as returned by question_attempt_step::get_qt_data().
Returns:
array (number, integer) the fraction, and the state.

Implements question_automatically_gradable.

Definition at line 84 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.

Parameters:
array$responseresponses, as returned by question_attempt_step::get_qt_data().
Returns:
bool whether this response is a complete answer to this question.

Implements question_manually_gradable.

Definition at line 51 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.

Parameters:
array$responseresponses, as returned by question_attempt_step::get_qt_data().
Returns:
bool whether this response can be graded.

Implements question_automatically_gradable.

Definition at line 55 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.

Parameters:
array$prevresponsethe responses previously recorded for this question, as returned by question_attempt_step::get_qt_data()
array$newresponsethe new responses, in the same format.
Returns:
bool whether the two sets of responses are the same - that is whether the new set of responses can safely be discarded.

Implements question_manually_gradable.

Definition at line 63 of file question.php.

start_attempt ( question_attempt_step step,
variant 
)

Start a new attempt at this question, storing any information that will be needed later in the step.

This is where the question can do any initialisation required on a per-attempt basis. For example, this is where the multiple choice question type randomly shuffles the choices (if that option is set).

Any information about how the question has been set up for this attempt should be stored in the $step, by calling $step->set_qt_var(...).

Parameters:
question_attempt_stepThe first step of the question_attempt being started. Can be used to store state.
int$varantwhich variant of this question to start. Will be between 1 and get_num_variants() inclusive.

Reimplemented from question_definition.

Definition at line 79 of file question.php.

summarise_response ( array response)

Produce a plain text summary of a response.

Parameters:
$responsea response, as might be passed to grade_response().
Returns:
string a plain text summary of that response, that could be used in reports.

Implements question_manually_gradable.

Definition at line 71 of file question.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations