You are here

function quiz_get_num_questions in Quiz 5.2

Same name and namespace in other branches
  1. 5 quiz.module \quiz_get_num_questions()
  2. 6.6 quiz.module \quiz_get_num_questions()
  3. 6.2 quiz.module \quiz_get_num_questions()
  4. 6.3 quiz.module \quiz_get_num_questions()
  5. 6.5 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 1771

Code

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