You are here

public function ChoiceResponse::delete in Quiz 6.6

Implementation of delete

File

question_types/choice/choice.classes.inc, line 620
The main classes for the choice question type.

Class

ChoiceResponse
The short answer question response class.

Code

public function delete() {
  $sql = 'DELETE FROM {quiz_choice_user_answer_multi}
            WHERE user_answer_id IN(
              SELECT id FROM {quiz_choice_user_answers}
              WHERE nid = %d AND vid = %d AND result_id = %d
            )';
  db_query($sql, $this->nid, $this->question->vid, $this->question->rid);
  $sql = 'DELETE FROM {quiz_choice_user_answers}
    		WHERE result_id = %d AND nid = %d AND vid = %d';
  db_query($sql, $this->rid, $this->question->nid, $this->question->vid);
}