public function MatchingResponse::getUserAnswers in Quiz 6.6
Same name and namespace in other branches
- 6.3 question_types/matching/matching.classes.inc \MatchingResponse::getUserAnswers()
- 6.5 question_types/matching/matching.classes.inc \MatchingResponse::getUserAnswers()
2 calls to MatchingResponse::getUserAnswers()
- MatchingResponse::formatReport in question_types/
matching/ matching.classes.inc - MatchingResponse::score in question_types/
matching/ matching.classes.inc
File
- question_types/
matching/ matching.classes.inc, line 265 - matching.classes
Class
- MatchingResponse
- Class that describes a "Directions question response". For the most part, no real scoring takes place for a direction node. However, there are a few behind-the-scenes tricks that are done here to make the quiz-taking process a little easier.
Code
public function getUserAnswers() {
$user_answers = array();
// answer_id match_id result_id score answer #{quiz_matching_user_answers} fields
$results = db_query("SELECT match_id, answer FROM {quiz_matching_user_answers} WHERE result_id = %d", $this->rid);
while ($result = db_fetch_object($results)) {
$user_answers[$result->match_id] = $result->answer;
}
return $user_answers;
}