You are here

public function ScaleQuestion::delete in Quiz 8.5

Same name and namespace in other branches
  1. 8.6 question_types/quiz_scale/src/Plugin/quiz/QuizQuestion/ScaleQuestion.php \ScaleQuestion::delete()
  2. 6.6 question_types/scale/scale.classes.inc \ScaleQuestion::delete()
  3. 6.4 question_types/scale/scale.classes.inc \ScaleQuestion::delete()
  4. 7.6 question_types/scale/scale.classes.inc \ScaleQuestion::delete()
  5. 7 question_types/scale/scale.classes.inc \ScaleQuestion::delete()
  6. 7.4 question_types/scale/scale.classes.inc \ScaleQuestion::delete()
  7. 7.5 question_types/scale/scale.classes.inc \ScaleQuestion::delete()

Implementation of delete().

See also

QuizQuestion::delete()

File

question_types/quiz_scale/src/Plugin/quiz/QuizQuestion/ScaleQuestion.php, line 295
Scale classes.

Class

ScaleQuestion
Extension of QuizQuestion.

Code

public function delete($only_this_version = FALSE) {
  parent::delete($only_this_version);
  if ($only_this_version) {
    db_delete('quiz_scale_node_properties')
      ->condition('nid', $this->node->nid)
      ->condition('vid', $this->node->vid)
      ->execute();
  }
  else {
    db_delete('quiz_scale_node_properties')
      ->condition('nid', $this->node->nid)
      ->execute();
  }
  $this
    ->deleteCollectionIfNotUsed($this->node->scale[0]->answer_collection_id, 0);
}