Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-30636 Lesson Module: fixed essay answer display format

  • Loading branch information...
commit b8e57407960d8f54d51ffbff72c07cb901498af0 1 parent acb3bf8
@rwijaya rwijaya authored
Showing with 5 additions and 2 deletions.
  1. +3 −1 mod/lesson/pagetypes/essay.php
  2. +2 −1  mod/lesson/report.php
View
4 mod/lesson/pagetypes/essay.php
@@ -177,6 +177,8 @@ public function report_answers($answerpage, $answerdata, $useranswer, $pagestats
$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 @@ public function report_answers($answerpage, $answerdata, $useranswer, $pagestats
// 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;
View
3  mod/lesson/report.php
@@ -32,7 +32,7 @@
$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 @@
$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.
Please sign in to comment.
Something went wrong with that request. Please try again.