You are here

public function MatchingQuestion::load in Quiz 6.6

Same name and namespace in other branches
  1. 6.3 question_types/matching/matching.classes.inc \MatchingQuestion::load()
  2. 6.5 question_types/matching/matching.classes.inc \MatchingQuestion::load()

Retrieve information about the question and add it to the node.

Overrides QuizQuestion::load

File

question_types/matching/matching.classes.inc, line 65
matching.classes

Class

MatchingQuestion
Implementation of Matching.

Code

public function load() {
  $rows = $result = array();
  $sql = "SELECT match_id, question, answer, feedback FROM {quiz_matching_node} WHERE nid = %d AND vid = %d";
  $results = db_query($sql, $this->node->nid, $this->node->vid);
  while ($result = db_fetch_object($results)) {
    $rows['answer'][] = array(
      'match_id' => $result->match_id,
      'question' => $result->question,
      'answer' => $result->answer,
      'feedback' => $result->feedback,
    );
  }
  return $rows;
}