// Set rest of the message values
$currentpage = $lesson->load_page($attempt->pageid);
$a->question = format_text($currentpage->contents, $currentpage->contentsformat, $formattextdefoptions);
- $a->response = format_text($essayinfo->answer, $essayinfo->answerformat,
+ $answer = file_rewrite_pluginfile_urls($essayinfo->answer, 'pluginfile.php', $context->id,
+ 'mod_lesson', 'essay_responses', $attempt->id);
+ $a->response = format_text($answer, $essayinfo->answerformat,
array('context' => $context, 'para' => true));
$a->comment = $essayinfo->response;
$a->comment = file_rewrite_pluginfile_urls($a->comment, 'pluginfile.php', $context->id,
// Grading form
// Expects the following to be set: $attemptid, $answer, $user, $page, $attempt
$essayinfo = lesson_page_type_essay::extract_useranswer($attempt->useranswer);
+ $answer = file_rewrite_pluginfile_urls($essayinfo->answer, 'pluginfile.php', $context->id,
+ 'mod_lesson', 'essay_responses', $attempt->id);
$currentpage = $lesson->load_page($attempt->pageid);
$mform = new essay_grading_form(null, array('scoreoptions'=>$scoreoptions, 'user'=>$user));
$data->attemptid = $attemptid;
$data->score = $essayinfo->score;
$data->question = format_text($currentpage->contents, $currentpage->contentsformat, $formattextdefoptions);
- $data->studentanswer = format_text($essayinfo->answer, $essayinfo->answerformat,
+ $data->studentanswer = format_text($answer, $essayinfo->answerformat,
array('context' => $context, 'para' => true));
$data->response = $essayinfo->response;
$data->responseformat = $essayinfo->responseformat;