Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…MOODLE_21_STABLE
  • Loading branch information...
commit e785ca696ee8c5ad9e22a4e5175bfa424b508862 2 parents e92ca9d + 8af9ec6
@nebgor nebgor authored
Showing with 6 additions and 3 deletions.
  1. +1 −1  mod/lesson/essay.php
  2. +5 −2 mod/lesson/pagetypes/essay.php
View
2  mod/lesson/essay.php
@@ -393,7 +393,7 @@
$data->id = $cm->id;
$data->attemptid = $attemptid;
$data->score = $essayinfo->score;
- $data->studentanswer = format_string($essayinfo->answer, FORMAT_MOODLE);
+ $data->studentanswer = format_string($essayinfo->answer, $essayinfo->answerformat);
$data->response = $essayinfo->response;
$mform->set_data($data);
View
7 mod/lesson/pagetypes/essay.php
@@ -97,8 +97,10 @@ public function check_answer() {
if (is_array($data->answer)) {
$studentanswer = $data->answer['text'];
+ $studentanswerformat = $data->answer['format'];
} else {
$studentanswer = $data->answer;
+ $studentanswerformat = FORMAT_MOODLE;
}
if (trim($studentanswer) === '') {
@@ -117,9 +119,10 @@ public function check_answer() {
$userresponse->graded = 0;
$userresponse->score = 0;
$userresponse->answer = $studentanswer;
+ $userresponse->answerformat = $studentanswerformat;
$userresponse->response = "";
$result->userresponse = serialize($userresponse);
-
+ $result->studentanswerformat = $studentanswerformat;
$result->studentanswer = s($studentanswer);
return $result;
}
@@ -220,7 +223,7 @@ public function report_answers($answerpage, $answerdata, $useranswer, $pagestats
// dont think this should ever be reached....
$avescore = get_string("nooneansweredthisquestion", "lesson");
}
- $answerdata->answers[] = array(format_text($essayinfo->answer, FORMAT_MOODLE, $formattextdefoptions), $avescore);
+ $answerdata->answers[] = array(format_text($essayinfo->answer, $essayinfo->answerformat, $formattextdefoptions), $avescore);
$answerpage->answerdata = $answerdata;
}
return $answerpage;
Please sign in to comment.
Something went wrong with that request. Please try again.