You are here

function hook_quiz_feedback_labels_alter in Quiz 8.6

Same name and namespace in other branches
  1. 8.5 quiz.api.php \hook_quiz_feedback_labels_alter()
  2. 7.5 quiz.api.php \hook_quiz_feedback_labels_alter()
  3. 6.x quiz.api.php \hook_quiz_feedback_labels_alter()

Allow modules to alter the feedback labels.

These are the labels that are displayed to the user, so instead of "Answer feedback" you may want to display something more learner-friendly.

Parameters

$feedback_labels: An array keyed by the feedback option. Default keys are the keys from quiz_get_feedback_options().

1 invocation of hook_quiz_feedback_labels_alter()
QuizResultAnswerViewBuilder::alterBuild in src/View/QuizResultAnswerViewBuilder.php
Build the response content with feedback.

File

./quiz.api.php, line 151
quiz.api.php Hooks provided by Quiz module.

Code

function hook_quiz_feedback_labels_alter(&$feedback_labels) {
  $feedback_labels['solution'] = t('The answer you should have chosen.');
}