From 66b5036805dccff6e9b439dcc8adf9eecc22d87d Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Thu, 18 Oct 2018 17:14:52 +0800 Subject: [PATCH] MDL-27520 assignfeedback_comments: fix Behat failures --- mod/assign/feedback/comments/locallib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mod/assign/feedback/comments/locallib.php b/mod/assign/feedback/comments/locallib.php index 49400633960..e9dc83dc9b1 100644 --- a/mod/assign/feedback/comments/locallib.php +++ b/mod/assign/feedback/comments/locallib.php @@ -355,6 +355,9 @@ class assign_feedback_comments extends assign_feedback_plugin { // No feedback given yet - maybe we need to copy the text from the submission? if (!empty($commentinlinenabled) && $submission) { $this->convert_submission_text_to_feedback($submission, $data, $grade); + } else { // Set it to empty. + $data->assignfeedbackcomments = ''; + $data->assignfeedbackcommentsformat = FORMAT_HTML; } } @@ -367,6 +370,7 @@ class assign_feedback_comments extends assign_feedback_plugin { ASSIGNFEEDBACK_COMMENTS_FILEAREA, $grade->id ); + $mform->addElement('editor', 'assignfeedbackcomments_editor', $this->get_name(), null, $this->get_editor_options()); return true;