public function TrueFalseQuestion::delete in Quiz 6.6
Same name and namespace in other branches
- 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.4 question_types/truefalse/truefalse.classes.inc \TrueFalseQuestion::delete()
- 7.5 question_types/truefalse/truefalse.classes.inc \TrueFalseQuestion::delete()
Deletes a question from the database.
Parameters
$only_this_version: If the $only_this_version flag is TRUE, then only the particular nid/vid combo should be deleted. Otherwise, all questions with the current nid can be deleted.
Overrides QuizQuestion::delete
File
- question_types/
truefalse/ truefalse.classes.inc, line 47 - Defines the classes necessary for a True/False quiz.
Class
- TrueFalseQuestion
- Implementation of QuizQuestion.
Code
public function delete($only_this_version = FALSE) {
// Only delete a nid/vid.
if ($only_this_version) {
$sql = 'DELETE FROM {quiz_truefalse_node} WHERE nid = %d AND vid = %d';
db_query($sql, $this->node->nid, $this->node->vid);
}
else {
$sql = 'DELETE FROM {quiz_truefalse_node} WHERE nid = %d';
db_query($sql, $this->node->nid, $this->node->vid);
}
}