MDL-55366 mod_lesson: Fix warning with TF page.

Having an image in the answer text would create a warning.
This commit is contained in:
Adrian Greeve
2016-08-15 10:22:21 +08:00
parent d418f42040
commit 038cfaffcc
2 changed files with 2 additions and 3 deletions
+1 -3
View File
@@ -572,9 +572,7 @@ class lesson_display_answer_form_matching extends moodleform {
// Temporary fixed until MDL-38885 gets integrated
$mform->setType('response', PARAM_TEXT);
}
$context = context_module::instance($PAGE->cm->id);
$answer->answer = file_rewrite_pluginfile_urls($answer->answer, 'pluginfile.php', $context->id,
'mod_lesson', 'page_answers', $answer->id);
$answer = lesson_page_type_matching::rewrite_answers_urls($answer);
$mform->addElement('select', $responseid, format_text($answer->answer,$answer->answerformat,$options), $responseoptions, $disabled);
$mform->setType($responseid, PARAM_TEXT);
if ($hasattempt) {
+1
View File
@@ -416,6 +416,7 @@ class lesson_display_answer_form_truefalse extends moodleform {
$ansid = 'answer_id';
}
$answer = lesson_page_type_truefalse::rewrite_answers_urls($answer);
$mform->addElement('radio', $ansid, null, format_text($answer->answer, $answer->answerformat, $options), $answer->id, $disabled);
$mform->setType($ansid, PARAM_INT);
if ($hasattempt && $answer->id == $USER->modattempts[$lessonid]->answerid) {