You are here

function _questions_in_quiz in Quiz 6.6

Same name and namespace in other branches
  1. 6.5 includes/questions_export/questions_export.admin.inc \_questions_in_quiz()
2 calls to _questions_in_quiz()
_questions_export_moodle in includes/questions_export/questions_export.admin.inc
Exports questions using the Moodle export engine.
_questions_export_native in includes/questions_export/questions_export.admin.inc
Exports questions using Quiz module's native export engine.

File

includes/questions_export/questions_export.admin.inc, line 167

Code

function _questions_in_quiz($collection_node) {
  $questions = array();

  // Get all the questions (ignore `question_status`)
  $sql = "SELECT child_nid as question_nid, child_vid as question_vid\n    FROM {quiz_node_relationship}\n    WHERE parent_nid = %d\n      AND parent_vid = %d\n    ORDER BY weight";
  $result = db_query($sql, $collection_node->nid, $collection_node->vid);
  while ($row = db_fetch_array($result)) {
    $question_nodes[] = node_load($row['question_nid'], $row['question_vid']);
  }
  return $question_nodes;
}