You are here

public function ClozeQuestion::delete in Quiz 8.4

Implementation of delete()

Overrides QuizQuestion::delete

See also

QuizQuestion#delete($only_this_version)

File

question_types/cloze/lib/Drupal/cloze/ClozeQuestion.php, line 84
The main classes for the multichoice question type.

Class

ClozeQuestion
Extension of QuizQuestion.

Namespace

Drupal\cloze

Code

public function delete($only_this_version = FALSE) {
  parent::delete($only_this_version);
  $delete_ans = db_delete('quiz_cloze_user_answers');
  $delete_ans
    ->condition('question_nid', $this->node
    ->id());
  if ($only_this_version) {
    $delete_ans
      ->condition('question_vid', $this->node
      ->getRevisionId());
  }
  $delete_ans
    ->execute();
}