You are here

public function QuizResultAnswerEntityTrait::getQuizResult in Quiz 8.6

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

Get the result of this question response.

Return value

QuizResult

1 call to QuizResultAnswerEntityTrait::getQuizResult()
QuizResultAnswerEntityTrait::canReview in src/Entity/QuizResultAnswerEntityTrait.php
Can the quiz taker view the requested review?

File

src/Entity/QuizResultAnswerEntityTrait.php, line 35

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 function getQuizResult() {
  return Drupal::entityTypeManager()
    ->getStorage('quiz_result')
    ->load($this
    ->get('result_id')
    ->getString());
}