You are here

public function ShortAnswerQuestion::getNodeProperties in Quiz 6.4

Same name and namespace in other branches
  1. 7.6 question_types/short_answer/short_answer.classes.inc \ShortAnswerQuestion::getNodeProperties()
  2. 7 question_types/short_answer/short_answer.classes.inc \ShortAnswerQuestion::getNodeProperties()
  3. 7.4 question_types/short_answer/short_answer.classes.inc \ShortAnswerQuestion::getNodeProperties()
  4. 7.5 question_types/short_answer/short_answer.classes.inc \ShortAnswerQuestion::getNodeProperties()

Implementation of getNodeProperties

Overrides QuizQuestion::getNodeProperties

See also

QuizQuestion#getNodeProperties()

File

question_types/short_answer/short_answer.classes.inc, line 83
The main classes for the short answer question type.

Class

ShortAnswerQuestion
Extension of QuizQuestion.

Code

public function getNodeProperties() {
  if (isset($this->nodeProperties)) {
    return $this->nodeProperties;
  }
  $props = parent::getNodeProperties();
  $sql = 'SELECT correct_answer, correct_answer_evaluation
      FROM {quiz_short_answer_node_properties}
      WHERE nid = %d AND vid = %d';
  $res = db_query($sql, $this->node->nid, $this->node->vid);
  $res_a = db_fetch_array($res);
  if (is_array($res_a)) {
    $props = array_merge($props, $res_a);
  }
  $this->nodeProperties = $props;
  return $props;
}