Permalink
Browse files

Merge branch 'MDL-30639_m21' of git://github.com/rwijaya/moodle into …

…MOODLE_21_STABLE
  • Loading branch information...
2 parents 1f8a330 + 69e54ca commit 4703fb429edd036895bee3679c2c7a5ea71bb2da Sam Hemelryk committed Dec 21, 2011
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.

0 comments on commit 4703fb4

Please sign in to comment.