You are here

public function QuizResultAnswerEntityTrait::getQuizQuestion in Quiz 8.5

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

Get the question of this question response.

Return value

QuizQuestion

2 calls to QuizResultAnswerEntityTrait::getQuizQuestion()
ShortAnswerResponse::score in question_types/quiz_short_answer/src/Plugin/quiz/QuizQuestion/ShortAnswerResponse.php
Calculate the unscaled score in points for this question response.
TrueFalseResponse::score in question_types/quiz_truefalse/src/Plugin/quiz/QuizQuestion/TrueFalseResponse.php
Calculate the unscaled score in points for this question response.

File

src/Entity/QuizResultAnswerEntityTrait.php, line 26

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 getQuizQuestion() {
  return Drupal::entityTypeManager()
    ->getStorage('quiz_question')
    ->loadRevision($this
    ->get('question_vid')
    ->getString());
}