Skip to content
Browse files

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

…MOODLE_22_STABLE
  • Loading branch information...
2 parents 0f97c8a + b8e5740 commit 965344c08f273ffd3b286d6f965f554fb7da10e9 Sam Hemelryk committed Dec 22, 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 965344c

Please sign in to comment.
Something went wrong with that request. Please try again.