You are here

function _quiz_get_num_always_questions in Quiz 6.4

Same name and namespace in other branches
  1. 8.4 quiz.module \_quiz_get_num_always_questions()
  2. 7.6 quiz.module \_quiz_get_num_always_questions()
  3. 7 quiz.module \_quiz_get_num_always_questions()
  4. 7.4 quiz.module \_quiz_get_num_always_questions()
  5. 7.5 quiz.module \_quiz_get_num_always_questions()

Get the number of compulsory questions for a quiz.

Parameters

$nid: Quiz node id.

$vid: Quiz node version id.

Return value

Number of compulsory questions.

3 calls to _quiz_get_num_always_questions()
quiz_get_number_of_questions in ./quiz.module
Finds out the number of questions for the quiz.
quiz_get_score_array in ./quiz.pages.inc
Returns an array of score information for a quiz
quiz_view in ./quiz.module
Implementation of hook_view().

File

./quiz.module, line 3980
Quiz Module

Code

function _quiz_get_num_always_questions($vid) {
  $sql = 'SELECT count(*)
          FROM {quiz_node_relationship} qnr
          JOIN {node} n ON n.nid = qnr.child_nid
          WHERE n.status = 1 AND qnr.parent_vid = %d AND qnr.question_status = %d';
  return db_result(db_query($sql, $vid, QUESTION_ALWAYS));
}