Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Protected Attributes | List of all members
question_first_matching_answer_grading_strategy Class Reference

This grading strategy is used by question types like shortanswer an numerical. More...

Inheritance diagram for question_first_matching_answer_grading_strategy:
question_grading_strategy

Public Member Functions

 __construct (question_response_answer_comparer $question)
 
 get_correct_answer ()
 
 grade (array $response)
 Return a question answer that describes the outcome (fraction and feeback) for a particular respons. More...
 

Protected Attributes

question_response_answer_comparer $question
 (presumably also a question_definition) the question we are doing the grading for.
 

Detailed Description

This grading strategy is used by question types like shortanswer an numerical.

It gets a list of possible answers from the question, and returns the first one that matches the given response. It returns the first answer with fraction 1.0 when asked for the correct answer.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

question_first_matching_answer_grading_strategy::__construct ( question_response_answer_comparer  $question)
Parameters
question_response_answer_comparer$question(presumably also a question_definition) the question we are doing the grading for.

Member Function Documentation

◆ get_correct_answer()

question_first_matching_answer_grading_strategy::get_correct_answer ( )
Return values
question_answeran answer that contains the a response that would get full marks.

Implements question_grading_strategy.

◆ grade()

question_first_matching_answer_grading_strategy::grade ( array  $response)

Return a question answer that describes the outcome (fraction and feeback) for a particular respons.

Parameters
array$responsethe response.
Return values
question_answerthe answer describing the outcome.

Implements question_grading_strategy.


The documentation for this class was generated from the following file: