From b5cc9d4e963fdd0f3b20ad8c040b4562299f5120 Mon Sep 17 00:00:00 2001 From: Peter Date: Tue, 11 Dec 2018 07:56:50 +0800 Subject: [PATCH 1/2] MDL-63512 mod_lesson: Fix video links provided in feedback --- mod/lesson/continue.php | 2 +- mod/lesson/locallib.php | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/mod/lesson/continue.php b/mod/lesson/continue.php index 934e9f5176f..9960dafa2b7 100644 --- a/mod/lesson/continue.php +++ b/mod/lesson/continue.php @@ -92,7 +92,7 @@ if ($lesson->ongoing && !$reviewmode) { echo $lessonoutput->ongoing_score($lesson); } if (!$reviewmode) { - echo format_text($result->feedback, FORMAT_MOODLE, array('context' => $context)); + echo format_text($result->feedback, FORMAT_MOODLE, array('context' => $context, 'noclean' => true)); } // User is modifying attempts - save button and some instructions diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index d775cc2e1e8..c65a6cafb14 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -4181,7 +4181,7 @@ abstract class lesson_page extends lesson_base { foreach ($studentanswerresponse as $answer => $response) { // Add a table row containing the answer. - $studentanswer = $this->format_answer($answer, $context, $result->studentanswerformat); + $studentanswer = $this->format_answer($answer, $context, $result->studentanswerformat, $options); $table->data[] = array($studentanswer); // If the response exists, add a table row containing the response. If not, add en empty row. if (!empty(trim($response))) { @@ -4195,7 +4195,7 @@ abstract class lesson_page extends lesson_base { } } else { // Add a table row containing the answer. - $studentanswer = $this->format_answer($result->studentanswer, $context, $result->studentanswerformat); + $studentanswer = $this->format_answer($result->studentanswer, $context, $result->studentanswerformat, $options); $table->data[] = array($studentanswer); // If the response exists, add a table row containing the response. If not, add en empty row. if (!empty(trim($result->response))) { @@ -4223,9 +4223,15 @@ abstract class lesson_page extends lesson_base { * @param int $answerformat * @return string Returns formatted string */ - private function format_answer($answer, $context, $answerformat) { + private function format_answer($answer, $context, $answerformat, $options = []) { - return format_text($answer, $answerformat, array('context' => $context, 'para' => true)); + if (empty($options)) { + $options = [ + 'context' => $context, + 'para' => true + ]; + } + return format_text($answer, $answerformat, $options); } /** From f5065aad463c11320368085771dfdcafcaf698f1 Mon Sep 17 00:00:00 2001 From: Peter Date: Thu, 20 Dec 2018 12:49:10 +0800 Subject: [PATCH 2/2] MDL-63512 mod_lesson: Update the lesson css to exclude mediaplugin div --- theme/bootstrapbase/less/moodle/forms.less | 12 ++++++++++-- theme/bootstrapbase/style/moodle.css | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/theme/bootstrapbase/less/moodle/forms.less b/theme/bootstrapbase/less/moodle/forms.less index cd03f9b2fb6..b6b2bc6c0dc 100644 --- a/theme/bootstrapbase/less/moodle/forms.less +++ b/theme/bootstrapbase/less/moodle/forms.less @@ -48,8 +48,16 @@ form { display: none; } -.mform .fitem .fitemtitle div { - display: inline; +.mform .fitem .fitemtitle { + div { + display: inline; + } + + // MDL-63512 Override to handle issues in clean where the video styling is off. + .mediaplugin, + .mediaplugin div { + display: block; + } } #adminsettings .error, .loginpanel .error, diff --git a/theme/bootstrapbase/style/moodle.css b/theme/bootstrapbase/style/moodle.css index b396624b03a..ca2e1997cbe 100644 --- a/theme/bootstrapbase/style/moodle.css +++ b/theme/bootstrapbase/style/moodle.css @@ -16604,6 +16604,10 @@ form { .mform .fitem .fitemtitle div { display: inline; } +.mform .fitem .fitemtitle .mediaplugin, +.mform .fitem .fitemtitle .mediaplugin div { + display: block; +} #adminsettings .error, .loginpanel .error, .mform .error {