You are here

function quiz_question_get_info in Quiz 7.5

Same name and namespace in other branches
  1. 7.6 question_types/quiz_question/quiz_question.module \quiz_question_get_info()

Get the information about various implementations of quiz questions.

Parameters

string|null $name: The question type, e.g. truefalse, for which the info shall be returned, or NULL to return an array with info about all types.

bool $reset: If this is true, the cache will be reset.

Return value

array An array of information about quiz question implementations.

See also

quiz_question_quiz_question_info() for an example of a quiz question info hook.

14 calls to quiz_question_get_info()
QuizQuestionTestCase::testQuizQuestionImplementation in question_types/quiz_question/QuizQuestionTestCase.test
Test the subclass's quiz question implementation.
quiz_get_question_types in ./quiz.module
Retrieve list of question types.
quiz_question_config in question_types/quiz_question/quiz_question.module
Get the configuration form for all enabled question types.
quiz_question_field_extra_fields in question_types/quiz_question/quiz_question.module
Implements hook_field_extra_fields().
quiz_question_node_access_records in question_types/quiz_question/quiz_question.module
Implements hook_node_access_records().

... See full list

File

question_types/quiz_question/quiz_question.module, line 661
Quiz Question module.

Code

function quiz_question_get_info($name = NULL, $reset = FALSE) {
  $info =& drupal_static(__FUNCTION__, array());
  if (empty($info) || $reset) {
    $qtypes = module_invoke_all('quiz_question_info');
    foreach ($qtypes as $type => $definition) {

      // We only want the ones with classes.
      if (!empty($definition['question provider'])) {

        // Cache the info.
        $info[$type] = $definition;
      }
    }
    drupal_alter('quiz_question_info', $info);
  }
  return NULL === $name ? $info : $info[$info];
}