You are here

function quiz_question_type_access_load in Quiz 6.6

Load a quiz question node and validate it.

Parameters

$arg: The Node ID

Return value

A quiz question node object or FALSE if a load failed.

File

question_types/quiz_question/quiz_question.module, line 563
Quiz Question module. This module provides the basic facilities for adding quiz question types to a quiz. While you can create standard Quiz question types simply by implementing the appropriate hooks, this module provides a framework that makes…

Code

function quiz_question_type_access_load($arg) {
  $node = node_load($arg);
  if (!$node) {
    return FALSE;
  }
  $qtypes = module_invoke_all('quiz_question_info');
  $qtypes_key = array_keys($qtypes);
  if (!in_array($node->type, $qtypes_key)) {
    return FALSE;
  }
  return $node;
}