diff --git a/mod/lesson/pagetypes/essay.php b/mod/lesson/pagetypes/essay.php index c5fe1607d91..4793572f724 100644 --- a/mod/lesson/pagetypes/essay.php +++ b/mod/lesson/pagetypes/essay.php @@ -177,6 +177,8 @@ class lesson_page_type_essay extends lesson_page { $answers = $this->get_answers(); $formattextdefoptions = new stdClass; $formattextdefoptions->para = false; //I'll use it widely in this page + $formattextdefoptions->context = $answerpage->context; + foreach ($answers as $answer) { if ($useranswer != NULL) { $essayinfo = unserialize($useranswer->useranswer); @@ -216,7 +218,7 @@ class lesson_page_type_essay extends lesson_page { // dont think this should ever be reached.... $avescore = get_string("nooneansweredthisquestion", "lesson"); } - $answerdata->answers[] = array(s($essayinfo->answer), $avescore); + $answerdata->answers[] = array(format_text($essayinfo->answer, $answerdata->responseformat, $formattextdefoptions), $avescore); $answerpage->answerdata = $answerdata; } return $answerpage; diff --git a/mod/lesson/report.php b/mod/lesson/report.php index 9a867e161ce..f2d1e059f53 100644 --- a/mod/lesson/report.php +++ b/mod/lesson/report.php @@ -32,7 +32,7 @@ $pageid = optional_param('pageid', NULL, PARAM_INT); // Lesson Page ID $action = optional_param('action', 'reportoverview', PARAM_ALPHA); // action to take $nothingtodisplay = false; -$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST);; +$cm = get_coursemodule_from_id('lesson', $id, 0, false, MUST_EXIST); $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST); $lesson = new lesson($DB->get_record('lesson', array('id' => $cm->instance), '*', MUST_EXIST)); @@ -455,6 +455,7 @@ if ($action === 'delete') { $answerpage->qtype = $qtypes[$page->qtype].$page->option_description_string(); $answerpage->grayout = $page->grayout; + $answerpage->context = $context; if (empty($userid)) { // there is no userid, so set these vars and display stats.