public function MatchingQuestion::getCorrectAnswer in Quiz 6.4
Same name and namespace in other branches
- 6.6 question_types/matching/matching.classes.inc \MatchingQuestion::getCorrectAnswer()
- 6.3 question_types/matching/matching.classes.inc \MatchingQuestion::getCorrectAnswer()
- 6.5 question_types/matching/matching.classes.inc \MatchingQuestion::getCorrectAnswer()
- 7.6 question_types/matching/matching.classes.inc \MatchingQuestion::getCorrectAnswer()
- 7 question_types/matching/matching.classes.inc \MatchingQuestion::getCorrectAnswer()
- 7.4 question_types/matching/matching.classes.inc \MatchingQuestion::getCorrectAnswer()
- 7.5 question_types/matching/matching.classes.inc \MatchingQuestion::getCorrectAnswer()
Get the correct answers for this question
Return value
Array of correct answers
File
- question_types/
matching/ matching.classes.inc, line 322 - matching.classes
Class
- MatchingQuestion
- Extension of QuizQuestion.
Code
public function getCorrectAnswer() {
$correct_answers = array();
$results = db_query('SELECT match_id, question, answer, feedback
FROM {quiz_matching_node}
WHERE nid = %d AND vid = %d', $this->node->nid, $this->node->vid);
while ($result = db_fetch_object($results)) {
$correct_answers[$result->match_id] = array(
'match_id' => $result->match_id,
'question' => $result->question,
'answer' => $result->answer,
'feedback' => $result->feedback,
);
}
return $correct_answers;
}