You are here

public function QuizResultAnswerEntityTrait::getReportForm in Quiz 6.x

Same name and namespace in other branches
  1. 8.6 src/Entity/QuizResultAnswerEntityTrait.php \Drupal\quiz\Entity\QuizResultAnswerEntityTrait::getReportForm()
  2. 8.5 src/Entity/QuizResultAnswerEntityTrait.php \Drupal\quiz\Entity\QuizResultAnswerEntityTrait::getReportForm()
1 method overrides QuizResultAnswerEntityTrait::getReportForm()
QuizPageResponse::getReportForm in question_types/quiz_page/src/Plugin/quiz/QuizQuestion/QuizPageResponse.php

File

src/Entity/QuizResultAnswerEntityTrait.php, line 109

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 getReportForm() : array {

  // Add general data, and data from the question type implementation.
  $form = [];
  $form['display_number'] = [
    '#type' => 'value',
    '#value' => $this->display_number,
  ];
  $form['score'] = $this
    ->getReportFormScore();
  $form['answer_feedback'] = $this
    ->getReportFormAnswerFeedback();
  return $form;
}