You are here

function quiz_admin_settings in Quiz 6.2

Same name and namespace in other branches
  1. 5.2 quiz.module \quiz_admin_settings()
  2. 5 quiz.module \quiz_admin_settings()
  3. 6.6 quiz.admin.inc \quiz_admin_settings()
  4. 6.3 quiz.admin.inc \quiz_admin_settings()
  5. 6.4 quiz.admin.inc \quiz_admin_settings()
  6. 6.5 quiz.admin.inc \quiz_admin_settings()
  7. 7.6 quiz.admin.inc \quiz_admin_settings()
  8. 7 quiz.admin.inc \quiz_admin_settings()
  9. 7.4 quiz.admin.inc \quiz_admin_settings()
  10. 7.5 quiz.admin.inc \quiz_admin_settings()

Implementation of hook_settings().

This builds the main settings form for the quiz module.

1 string reference to 'quiz_admin_settings'
quiz_menu in ./quiz.module
Implementation of hook_menu().

File

./quiz.admin.inc, line 256
Administrator interface for Quiz module.

Code

function quiz_admin_settings() {
  $form = array();
  $form['quiz_default_close'] = array(
    '#type' => 'textfield',
    '#title' => t('Default number of days before a @quiz is closed', array(
      '@quiz' => QUIZ_NAME,
    )),
    '#default_value' => variable_get('quiz_default_close', 30),
    '#description' => t('Supply a number of days to calculate the default close date for new quizzes.'),
  );
  $form['quiz_default_pass_rate'] = array(
    '#type' => 'textfield',
    '#title' => t('Default percentage needed to pass a @quiz', array(
      '@quiz' => QUIZ_NAME,
    )),
    '#default_value' => variable_get('quiz_default_pass_rate', 75),
    '#description' => t('Supply a number between 1 and 100 to set as the default percentage correct needed to pass a quiz. Set to 0 if you want to ignore pass/fail summary information by default.'),
  );
  $form['quiz_use_passfail'] = array(
    '#type' => 'checkbox',
    '#title' => t('Allow quiz creators to set a pass/fail option when creating a @quiz.', array(
      '@quiz' => strtolower(QUIZ_NAME),
    )),
    '#default_value' => variable_get('quiz_use_passfail', 1),
    '#description' => t('Check this to display the pass/fail options in the @quiz form. If you want to prohibit other quiz creators from changing the default pass/fail percentage set below, uncheck this option.', array(
      '@quiz' => QUIZ_NAME,
    )),
  );
  $form['quiz_look_feel'] = array(
    '#type' => 'fieldset',
    '#title' => t('Look and Feel Settings'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#description' => t('Control aspects of the Quiz module\'s display'),
  );
  $form['quiz_look_feel']['quiz_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Display name'),
    '#default_value' => QUIZ_NAME,
    '#description' => t('Change the name of the quiz type. Do you call it <em>test</em> or <em>assessment</em> instead? Change the display name of the module to something else. Currently, it is called @quiz. By default, it is called <em>Quiz</em>.', array(
      '@quiz' => QUIZ_NAME,
    )),
    '#required' => TRUE,
  );
  $form['quiz_look_feel']['quiz_show_allowed_times'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show allowed times'),
    '#description' => t('When a user begins a new quiz, show the user the number of times they may take the test, and how many times they have already taken the test.'),
    '#default_value' => variable_get('quiz_show_allowed_times', TRUE),
  );
  return system_settings_form($form);
}