Merge branch 'wip-MDL-55366-master' of git://github.com/abgreeve/moodle
authorDan Poltawski <dan@moodle.com>
Mon, 15 Aug 2016 10:44:09 +0000 (11:44 +0100)
committerDan Poltawski <dan@moodle.com>
Mon, 15 Aug 2016 10:44:09 +0000 (11:44 +0100)
mod/lesson/pagetypes/matching.php
mod/lesson/pagetypes/truefalse.php

index 94ba3aa..b784f8e 100644 (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) {
index 8ce8f09..f8dd81f 100644 (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);
             $radiobuttons[] = $mform->createElement('radio', $ansid, null,
                 format_text($answer->answer, $answer->answerformat, $options), $answer->id, $disabled);