You are here

public function ClozeQuestion::saveNodeProperties in Cloze 7

Same name and namespace in other branches
  1. 6 cloze.classes.inc \ClozeQuestion::saveNodeProperties()

Implementation of saveNodeProperties

See also

QuizQuestion#saveNodeProperties($is_new)

File

./cloze.classes.inc, line 23
The main classes for the cloze question type. These inherit or implement code found in quiz_question.classes.inc.

Class

ClozeQuestion
Extension of QuizQuestion.

Code

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