You are here

public function QuizResultAnswerEntityTrait::getFeedbackValues in Quiz 8.5

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

Get the response part of the report form.

Return value

array Array of response data, with each item being an answer to a response. For an example, see MultichoiceResponse::getFeedbackValues(). The sub items are keyed by the feedback type. Providing a NULL option means that feedback will not be shown. See an example at LongAnswerResponse::getFeedbackValues().

5 methods override QuizResultAnswerEntityTrait::getFeedbackValues()
LongAnswerResponse::getFeedbackValues in question_types/quiz_long_answer/src/Plugin/quiz/QuizQuestion/LongAnswerResponse.php
Get the response part of the report form.
MatchingResponse::getFeedbackValues in question_types/quiz_matching/src/Plugin/quiz/QuizQuestion/MatchingResponse.php
Implementation of getFeedbackValues().
MultichoiceResponse::getFeedbackValues in question_types/quiz_multichoice/src/Plugin/quiz/QuizQuestion/MultichoiceResponse.php
Get the response part of the report form.
ShortAnswerResponse::getFeedbackValues in question_types/quiz_short_answer/src/Plugin/quiz/QuizQuestion/ShortAnswerResponse.php
Get the response part of the report form.
TrueFalseResponse::getFeedbackValues in question_types/quiz_truefalse/src/Plugin/quiz/QuizQuestion/TrueFalseResponse.php
Implementation of getFeedbackValues().

File

src/Entity/QuizResultAnswerEntityTrait.php, line 160

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 getFeedbackValues() {
  $data = array();
  $data[] = array(
    'choice' => 'True',
    'attempt' => 'Did the user choose this?',
    'correct' => 'Was their answer correct?',
    'score' => 'Points earned for this answer',
    'answer_feedback' => 'Feedback specific to the answer',
    'question_feedback' => 'General question feedback for any answer',
    'solution' => 'Is this choice the correct solution?',
    'quiz_feedback' => 'Quiz feedback at this time',
  );
  return $data;
}