You are here

function truefalse_field_extra_fields in Quiz 8.4

Same name and namespace in other branches
  1. 7.6 question_types/truefalse/truefalse.module \truefalse_field_extra_fields()
  2. 7.4 question_types/truefalse/truefalse.module \truefalse_field_extra_fields()
  3. 7.5 question_types/truefalse/truefalse.module \truefalse_field_extra_fields()

Implements hook_field_extra_fields().

File

question_types/truefalse/truefalse.module, line 80
TrueFalse question type for quiz module

Code

function truefalse_field_extra_fields() {
  $extra = array();
  foreach (node_type_get_types() as $bundle_name => $bundle) {
    if ($bundle_name == 'truefalse') {
      $extra['node'][$bundle->type]['form']['correct_answer'] = array(
        'label' => t('Correct answer'),
        'description' => t('The answer for this question.'),
        'weight' => -4,
      );
      $extra['node'][$bundle->type]['form']['feedback_fields'] = array(
        'label' => t('Feedback Settings'),
        'description' => t('Settings pertaining to feedback given along with results.'),
        'weight' => -4,
      );
    }
  }
  return $extra;
}