function _quiz_get_question_types in Quiz 7.4
Same name and namespace in other branches
- 8.4 quiz.module \_quiz_get_question_types()
- 5.2 quiz.module \_quiz_get_question_types()
- 5 quiz.module \_quiz_get_question_types()
- 6.6 quiz.module \_quiz_get_question_types()
- 6.2 quiz.module \_quiz_get_question_types()
- 6.3 quiz.module \_quiz_get_question_types()
- 6.4 quiz.module \_quiz_get_question_types()
- 6.5 quiz.module \_quiz_get_question_types()
- 7 quiz.module \_quiz_get_question_types()
Retrieve list of question types.
Return value
Array of question types.
9 calls to _quiz_get_question_types()
- quiz_get_questions in ./
quiz.module - Retrieve list of published questions assigned to quiz.
- quiz_questions_form in ./
quiz.admin.inc - Handles "manage questions" tab.
- quiz_questions_form_validate in ./
quiz.admin.inc - Validate that the supplied questions are real.
- quiz_question_module_for_type in ./
quiz.module - quiz_take_quiz in ./
quiz.module - Handles quiz taking.
File
- ./
quiz.module, line 3665 - Quiz Module
Code
function _quiz_get_question_types() {
static $to_return = array();
// We vastly improves performance by statically caching the question types.
if (!empty($to_return)) {
return $to_return;
}
// Get question types from the modules that defines them..
$quiz_questions = module_invoke_all('quiz_question_info');
if (empty($quiz_questions)) {
drupal_set_message(t('You need to install and enable at least one question type(multichoice for instance) to use quiz.'), 'warning', FALSE);
return array();
}
else {
drupal_alter('quiz_question_info', $quiz_questions);
}
return $quiz_questions;
}