You are here

public function ScaleQuestion::getNodeProperties in Quiz 7

Same name and namespace in other branches
  1. 8.6 question_types/quiz_scale/src/Plugin/quiz/QuizQuestion/ScaleQuestion.php \ScaleQuestion::getNodeProperties()
  2. 8.5 question_types/quiz_scale/src/Plugin/quiz/QuizQuestion/ScaleQuestion.php \ScaleQuestion::getNodeProperties()
  3. 6.4 question_types/scale/scale.classes.inc \ScaleQuestion::getNodeProperties()
  4. 7.6 question_types/scale/scale.classes.inc \ScaleQuestion::getNodeProperties()
  5. 7.4 question_types/scale/scale.classes.inc \ScaleQuestion::getNodeProperties()
  6. 7.5 question_types/scale/scale.classes.inc \ScaleQuestion::getNodeProperties()

Implementation of getNodeProperties

Overrides QuizQuestion::getNodeProperties

See also

QuizQuestion#getNodeProperties()

File

question_types/scale/scale.classes.inc, line 307
The main classes for the scale question type.

Class

ScaleQuestion
Extension of QuizQuestion.

Code

public function getNodeProperties() {
  if (isset($this->nodeProperties)) {
    return $this->nodeProperties;
  }
  $props = parent::getNodeProperties();
  $res = db_query('SELECT id, answer, a.answer_collection_id
            FROM {quiz_scale_node_properties} p
            JOIN {quiz_scale_answer} a ON (p.answer_collection_id = a.answer_collection_id)
            WHERE nid = :nid AND vid = :vid
            ORDER BY a.id', array(
    ':nid' => $this->node->nid,
    ':vid' => $this->node->vid,
  ));
  foreach ($res as $res_o) {
    $props[] = $res_o;
  }
  $this->nodeProperties = $props;
  return $props;
}