function quiz_get_num_questions in Quiz 5
Same name and namespace in other branches
- 5.2 quiz.module \quiz_get_num_questions()
- 6.6 quiz.module \quiz_get_num_questions()
- 6.2 quiz.module \quiz_get_num_questions()
- 6.3 quiz.module \quiz_get_num_questions()
- 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
2 calls to quiz_get_num_questions()
- quiz_questions_form_submit in ./
quiz.module - Submit function for quiz_questions
- quiz_validate in ./
quiz.module - Implementation of hook_validate().
File
- ./
quiz.module, line 1218 - Quiz Module
Code
function quiz_get_num_questions($nid, $type) {
return db_num_rows(db_query("SELECT question_nid FROM {quiz_questions} WHERE quiz_nid = %d AND question_status = %d", $nid, $type));
}