From cc8ac87f0113ab1014b291be0489a2d43d20d803 Mon Sep 17 00:00:00 2001 From: Jean-Michel Vedrine Date: Sun, 25 Jan 2015 17:13:00 +0100 Subject: [PATCH] MDL-48964 mod_lesson: Errors when updating matching questions --- mod/lesson/pagetypes/matching.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mod/lesson/pagetypes/matching.php b/mod/lesson/pagetypes/matching.php index 7c28403be3f..1a2c8d1b526 100644 --- a/mod/lesson/pagetypes/matching.php +++ b/mod/lesson/pagetypes/matching.php @@ -342,9 +342,8 @@ class lesson_page_type_matching extends lesson_page { } else { $DB->update_record("lesson_answers", $this->answers[$i]->properties()); } - // Save files in answers and responses. - $this->save_answers_files($context, $maxbytes, $this->answers[$i], - $properties->answer_editor[$i], $properties->response_editor[$i]); + // Save files in answers (no response_editor for matching questions). + $this->save_answers_files($context, $maxbytes, $this->answers[$i], $properties->answer_editor[$i]); } else if ($i < 2) { if (!isset($this->answers[$i]->id)) { $this->answers[$i]->id = $DB->insert_record("lesson_answers", $this->answers[$i]); @@ -352,9 +351,8 @@ class lesson_page_type_matching extends lesson_page { $DB->update_record("lesson_answers", $this->answers[$i]->properties()); } - // Save files in answers and responses. - $this->save_answers_files( $context, $maxbytes, $this->answers[$i], - $properties->answer_editor[$i], $properties->response_editor[$i]); + // Save files in answers (no response_editor for matching questions). + $this->save_answers_files($context, $maxbytes, $this->answers[$i], $properties->answer_editor[$i]); } else if (isset($this->answers[$i]->id)) { $DB->delete_records('lesson_answers', array('id'=>$this->answers[$i]->id)); unset($this->answers[$i]);