You are here

public function MatchingResponse::delete in Quiz 7

Same name and namespace in other branches
  1. 6.6 question_types/matching/matching.classes.inc \MatchingResponse::delete()
  2. 6.3 question_types/matching/matching.classes.inc \MatchingResponse::delete()
  3. 6.4 question_types/matching/matching.classes.inc \MatchingResponse::delete()
  4. 6.5 question_types/matching/matching.classes.inc \MatchingResponse::delete()
  5. 7.6 question_types/matching/matching.classes.inc \MatchingResponse::delete()
  6. 7.4 question_types/matching/matching.classes.inc \MatchingResponse::delete()
  7. 7.5 question_types/matching/matching.classes.inc \MatchingResponse::delete()

Implementation of delete

Overrides QuizQuestionResponse::delete

See also

QuizQuestionResponse#delete()

File

question_types/matching/matching.classes.inc, line 422
matching.classes

Class

MatchingResponse
Extension of QuizQuestionResponse

Code

public function delete() {
  $match_id = db_query('SELECT match_id FROM {quiz_matching_node} WHERE nid = :nid AND vid = :vid', array(
    ':nid' => $this->question->nid,
    ':vid' => $this->question->vid,
  ))
    ->fetchCol();
  db_delete('quiz_matching_user_answers')
    ->condition('match_id', is_array($match_id) ? $match_id : array(
    0,
  ), 'IN')
    ->condition('result_id', $this->rid)
    ->execute();
}