public function ScaleQuestion::getNodeProperties in Quiz 8.4
Implementation of getNodeProperties
Overrides QuizQuestion::getNodeProperties
See also
QuizQuestion#getNodeProperties()
File
- question_types/
scale/ lib/ Drupal/ scale/ ScaleQuestion.php, line 323 - The main classes for the short answer question type.
Class
- ScaleQuestion
- Extension of QuizQuestion.
Namespace
Drupal\scaleCode
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
->id(),
':vid' => $this->node
->getRevisionId(),
));
foreach ($res as $res_o) {
$props[] = $res_o;
}
$this->nodeProperties = $props;
return $props;
}