public function ShortAnswerQuestion::getNodeProperties in Quiz 7.5
Same name and namespace in other branches
- 6.4 question_types/short_answer/short_answer.classes.inc \ShortAnswerQuestion::getNodeProperties()
- 7.6 question_types/short_answer/short_answer.classes.inc \ShortAnswerQuestion::getNodeProperties()
- 7 question_types/short_answer/short_answer.classes.inc \ShortAnswerQuestion::getNodeProperties()
- 7.4 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 - Short answer classes.
Class
- ShortAnswerQuestion
- Extension of QuizQuestion.
Code
public function getNodeProperties() {
if (isset($this->nodeProperties)) {
return $this->nodeProperties;
}
$props = parent::getNodeProperties();
$res_a = db_query('SELECT correct_answer, correct_answer_evaluation FROM {quiz_short_answer_node_properties}
WHERE nid = :nid AND vid = :vid', array(
':nid' => $this->node->nid,
':vid' => $this->node->vid,
))
->fetchAssoc();
$this->nodeProperties = is_array($res_a) ? array_merge($props, $res_a) : $props;
return $this->nodeProperties;
}