You are here

public function MatchingQuestion::delete in Quiz 6.3

Same name and namespace in other branches
  1. 6.6 question_types/matching/matching.classes.inc \MatchingQuestion::delete()
  2. 6.4 question_types/matching/matching.classes.inc \MatchingQuestion::delete()
  3. 6.5 question_types/matching/matching.classes.inc \MatchingQuestion::delete()
  4. 7.6 question_types/matching/matching.classes.inc \MatchingQuestion::delete()
  5. 7 question_types/matching/matching.classes.inc \MatchingQuestion::delete()
  6. 7.4 question_types/matching/matching.classes.inc \MatchingQuestion::delete()
  7. 7.5 question_types/matching/matching.classes.inc \MatchingQuestion::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/matching/matching.classes.inc, line 61
quiz_directions.classes

Class

MatchingQuestion
Implementation of Matching.

Code

public function delete($only_this_version = FALSE) {

  // Only delete a nid/vid.
  if ($only_this_version) {
    $sql = 'DELETE FROM {quiz_matching_node} WHERE nid = %d AND vid = %d';
    db_query($sql, $this->node->nid, $this->node->vid);
  }
  else {
    $sql = 'DELETE FROM {quiz_matching_node} WHERE nid = %d';
    db_query($sql, $this->node->nid, $this->node->vid);
  }
}