function quiz_has_been_answered in Quiz 6.4
Same name and namespace in other branches
- 8.4 quiz.module \quiz_has_been_answered()
- 7.6 quiz.module \quiz_has_been_answered()
- 7 quiz.module \quiz_has_been_answered()
- 7.4 quiz.module \quiz_has_been_answered()
- 7.5 quiz.module \quiz_has_been_answered()
Finds out if a quiz has been answered or not.
Return value
TRUE if there exists answers to the current question.
7 calls to quiz_has_been_answered()
- QuizQuestion::saveRelationships in question_types/
quiz_question/ quiz_question.core.inc - Handle the add to quiz part of the quiz_question_form
- quiz_categorized_form_submit in ./
quiz.admin.inc - Submit the categorized form
- quiz_form in ./
quiz.module - Implementation of hook_form().
- quiz_nodeapi in ./
quiz.module - Implementation of hook_nodeapi()
- quiz_questions_form_submit in ./
quiz.admin.inc - Submit function for quiz_questions.
File
- ./
quiz.module, line 3731 - Quiz Module
Code
function quiz_has_been_answered($node) {
if (!isset($node->nid)) {
return FALSE;
}
$sql = 'SELECT *
FROM {quiz_node_results}
WHERE nid = %d AND vid = %d
LIMIT 1';
$res = db_query($sql, $node->nid, $node->vid);
return db_fetch_object($res) ? TRUE : FALSE;
}