abstract public function QuizResultAnswerEntityTrait::score in Quiz 8.5
Same name and namespace in other branches
- 8.6 src/Entity/QuizResultAnswerEntityTrait.php \Drupal\quiz\Entity\QuizResultAnswerEntityTrait::score()
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 The unscaled point value of the answer.
8 methods override QuizResultAnswerEntityTrait::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 - Implementation of score().
- QuizPageResponse::score in question_types/
quiz_page/ src/ Plugin/ quiz/ QuizQuestion/ QuizPageResponse.php - Calculate the unscaled score in points for this question response.
File
- src/
Entity/ QuizResultAnswerEntityTrait.php, line 203
Class
- QuizResultAnswerEntityTrait
- Each question type must store its own response data and be able to calculate a score for that data.
Namespace
Drupal\quiz\EntityCode
public abstract function score(array $values);