You are here

function _quiz_get_num_always_questions in Quiz 7

Same name and namespace in other branches
  1. 8.4 quiz.module \_quiz_get_num_always_questions()
  2. 6.4 quiz.module \_quiz_get_num_always_questions()
  3. 7.6 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

File

./quiz.module, line 4099
Quiz Module

Code

function _quiz_get_num_always_questions($vid) {
  return db_query('SELECT COUNT(*) FROM {quiz_node_relationship}
          WHERE parent_vid = :parent_vid AND question_status = :question_status', array(
    ':parent_vid' => $vid,
    ':question_status' => QUESTION_ALWAYS,
  ))
    ->fetchField();
}