You are here

function quiz_field_extra_fields in Quiz 7.5

Same name and namespace in other branches
  1. 7.6 quiz.module \quiz_field_extra_fields()
  2. 7.4 quiz.module \quiz_field_extra_fields()

Implements hook_field_extra_fields().

File

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

Code

function quiz_field_extra_fields() {
  $extra = array();
  $extra['node']['quiz'] = array(
    'display' => array(
      'take' => array(
        'label' => t('Take @quiz button', array(
          '@quiz' => QUIZ_NAME,
        )),
        'description' => t('The take button.'),
        'weight' => 10,
      ),
      'stats' => array(
        'label' => t('@quiz summary', array(
          '@quiz' => QUIZ_NAME,
        )),
        'description' => t('@quiz summary', array(
          '@quiz' => QUIZ_NAME,
        )),
        'weight' => 9,
      ),
    ),
    'form' => array(
      'taking' => array(
        'label' => t('Taking options'),
        'description' => t('Fieldset for customizing how a @quiz is taken', array(
          '@quiz' => QUIZ_NAME,
        )),
        'weight' => 0,
      ),
      'quiz_availability' => array(
        'label' => t('Availability options'),
        'description' => t('Fieldset for customizing when a @quiz is available', array(
          '@quiz' => QUIZ_NAME,
        )),
        'weight' => 0,
      ),
      'summaryoptions' => array(
        'label' => t('Summary options'),
        'description' => t('Fieldset for customizing summaries in the @quiz reports', array(
          '@quiz' => QUIZ_NAME,
        )),
        'weight' => 0,
      ),
      'resultoptions' => array(
        'label' => t('Result options'),
        'description' => t('Fieldset for customizing result comments in @quiz reports', array(
          '@quiz' => QUIZ_NAME,
        )),
        'weight' => 0,
      ),
      'remember_settings' => array(
        'label' => t('Remember settings'),
        'description' => t('Checkbox for remembering @quiz settings', array(
          '@quiz' => QUIZ_NAME,
        )),
        'weight' => 0,
      ),
      'remember_global' => array(
        'label' => t('Remember as global'),
        'description' => t('Checkbox for remembering @quiz settings', array(
          '@quiz' => QUIZ_NAME,
        )),
        'weight' => 0,
      ),
    ),
  );
  $extra['quiz_result_answer']['quiz_result_answer']['display']['table'] = array(
    'label' => t('Feedback table'),
    'description' => t('A table of feedback.'),
    'weight' => 0,
  );
  $options = quiz_get_feedback_options();
  foreach ($options as $option => $label) {
    $extra['quiz_result_answer']['quiz_result_answer']['display'][$option] = array(
      'label' => $label,
      'description' => t('Feedback for @label.', array(
        '@label' => $label,
      )),
      'weight' => 0,
    );
  }
  $extra['quiz_result']['quiz_result']['display'] = array(
    'score' => array(
      'label' => t('Score'),
      'description' => t('The score of the result.'),
      'weight' => 1,
    ),
    'questions' => array(
      'label' => t('Questions'),
      'description' => t('The questions in this result.'),
      'weight' => 2,
    ),
    'summary' => array(
      'label' => t('Summary'),
      'description' => t('The summary and pass/fail text.'),
      'weight' => 3,
    ),
  );
  return $extra;
}