public function MatchingQuestion::getCorrectAnswer in Quiz 6.5
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.4 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()
File
- question_types/
matching/ matching.classes.inc, line 187 - quiz_directions.classes
Class
- MatchingQuestion
- Implementation of Matching.
Code
public function getCorrectAnswer() {
$correct_answers = array();
//match_id nid vid question answer feedback # {quiz_matching_node} fields
$results = db_query("SELECT match_id, question, answer 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,
);
}
return $correct_answers;
}