From a7171d6dacb463ce0cc45beb23a31fe2c1684141 Mon Sep 17 00:00:00 2001 From: Jean-Michel Vedrine Date: Thu, 19 Jun 2014 14:08:36 +0200 Subject: CONTRIB-5128 hints not working --- questiontype.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'questiontype.php') diff --git a/questiontype.php b/questiontype.php index 9311964..f755ce8 100644 --- a/questiontype.php +++ b/questiontype.php @@ -61,11 +61,13 @@ class qtype_algebra extends question_type { public function move_files($questionid, $oldcontextid, $newcontextid) { parent::move_files($questionid, $oldcontextid, $newcontextid); $this->move_files_in_answers($questionid, $oldcontextid, $newcontextid); + $this->move_files_in_hints($questionid, $oldcontextid, $newcontextid); } protected function delete_files($questionid, $contextid) { parent::delete_files($questionid, $contextid); $this->delete_files_in_answers($questionid, $contextid); + $this->delete_files_in_hints($questionid, $contextid); } public function delete_question($questionid, $contextid) { @@ -272,16 +274,8 @@ class qtype_algebra extends question_type { $question->allowedfuncs=implode(',', array_keys($question->allowedfuncs)); } - // Call the parent method to write the extensions fields to the database. This either returns null - // or an error object so if we get anything then return it otherwise return our existing. - $parentresult = parent::save_question_options($question); - if ($parentresult !== null) { - // Parent function returns null if all is OK. - return $parentresult; - } else { - // Otherwise just return true - this mimics the shortanswer return format. - return true; - } + parent::save_question_options($question); + $this->save_hints($question); } /** -- cgit v1.2.3