public function LongAnswerQuestion::delete in Quiz 7
Same name and namespace in other branches
- 6.6 question_types/long_answer/long_answer.classes.inc \LongAnswerQuestion::delete()
- 6.3 question_types/long_answer/long_answer.classes.inc \LongAnswerQuestion::delete()
- 6.4 question_types/long_answer/long_answer.classes.inc \LongAnswerQuestion::delete()
- 6.5 question_types/long_answer/long_answer.classes.inc \LongAnswerQuestion::delete()
- 7.6 question_types/long_answer/long_answer.classes.inc \LongAnswerQuestion::delete()
- 7.4 question_types/long_answer/long_answer.classes.inc \LongAnswerQuestion::delete()
- 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 53 - 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);
}