You are here

function quiz_node_map in Quiz 6.6

Same name and namespace in other branches
  1. 8.4 quiz.module \quiz_node_map()
  2. 5.2 quiz.module \quiz_node_map()
  3. 5 quiz.module \quiz_node_map()
  4. 6.2 quiz.module \quiz_node_map()
  5. 6.3 quiz.module \quiz_node_map()
  6. 6.4 quiz.module \quiz_node_map()
  7. 6.5 quiz.module \quiz_node_map()
  8. 7 quiz.module \quiz_node_map()
  9. 7.4 quiz.module \quiz_node_map()

Map node properties to a question object.

Parameters

$node: Node

Return value

Question object

2 calls to quiz_node_map()
_quiz_get_questions in ./quiz.module
Retrieve list of published questions assigned to quiz.
_quiz_get_unused_questions in ./quiz.module
Retrieve list of published questions not assigned to quiz.

File

./quiz.module, line 1837
Quiz Module

Code

function quiz_node_map($node) {
  $new_question = new stdClass();
  $new_question->question = check_markup($node->body, $node->format, FALSE);
  $new_question->title = check_plain($node->title);
  $new_question->nid = $node->nid;
  $new_question->vid = $node->vid;
  $new_question->type = $node->type;
  $new_question->question_status = isset($node->question_status) ? $node->question_status : QUESTION_NEVER;
  $new_question->weight = $node->weight;
  return $new_question;
}