function quiz_get_number_of_questions in Quiz 5
Same name and namespace in other branches
- 8.4 quiz.module \quiz_get_number_of_questions()
- 5.2 quiz.module \quiz_get_number_of_questions()
- 6.6 quiz.module \quiz_get_number_of_questions()
- 6.2 quiz.module \quiz_get_number_of_questions()
- 6.3 quiz.module \quiz_get_number_of_questions()
- 6.4 quiz.module \quiz_get_number_of_questions()
- 6.5 quiz.module \quiz_get_number_of_questions()
- 7.6 quiz.module \quiz_get_number_of_questions()
- 7 quiz.module \quiz_get_number_of_questions()
- 7.4 quiz.module \quiz_get_number_of_questions()
- 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;
}