You are here

public function ShortAnswerQuestion::delete in Quiz 6.3

Same name and namespace in other branches
  1. 6.6 question_types/short_answer/short_answer.classes.inc \ShortAnswerQuestion::delete()
  2. 6.4 question_types/short_answer/short_answer.classes.inc \ShortAnswerQuestion::delete()
  3. 6.5 question_types/short_answer/short_answer.classes.inc \ShortAnswerQuestion::delete()
  4. 7.6 question_types/short_answer/short_answer.classes.inc \ShortAnswerQuestion::delete()
  5. 7 question_types/short_answer/short_answer.classes.inc \ShortAnswerQuestion::delete()
  6. 7.4 question_types/short_answer/short_answer.classes.inc \ShortAnswerQuestion::delete()
  7. 7.5 question_types/short_answer/short_answer.classes.inc \ShortAnswerQuestion::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/short_answer/short_answer.classes.inc, line 73
The main classes for the short answer question type.

Class

ShortAnswerQuestion
Implementation of QuizQuestion.

Code

public function delete($only_this_version = FALSE) {
  if ($only_this_version) {
    db_query('DELETE FROM {quiz_short_answer_node_properties} WHERE nid = %d AND vid = %d', $this->node->nid, $this->node->vid);
  }
  else {
    db_query('DELETE FROM {quiz_short_answer_node_properties} WHERE nid = %d', $this->node->nid);
  }
}