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

Public Member Functions

 get_renderer (moodle_page $page)
 get_min_fraction ()
 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)
 grade_response (array $response)
 get_validation_error (array $response)
 get_response (question_attempt $qa)
 is_choice_selected ($response, $value)

Detailed Description

Represents a multiple choice question where only one choice should be selected.

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

Reimplemented from question_with_responses.

Definition at line 176 of file question.php.

Here is the call graph for this function:

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 187 of file question.php.

Here is the call graph for this function:

Return an array of the question type variables that could be submitted as part of a question of this type, with their types, so they can be properly cleaned.

Returns:
array variable name => PARAM_... constant.

Reimplemented from question_definition.

Definition at line 162 of file question.php.

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.

Returns:
number minimum fraction this question will ever return.

Reimplemented from question_definition.

Definition at line 148 of file question.php.

Parameters:
moodle_pagethe page we are outputting to.
Returns:
qtype_renderer the renderer to use for outputting this question.

Reimplemented from question_definition.

Definition at line 144 of file question.php.

Here is the call graph for this function:

Reimplemented from qtype_multichoice_base.

Definition at line 226 of file question.php.

Here is the call graph for this function:

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 219 of file question.php.

Here is the call graph for this function:

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 209 of file question.php.

Here is the call graph for this function:

is_choice_selected ( response,
value 
)

Reimplemented from qtype_multichoice_base.

Definition at line 230 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 201 of file question.php.

Here is the caller graph for this function:

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.

Reimplemented from question_graded_automatically.

Definition at line 205 of file question.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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 197 of file question.php.

Here is the call graph for this function:

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 166 of file question.php.

Here is the call graph for this function:


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