You are here

function quiz_get_num_questions in Quiz 6.5

Same name and namespace in other branches
  1. 5.2 quiz.module \quiz_get_num_questions()
  2. 5 quiz.module \quiz_get_num_questions()
  3. 6.6 quiz.module \quiz_get_num_questions()
  4. 6.2 quiz.module \quiz_get_num_questions()
  5. 6.3 quiz.module \quiz_get_num_questions()

Gets the number questions of a given type for a quiz.

Parameters

$nid: Node ID of the quiz.

$type: Status constant.

Return value

Number of questions that meet the criteria.

File

./quiz.module, line 1804
Quiz Module

Code

function quiz_get_num_questions($nid, $vid, $type) {
  return db_result(db_query("SELECT COUNT('parent_vid') FROM {quiz_node_relationship} WHERE parent_vid = %d AND parent_nid = %d AND question_status = %d", $vid, $nid, $type));
}