function quiz_question_get_report in Quiz 6.6
Same name and namespace in other branches
- 8.4 question_types/quiz_question/quiz_question.module \quiz_question_get_report()
- 6.3 question_types/quiz_question/quiz_question.module \quiz_question_get_report()
- 6.4 question_types/quiz_question/quiz_question.module \quiz_question_get_report()
- 6.5 question_types/quiz_question/quiz_question.module \quiz_question_get_report()
- 7 question_types/quiz_question/quiz_question.module \quiz_question_get_report()
- 7.4 question_types/quiz_question/quiz_question.module \quiz_question_get_report()
Imlementation of hook_get_report().
Return value
Node containing all of the items from the question plus the user's answer.
File
- question_types/
quiz_question/ quiz_question.module, line 397 - Quiz Question module. This module provides the basic facilities for adding quiz question types to a quiz. While you can create standard Quiz question types simply by implementing the appropriate hooks, this module provides a framework that makes…
Code
function quiz_question_get_report($nid, $vid, $rid) {
$node = node_load($nid, $vid);
$result = _quiz_question_response_get_instance($rid, $node)
->getReport();
$node->answers[$result['answer_id']] = $result;
// If this has been evaluated, we mark it as correct.
// FIXME: This needs to be improved substantially.
//if ($result && $result['is_evaluated'] && $result['score'] > 0) {
// $node->correct = TRUE;
//}
$node->correct = $result['is_correct'];
return $node;
}