Permalink
Browse files

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

  • Loading branch information...
1 parent e61f96c commit af8ce622b01e9a5c049de7890a0a3ff979e606d9 @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 af8ce62

Please sign in to comment.