You are here

function quiz_get_feedback_options in Quiz 7.5

Same name and namespace in other branches
  1. 8.6 quiz.module \quiz_get_feedback_options()
  2. 8.5 quiz.module \quiz_get_feedback_options()
  3. 7.6 quiz.module \quiz_get_feedback_options()
  4. 6.x quiz.module \quiz_get_feedback_options()

Get the feedback options for Quizzes.

4 calls to quiz_get_feedback_options()
QuizTestCase::drupalCreateQuiz in tests/QuizTestCase.test
quiz_admin_settings in ./quiz.admin.inc
This builds the main settings form for the quiz module.
quiz_field_extra_fields in ./quiz.module
Implements hook_field_extra_fields().
quiz_form in ./quiz.module
Implements hook_form().

File

./quiz.module, line 3806
quiz.module Main file for the Quiz module.

Code

function quiz_get_feedback_options() {
  $feedback_options = module_invoke_all('quiz_feedback_options');
  $entity_info = entity_get_info('node');
  foreach ($entity_info['view modes'] as $view_mode => $info) {
    if ($view_mode == 'full' || $info['custom settings']) {
      $feedback_options["quiz_question_view_" . $view_mode] = t('Question') . ': ' . $info['label'];
    }
  }
  $feedback_options += array(
    'attempt' => t('Attempt'),
    'choice' => t('Choices'),
    'correct' => t('Whether correct'),
    'score' => t('Score'),
    'answer_feedback' => t('Answer feedback'),
    'question_feedback' => t('Question feedback'),
    'solution' => t('Correct answer'),
    'quiz_feedback' => t('@quiz feedback', array(
      '@quiz' => QUIZ_NAME,
    )),
  );
  drupal_alter('quiz_feedback_options', $feedback_options);
  return $feedback_options;
}