You are here

function quiz_install in Quiz 7

Same name and namespace in other branches
  1. 8.6 quiz.install \quiz_install()
  2. 8.4 quiz.install \quiz_install()
  3. 8.5 quiz.install \quiz_install()
  4. 5.2 quiz.install \quiz_install()
  5. 5 quiz.install \quiz_install()
  6. 6.6 quiz.install \quiz_install()
  7. 6.2 quiz.install \quiz_install()
  8. 6.3 quiz.install \quiz_install()
  9. 6.4 quiz.install \quiz_install()
  10. 6.5 quiz.install \quiz_install()
  11. 7.6 quiz.install \quiz_install()
  12. 7.4 quiz.install \quiz_install()
  13. 7.5 quiz.install \quiz_install()
  14. 6.x quiz.install \quiz_install()

Implements hook_install().

File

./quiz.install, line 12
Quiz install schema for installing the quiz module

Code

function quiz_install() {
  node_types_rebuild();
  $types = node_type_get_types();
  node_add_body_field($types['quiz']);

  // Default the "Show Author and Date" for quiz nodes to OFF.
  $temp_array = variable_get('theme_settings', array());
  $temp_array['toggle_node_info_quiz'] = 0;
  variable_set('theme_settings', $temp_array);

  // Default the comment settings to disabled.
  variable_set('comment_quiz', '0');

  // Create the quiz_def_uid variable holding an artificial uid to use when storing default settings.
  variable_set('quiz_def_uid', 1);
  drupal_set_message(t('Quiz module has been enabled. To !create_a_quiz go to Create Content -> Quiz.', array(
    '!create_a_quiz' => l(t('create a quiz'), 'node/add/quiz'),
  )));
}