You are here

function _qcollection_get_info in Quiz 6.6

1 call to _qcollection_get_info()
qcollection_view in includes/qcollection/qcollection.module
Implemention of hook_view().

File

includes/qcollection/qcollection.module, line 147
The main file for qcollection.

Code

function _qcollection_get_info($node) {
  $quiz_vid = db_result(db_query("SELECT vid FROM {node} WHERE nid = %d", $quiz_nid));

  // Get count of child questions (ignoring question_status)
  $sql = 'SELECT COUNT(child_nid)
    FROM {quiz_node_relationship}
    WHERE parent_vid = %d
      AND parent_nid = %d';
  $questions_count = db_result(db_query($sql, $node->vid, $node->nid));
  return compact('questions_count');
}