You are here

function quiz_type_access_load in Quiz 6.4

Same name and namespace in other branches
  1. 8.4 quiz.module \quiz_type_access_load()
  2. 6.6 quiz.module \quiz_type_access_load()
  3. 6.2 quiz.module \quiz_type_access_load()
  4. 6.3 quiz.module \quiz_type_access_load()
  5. 6.5 quiz.module \quiz_type_access_load()
  6. 7 quiz.module \quiz_type_access_load()
  7. 7.4 quiz.module \quiz_type_access_load()

Load a quiz node, cache it and validate that it is indeed of type quiz.

Parameters

$arg: The Node ID.

Return value

A quiz node object or FALSE if a load failed.

Related topics

1 call to quiz_type_access_load()
quiz_question_answering_form in question_types/quiz_question/quiz_question.module
Get the form to show to the quiz taker.

File

./quiz.module, line 1455
Quiz Module

Code

function quiz_type_access_load($arg) {
  static $quiz_nodes = array();
  if (isset($quiz_nodes[$arg])) {
    return $quiz_nodes[$arg];
  }
  $to_return = ($node = node_load($arg)) && $node->type == 'quiz' ? $node : FALSE;
  if ($to_return) {
    $quiz_nodes[$arg] = $to_return;
  }
  return $to_return;
}