Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-35530 Lesson Module: Add question text to facilitate grading

  • Loading branch information...
commit faba398d1739ca8c447fde352d643e641277d253 1 parent 67ba008
@rwijaya rwijaya authored
Showing with 3 additions and 0 deletions.
  1. +2 −0  mod/lesson/essay.php
  2. +1 −0  mod/lesson/essay_form.php
View
2  mod/lesson/essay.php
@@ -387,12 +387,14 @@
// 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
1  mod/lesson/essay_form.php
@@ -53,6 +53,7 @@ public function definition() {
$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'));
Please sign in to comment.
Something went wrong with that request. Please try again.