You are here

function quiz_menu in Quiz 6.2

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

Implementation of hook_menu().

File

./quiz.module, line 129
Quiz Module

Code

function quiz_menu() {

  // ADMIN //
  $items['admin/settings/quiz'] = array(
    'title' => t('@quiz configuration', array(
      '@quiz' => QUIZ_NAME,
    )),
    'description' => t('Configure @quiz options.', array(
      '@quiz' => QUIZ_NAME,
    )),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'quiz_admin_settings',
    ),
    'access arguments' => array(
      QUIZ_PERM_ADMIN_CONFIG,
    ),
    'type' => MENU_NORMAL_ITEM,
    // optional
    'file' => 'quiz.admin.inc',
  );
  $items['admin/quiz/results'] = array(
    'title' => t('@quiz results', array(
      '@quiz' => QUIZ_NAME,
    )),
    'page callback' => 'quiz_admin',
    'access arguments' => array(
      'administer quiz',
    ),
    'type' => MENU_NORMAL_ITEM,
    'file' => 'quiz.admin.inc',
  );
  $items['admin/quiz/%/view'] = array(
    'title' => t('View @quiz', array(
      '@quiz' => QUIZ_NAME,
    )),
    'page callback' => 'quiz_admin_results',
    'page arguments' => array(
      2,
    ),
    'access arguments' => array(
      'administer quiz',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'quiz.admin.inc',
  );
  $items['admin/quiz/%/delete'] = array(
    'title' => t('Delete @quiz', array(
      '@quiz' => QUIZ_NAME,
    )),
    'page callback' => 'quiz_admin_result_delete',
    //'page arguments' => array(2),
    'access arguments' => array(
      'administer quiz',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'quiz.admin.inc',
  );

  // Menu item for adding questions to quiz.
  $items['node/%quiz_type_access/questions'] = array(
    'title' => t('Manage questions'),
    'page callback' => 'quiz_questions',
    'page arguments' => array(
      1,
    ),
    'access arguments' => array(
      'create quiz',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'quiz.admin.inc',
  );
  $items['node/%quiz_type_access/admin'] = array(
    'title' => t('Quiz admin', array(
      '@quiz' => QUIZ_NAME,
    )),
    'page callback' => 'theme',
    'page arguments' => array(
      'quiz_view',
      1,
    ),
    'access arguments' => array(
      'administer quiz',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'quiz.admin.inc',
  );

  // USER //
  $items['user/%/myresults'] = array(
    'title' => t('My results'),
    'page callback' => 'quiz_get_user_results',
    'page arguments' => array(
      1,
    ),
    'access arguments' => array(
      'own results',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'quiz.pages.inc',
  );
  $items['user/quiz/%/userresults'] = array(
    'title' => t('User results'),
    'page callback' => 'quiz_user_results',
    'page arguments' => array(
      2,
    ),
    'access arguments' => array(
      'own results',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'quiz.pages.inc',
  );
  return $items;
}