Merge branch 'MDL-35530' of git://github.com/rwijaya/moodle

This commit is contained in:
Sam Hemelryk 2012-12-18 10:07:28 +13:00
commit bdd7b01a33
2 changed files with 3 additions and 0 deletions

View File

@ -387,12 +387,14 @@ switch ($mode) {
// Grading form
// Expects the following to be set: $attemptid, $answer, $user, $page, $attempt
$essayinfo = unserialize($attempt->useranswer);
$currentpage = $lesson->load_page($attempt->pageid);
$mform = new essay_grading_form(null, array('scoreoptions'=>$scoreoptions, 'user'=>$user));
$data = new stdClass;
$data->id = $cm->id;
$data->attemptid = $attemptid;
$data->score = $essayinfo->score;
$data->question = format_string($currentpage->contents, $currentpage->contentsformat);
$data->studentanswer = format_string($essayinfo->answer, $essayinfo->answerformat);
$data->response = $essayinfo->response;
$mform->set_data($data);

View File

@ -53,6 +53,7 @@ class essay_grading_form extends moodleform {
$mform->addElement('hidden', 'mode', 'update');
$mform->setType('mode', PARAM_ALPHA);
$mform->addElement('static', 'question', get_string('question', 'lesson'));
$mform->addElement('static', 'studentanswer', get_string('studentresponse', 'lesson', fullname($this->_customdata['user'], true)));
$mform->addElement('textarea', 'response', get_string('comments', 'lesson'), array('rows'=>'15', 'cols'=>'60'));