You are here

public function QuizAnswerInterface::score in Quiz 6.x

Calculate the unscaled score in points for this question response.

Parameters

array $values: A part of form state values with the question input from the user.

Return value

int|NULL The unscaled point value of the answer. If a point value is final, questions should make sure to run setEvaluated(). return NULL if the answer is not automatically scored.

8 methods override QuizAnswerInterface::score()
LongAnswerResponse::score in question_types/quiz_long_answer/src/Plugin/quiz/QuizQuestion/LongAnswerResponse.php
Calculate the unscaled score in points for this question response.
MatchingResponse::score in question_types/quiz_matching/src/Plugin/quiz/QuizQuestion/MatchingResponse.php
Implementation of score().
MultichoiceResponse::score in question_types/quiz_multichoice/src/Plugin/quiz/QuizQuestion/MultichoiceResponse.php
Calculate the unscaled score in points for this question response.
QuizDirectionsResponse::score in question_types/quiz_directions/src/Plugin/quiz/QuizQuestion/QuizDirectionsResponse.php
Calculate the unscaled score in points for this question response.
QuizPageResponse::score in question_types/quiz_page/src/Plugin/quiz/QuizQuestion/QuizPageResponse.php
Calculate the unscaled score in points for this question response.

... See full list

File

src/QuizAnswerInterface.php, line 110

Class

QuizAnswerInterface
Provides an interface for quiz answers.

Namespace

Drupal\quiz

Code

public function score(array $values) : ?int;