You are here

public function QuizResultAnswerEntityTrait::isAnswered in Quiz 8.5

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

Indicate whether the response has been evaluated (scored) yet.

Questions that require human scoring (e.g. essays) may need to manually toggle this.

Return value

bool

File

src/Entity/QuizResultAnswerEntityTrait.php, line 312

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 isAnswered() {
  return (bool) (!$this
    ->get('answer_timestamp')
    ->isEmpty());
}