You are here

public function QuizQuestion::getNodeProperties in OG Quiz 7

Getter function returning properties to be loaded when the node is loaded.

Return value

array

See also

load hook in quiz_question.module (quiz_question_load)

1 call to QuizQuestion::getNodeProperties()
LongAnswerQuestion::getNodeProperties in includes/og_long_answer.php
Implementation of getNodeProperties
1 method overrides QuizQuestion::getNodeProperties()
LongAnswerQuestion::getNodeProperties in includes/og_long_answer.php
Implementation of getNodeProperties

File

includes/og_quiz_question.php, line 394
Classes used in the Quiz Question module.

Class

QuizQuestion
A base implementation of a quiz_question, adding a layer of abstraction between the node API, quiz API and the question types.

Code

public function getNodeProperties() {
  if (isset($this->nodeProperties)) {
    return $this->nodeProperties;
  }
  $props['max_score'] = db_query('SELECT max_score
            FROM {quiz_question_properties}
            WHERE nid = :nid AND vid = :vid', array(
    ':nid' => $this->node->nid,
    ':vid' => $this->node->vid,
  ))
    ->fetchField();
  $props['is_quiz_question'] = TRUE;
  $this->nodeProperties = $props;
  return $props;
}