From: David Monllao Date: Tue, 12 May 2015 04:08:30 +0000 (+0800) Subject: Merge branch 'MDL-34102' of git://github.com/jmvedrine/moodle X-Git-Tag: v3.0.0-beta~791 X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=commitdiff_plain;h=88d127d37cf23d8cc40eb4b5cc93ad83bf579e21;hp=6491a90be0806ad80477bef5d77e6854339d923a Merge branch 'MDL-34102' of git://github.com/jmvedrine/moodle --- diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index 693bab58f61..2dfd017cf7f 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -2520,38 +2520,40 @@ abstract class lesson_page extends lesson_base { $result->feedback = $OUTPUT->box(get_string("secondpluswrong", "lesson"), 'feedback'); } } else { - $class = 'response'; - if ($result->correctanswer) { - $class .= ' correct'; //CSS over-ride this if they exist (!important) - } else if (!$result->isessayquestion) { - $class .= ' incorrect'; //CSS over-ride this if they exist (!important) - } - $options = new stdClass; - $options->noclean = true; - $options->para = true; - $options->overflowdiv = true; - $options->context = $context; - - $result->feedback = $OUTPUT->box(format_text($this->get_contents(), $this->properties->contentsformat, $options), 'generalbox boxaligncenter'); - if (isset($result->studentanswerformat)) { - // This is the student's answer so it should be cleaned. - $studentanswer = format_text($result->studentanswer, $result->studentanswerformat, - array('context' => $context, 'para' => true)); - } else { - $studentanswer = format_string($result->studentanswer); - } - $result->feedback .= '
' - . get_string("youranswer", "lesson").' : ' . $studentanswer; - if (isset($result->responseformat)) { - $result->response = file_rewrite_pluginfile_urls($result->response, 'pluginfile.php', $context->id, + $result->feedback = ''; + } + $class = 'response'; + if ($result->correctanswer) { + $class .= ' correct'; // CSS over-ride this if they exist (!important). + } else if (!$result->isessayquestion) { + $class .= ' incorrect'; // CSS over-ride this if they exist (!important). + } + $options = new stdClass; + $options->noclean = true; + $options->para = true; + $options->overflowdiv = true; + $options->context = $context; + + $result->feedback .= $OUTPUT->box(format_text($this->get_contents(), $this->properties->contentsformat, $options), + 'generalbox boxaligncenter'); + if (isset($result->studentanswerformat)) { + // This is the student's answer so it should be cleaned. + $studentanswer = format_text($result->studentanswer, $result->studentanswerformat, + array('context' => $context, 'para' => true)); + } else { + $studentanswer = format_string($result->studentanswer); + } + $result->feedback .= '
' + . get_string("youranswer", "lesson").' : ' . $studentanswer; + if (isset($result->responseformat)) { + $result->response = file_rewrite_pluginfile_urls($result->response, 'pluginfile.php', $context->id, 'mod_lesson', 'page_responses', $result->answerid); - $result->feedback .= $OUTPUT->box(format_text($result->response, $result->responseformat, $options) + $result->feedback .= $OUTPUT->box(format_text($result->response, $result->responseformat, $options) , $class); - } else { - $result->feedback .= $OUTPUT->box($result->response, $class); - } - $result->feedback .= '
'; + } else { + $result->feedback .= $OUTPUT->box($result->response, $class); } + $result->feedback .= '
'; } }