You are here

public function LongAnswerQuestion::saveNodeProperties in Quiz 7.6

Same name and namespace in other branches
  1. 6.4 question_types/long_answer/long_answer.classes.inc \LongAnswerQuestion::saveNodeProperties()
  2. 7 question_types/long_answer/long_answer.classes.inc \LongAnswerQuestion::saveNodeProperties()
  3. 7.4 question_types/long_answer/long_answer.classes.inc \LongAnswerQuestion::saveNodeProperties()
  4. 7.5 question_types/long_answer/long_answer.classes.inc \LongAnswerQuestion::saveNodeProperties()

Implementation of saveNodeProperties

Overrides QuizQuestion::saveNodeProperties

See also

QuizQuestion#saveNodeProperties($is_new)

File

question_types/long_answer/long_answer.classes.inc, line 19
Long answer classes.

Class

LongAnswerQuestion
Extension of QuizQuestion.

Code

public function saveNodeProperties($is_new = FALSE) {
  if (!isset($this->node->feedback)) {
    $this->node->feedback = '';
  }
  if ($is_new || $this->node->revision == 1) {
    $id = db_insert('quiz_long_answer_node_properties')
      ->fields(array(
      'nid' => $this->node->nid,
      'vid' => $this->node->vid,
      'rubric' => $this->node->rubric,
    ))
      ->execute();
  }
  else {
    db_update('quiz_long_answer_node_properties')
      ->fields(array(
      'rubric' => $this->node->rubric,
    ))
      ->condition('nid', $this->node->nid)
      ->condition('vid', $this->node->vid)
      ->execute();
  }
}