You are here

public function LongAnswerQuestion::delete in Quiz 7.6

Same name and namespace in other branches
  1. 6.6 question_types/long_answer/long_answer.classes.inc \LongAnswerQuestion::delete()
  2. 6.3 question_types/long_answer/long_answer.classes.inc \LongAnswerQuestion::delete()
  3. 6.4 question_types/long_answer/long_answer.classes.inc \LongAnswerQuestion::delete()
  4. 6.5 question_types/long_answer/long_answer.classes.inc \LongAnswerQuestion::delete()
  5. 7 question_types/long_answer/long_answer.classes.inc \LongAnswerQuestion::delete()
  6. 7.4 question_types/long_answer/long_answer.classes.inc \LongAnswerQuestion::delete()
  7. 7.5 question_types/long_answer/long_answer.classes.inc \LongAnswerQuestion::delete()

Implementation of delete

Overrides QuizQuestion::delete

See also

QuizQuestion#delete($only_this_version)

File

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

Class

LongAnswerQuestion
Extension of QuizQuestion.

Code

public function delete($only_this_version = FALSE) {
  if ($only_this_version) {
    db_delete('quiz_long_answer_user_answers')
      ->condition('question_nid', $this->node->nid)
      ->condition('question_vid', $this->node->vid)
      ->execute();
    db_delete('quiz_long_answer_node_properties')
      ->condition('nid', $this->node->nid)
      ->condition('vid', $this->node->vid)
      ->execute();
  }
  else {
    db_delete('quiz_long_answer_node_properties')
      ->condition('nid', $this->node->nid)
      ->execute();
    db_delete('quiz_long_answer_user_answers')
      ->condition('question_nid', $this->node->nid)
      ->execute();
  }
  parent::delete($only_this_version);
}