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

Public Member Functions

 __construct (question_grading_strategy $strategy)
 get_correct_response ()
 get_matching_answer (array $response)
 get_correct_answer ()
 grade_response (array $response)
 classify_response (array $response)

Protected Attributes

 $gradingstrategy

Detailed Description

This class represents a question that can be graded automatically by using a question_grading_strategy.

Definition at line 659 of file questionbase.php.


Constructor & Destructor Documentation

Parameters:
question_grading_strategy$strategythe strategy to use for grading.

Definition at line 664 of file questionbase.php.

Here is the call graph for this function:


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 706 of file questionbase.php.

Here is the call graph for this function:

Returns:
question_answer an answer that contains the a response that would get full marks.

Definition at line 692 of file questionbase.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 669 of file questionbase.php.

Here is the call graph for this function:

get_matching_answer ( array response)

Get an answer that contains the feedback and fraction that should be awarded for this resonse.

Parameters:
array$responsea response.
Returns:
question_answer the matching answer.

Definition at line 684 of file questionbase.php.

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

Here is the call graph for this function:


Field Documentation

$gradingstrategy [protected]

Definition at line 661 of file questionbase.php.


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