You are here

public function MatchingResponse::getUserAnswers in Quiz 6.3

Same name and namespace in other branches
  1. 6.6 question_types/matching/matching.classes.inc \MatchingResponse::getUserAnswers()
  2. 6.5 question_types/matching/matching.classes.inc \MatchingResponse::getUserAnswers()
2 calls to MatchingResponse::getUserAnswers()
MatchingResponse::formatReport in question_types/matching/matching.classes.inc
Return an HTML marked-up report for displaying the results of this question.
MatchingResponse::score in question_types/matching/matching.classes.inc
Calculate the score for the response. This MUST set the $score instance variable.

File

question_types/matching/matching.classes.inc, line 259
quiz_directions.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;
}