public function TrueFalseQuestion::delete in Quiz 7.4
Same name and namespace in other branches
- 6.6 question_types/truefalse/truefalse.classes.inc \TrueFalseQuestion::delete()
- 6.3 question_types/quiz_question/quiz_question.truefalse.inc \TrueFalseQuestion::delete()
- 6.4 question_types/truefalse/truefalse.classes.inc \TrueFalseQuestion::delete()
- 6.5 question_types/quiz_question/quiz_question.truefalse.inc \TrueFalseQuestion::delete()
- 7.6 question_types/truefalse/truefalse.classes.inc \TrueFalseQuestion::delete()
- 7 question_types/truefalse/truefalse.classes.inc \TrueFalseQuestion::delete()
- 7.5 question_types/truefalse/truefalse.classes.inc \TrueFalseQuestion::delete()
Implementation of delete
Overrides QuizQuestion::delete
See also
QuizQuestion#delete($only_this_version)
File
- question_types/
truefalse/ truefalse.classes.inc, line 60 - Defines the classes necessary for a True/False quiz.
Class
- TrueFalseQuestion
- Extension of QuizQuestion.
Code
public function delete($only_this_version = FALSE) {
parent::delete($only_this_version);
$delete_ans = db_delete('quiz_truefalse_user_answers');
$delete_ans
->condition('question_nid', $this->node->nid);
$delete_node = db_delete('quiz_truefalse_node');
$delete_node
->condition('nid', $this->node->nid);
if ($only_this_version) {
$delete_ans
->condition('question_vid', $this->node->vid);
$delete_node
->condition('vid', $this->node->vid);
}
$delete_ans
->execute();
$delete_node
->execute();
}