public function QuizResultAnswerEntityTrait::isCorrect in Quiz 6.x
Same name and namespace in other branches
- 8.6 src/Entity/QuizResultAnswerEntityTrait.php \Drupal\quiz\Entity\QuizResultAnswerEntityTrait::isCorrect()
- 8.5 src/Entity/QuizResultAnswerEntityTrait.php \Drupal\quiz\Entity\QuizResultAnswerEntityTrait::isCorrect()
2 methods override QuizResultAnswerEntityTrait::isCorrect()
- QuizDirectionsResponse::isCorrect in question_types/
quiz_directions/ src/ Plugin/ quiz/ QuizQuestion/ QuizDirectionsResponse.php - QuizPageResponse::isCorrect in question_types/
quiz_page/ src/ Plugin/ quiz/ QuizQuestion/ QuizPageResponse.php
File
- src/
Entity/ QuizResultAnswerEntityTrait.php, line 48
Class
- QuizResultAnswerEntityTrait
- Each question type must store its own response data and be able to calculate a score for that data.
Namespace
Drupal\quiz\EntityCode
public function isCorrect() : bool {
return $this
->getMaxScore() == $this
->getPoints();
}