public function MatchingQuestion::getNodeProperties in Quiz 6.4
Same name and namespace in other branches
- 7.6 question_types/matching/matching.classes.inc \MatchingQuestion::getNodeProperties()
- 7 question_types/matching/matching.classes.inc \MatchingQuestion::getNodeProperties()
- 7.4 question_types/matching/matching.classes.inc \MatchingQuestion::getNodeProperties()
- 7.5 question_types/matching/matching.classes.inc \MatchingQuestion::getNodeProperties()
Implementation of getNodeProperties
Overrides QuizQuestion::getNodeProperties
See also
QuizQuestion#getNodeProperties()
File
- question_types/matching/ matching.classes.inc, line 108 
- matching.classes
Class
- MatchingQuestion
- Extension of QuizQuestion.
Code
public function getNodeProperties() {
  if (isset($this->nodeProperties)) {
    return $this->nodeProperties;
  }
  $props = parent::getNodeProperties();
  $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)) {
    $props['match'][] = array(
      'match_id' => $result->match_id,
      'question' => $result->question,
      'answer' => $result->answer,
      'feedback' => $result->feedback,
    );
  }
  $this->nodeProperties = $props;
  return $props;
}