You are here

public function QuizResultAnswerEntityTrait::canReview in Quiz 6.x

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

File

src/Entity/QuizResultAnswerEntityTrait.php, line 163

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 canReview(string $option) : bool {
  $can_review =& drupal_static(__METHOD__, []);
  if (!isset($can_review[$option])) {
    $quiz_result = $this
      ->getQuizResult();
    $can_review[$option] = $quiz_result
      ->canReview($option);
  }
  return $can_review[$option];
}