You are here

public function QuizResultAnswerEntityTrait::canReview in Quiz 8.5

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

Can the quiz taker view the requested review?

Parameters

string $option: An option key.

Return value

bool

File

src/Entity/QuizResultAnswerEntityTrait.php, line 221

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