You are here

final public function QuizResultAnswerEntityTrait::getPoints in Quiz 6.x

Same name and namespace in other branches
  1. 8.6 src/Entity/QuizResultAnswerEntityTrait.php \Drupal\quiz\Entity\QuizResultAnswerEntityTrait::getPoints()
  2. 8.5 src/Entity/QuizResultAnswerEntityTrait.php \Drupal\quiz\Entity\QuizResultAnswerEntityTrait::getPoints()

This is marked as final to make sure that no question overrides this and causes reporting issues.

4 calls to QuizResultAnswerEntityTrait::getPoints()
LongAnswerResponse::getFeedbackValues in question_types/quiz_long_answer/src/Plugin/quiz/QuizQuestion/LongAnswerResponse.php
QuizResultAnswerEntityTrait::getReportFormScore in src/Entity/QuizResultAnswerEntityTrait.php
Implementation of getReportFormScore().
QuizResultAnswerEntityTrait::isCorrect in src/Entity/QuizResultAnswerEntityTrait.php
ShortAnswerResponse::getFeedbackValues in question_types/quiz_short_answer/src/Plugin/quiz/QuizQuestion/ShortAnswerResponse.php

File

src/Entity/QuizResultAnswerEntityTrait.php, line 58

Class

QuizResultAnswerEntityTrait
Each question type must store its own response data and be able to calculate a score for that data.

Namespace

Drupal\quiz\Entity

Code

public final function getPoints() : int {
  return (int) $this
    ->get('points_awarded')
    ->getString();
}