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

This commit is contained in:
Aparup Banerjee
2012-03-13 11:32:44 +08:00
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -393,7 +393,7 @@ switch ($mode) {
$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);
+5 -2
View File
@@ -97,8 +97,10 @@ class lesson_page_type_essay extends lesson_page {
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 @@ class lesson_page_type_essay extends lesson_page {
$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 @@ class lesson_page_type_essay extends lesson_page {
// 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;