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

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)

Detailed Description

Represents a multiple choice question where multiple choices can be selected.

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

Here is the call graph for this function:

Given a response, rest the parts that are wrong.

Parameters:
array$responsea response
Returns:
array a cleaned up response with the wrong bits reset.

Reimplemented from question_definition.

Definition at line 251 of file question.php.

Here is the call graph for this function:

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.

Parameters:
question_hint_with_parts$hinta hint.

Definition at line 412 of file question.php.

Here is the caller graph for this function:

field ( key) [protected]
Parameters:
int$keychoice number
Returns:
string the question-type variable name.

Definition at line 282 of file question.php.

Here is the caller 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 327 of file question.php.

Here is the call graph for this function:

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

Here is the call graph for this function:

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.

Reimplemented from question_graded_automatically.

Definition at line 417 of file question.php.

Here is the call graph for this function:

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

Returns:
int the number of choices that are correct.

Definition at line 379 of file question.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_num_parts_right ( array response)

Return the number of subparts of this response that are right.

Parameters:
array$responsea response
Returns:
array with two elements, the number of correct subparts, and the total number of subparts.

Reimplemented from question_definition.

Definition at line 262 of file question.php.

Here is the call graph for this function:

Parameters:
array$responseresponses, as returned by question_attempt_step::get_qt_data().
Returns:
int the number of choices that were selected. in this response.

Definition at line 366 of file question.php.

Here is the caller graph for this function:

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

Here is the call graph for this function:

Reimplemented from qtype_multichoice_base.

Definition at line 431 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 400 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 389 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 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.

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

Here is the call graph for this function:

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 357 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 338 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 294 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