public function QuizQuestion::delete in Quiz 6.4
Same name and namespace in other branches
- 6.6 question_types/quiz_question/quiz_question.core.inc \QuizQuestion::delete()
- 6.3 question_types/quiz_question/quiz_question.core.inc \QuizQuestion::delete()
- 6.5 question_types/quiz_question/quiz_question.core.inc \QuizQuestion::delete()
- 7.6 question_types/quiz_question/quiz_question.core.inc \QuizQuestion::delete()
- 7 question_types/quiz_question/quiz_question.core.inc \QuizQuestion::delete()
- 7.4 question_types/quiz_question/quiz_question.core.inc \QuizQuestion::delete()
- 7.5 question_types/quiz_question/quiz_question.core.inc \QuizQuestion::delete()
Delete question data from the database.
Called by quiz_question_delete (hook_delete). Child classes must call super
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.
6 calls to QuizQuestion::delete()
- LongAnswerQuestion::delete in question_types/
long_answer/ long_answer.classes.inc - Implementation of delete
- MatchingQuestion::delete in question_types/
matching/ matching.classes.inc - Implementation of delete
- MultichoiceQuestion::delete in question_types/
multichoice/ multichoice.classes.inc - Implementation of delete
- ScaleQuestion::delete in question_types/
scale/ scale.classes.inc - Implementation of delete
- ShortAnswerQuestion::delete in question_types/
short_answer/ short_answer.classes.inc - Implementation of delete
6 methods override QuizQuestion::delete()
- LongAnswerQuestion::delete in question_types/
long_answer/ long_answer.classes.inc - Implementation of delete
- MatchingQuestion::delete in question_types/
matching/ matching.classes.inc - Implementation of delete
- MultichoiceQuestion::delete in question_types/
multichoice/ multichoice.classes.inc - Implementation of delete
- ScaleQuestion::delete in question_types/
scale/ scale.classes.inc - Implementation of delete
- ShortAnswerQuestion::delete in question_types/
short_answer/ short_answer.classes.inc - Implementation of delete
File
- question_types/
quiz_question/ quiz_question.core.inc, line 403 - Classes used in the Quiz Question module.
Class
- QuizQuestion
- A base implementation of a quiz_question, adding a layer of abstraction between the node API, quiz API and the question types.
Code
public function delete($only_this_version = FALSE) {
// Delete results
db_query('DELETE FROM {quiz_node_results_answers}
WHERE question_nid = %d' . ($only_this_version ? ' AND question_vid = %d' : ''), $this->node->nid, $this->node->vid);
// Delete properties
$sql = 'DELETE FROM {quiz_question_properties}
WHERE nid = %d';
if ($only_this_version) {
$sql .= ' AND vid = %d';
}
db_query($sql, $this->node->nid, $this->node->vid);
}