Permalink
Browse files

MDL-28512 qtype essay: clean up properly when a question is deleted.

  • Loading branch information...
1 parent a5ec499 commit 19835d4aff13dea5fcc5edd4c9d26255209dce2d @timhunt timhunt committed Jan 18, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 question/type/essay/questiontype.php
@@ -80,6 +80,13 @@ protected function initialise_question_instance(question_definition $question, $
$question->graderinfoformat = $questiondata->options->graderinfoformat;
}
+ public function delete_question($questionid, $contextid) {
+ global $DB;
+
+ $DB->delete_records('qtype_essay_options', array('questionid' => $questionid));
+ parent::delete_question($questionid, $contextid);
+ }
+
/**
* @return array the different response formats that the question type supports.
* internal name => human-readable name.

0 comments on commit 19835d4

Please sign in to comment.