You are here

final public function QuizResultAnswerEntityTrait::getPoints in Quiz 8.6

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

Get the scaled awarded points.

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

Return value

float The user's scaled awarded points for this question.

4 calls to QuizResultAnswerEntityTrait::getPoints()
LongAnswerResponse::getFeedbackValues in question_types/quiz_long_answer/src/Plugin/quiz/QuizQuestion/LongAnswerResponse.php
Get the response part of the report form.
QuizResultAnswerEntityTrait::getReportFormScore in src/Entity/QuizResultAnswerEntityTrait.php
Implementation of getReportFormScore().
QuizResultAnswerEntityTrait::isCorrect in src/Entity/QuizResultAnswerEntityTrait.php
Check to see if the answer is marked as correct.
ShortAnswerResponse::getFeedbackValues in question_types/quiz_short_answer/src/Plugin/quiz/QuizQuestion/ShortAnswerResponse.php
Get the response part of the report form.

File

src/Entity/QuizResultAnswerEntityTrait.php, line 74

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() {
  return (int) $this
    ->get('points_awarded')
    ->getString();
}