You are here

function quiz_get_number_of_questions in Quiz 5

Same name and namespace in other branches
  1. 8.4 quiz.module \quiz_get_number_of_questions()
  2. 5.2 quiz.module \quiz_get_number_of_questions()
  3. 6.6 quiz.module \quiz_get_number_of_questions()
  4. 6.2 quiz.module \quiz_get_number_of_questions()
  5. 6.3 quiz.module \quiz_get_number_of_questions()
  6. 6.4 quiz.module \quiz_get_number_of_questions()
  7. 6.5 quiz.module \quiz_get_number_of_questions()
  8. 7.6 quiz.module \quiz_get_number_of_questions()
  9. 7 quiz.module \quiz_get_number_of_questions()
  10. 7.4 quiz.module \quiz_get_number_of_questions()
  11. 7.5 quiz.module \quiz_get_number_of_questions()

Parameters

$nid: Quiz ID Finds out the number of questions for the quiz. Good example of usage could be to calculate the % of score

Return value

integer Returns the number of quiz questions.

1 call to quiz_get_number_of_questions()
theme_quiz_take_question in ./quiz.module
Theme a question page

File

./quiz.module, line 332
Quiz Module

Code

function quiz_get_number_of_questions($nid) {
  $result = db_fetch_object(db_query('SELECT number_of_questions FROM {quiz} WHERE nid = %d', $nid));
  $number_of_questions = $result->number_of_questions;
  return $number_of_questions;
}