Skip to content

Commit

Permalink
Merge branch 'MDL-18553_master' of git://github.com/dmonllao/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Feb 17, 2015
2 parents bbcd308 + 667ef02 commit 719f734
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions mod/lesson/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
require_once($CFG->dirroot.'/mod/lesson/locallib.php');
require_once($CFG->dirroot.'/mod/lesson/view_form.php');
require_once($CFG->libdir . '/completionlib.php');
require_once($CFG->libdir . '/grade/constants.php');

$id = required_param('id', PARAM_INT); // Course Module ID
$pageid = optional_param('pageid', null, PARAM_INT); // Lesson Page ID
Expand Down Expand Up @@ -329,12 +330,14 @@
$lesson->add_message(get_string('numberofpagesviewednotice', 'lesson', $a));
}

$a = new stdClass;
$a->grade = number_format($gradeinfo->grade * $lesson->grade / 100, 1);
$a->total = $lesson->grade;
if (!$reviewmode && !$lesson->retake){
$lesson->add_message(get_string("numberofcorrectanswers", "lesson", $gradeinfo->earned), 'notify');
$lesson->add_message(get_string('yourcurrentgradeisoutof', 'lesson', $a), 'notify');
if ($lesson->grade != GRADE_TYPE_NONE) {
$a = new stdClass;
$a->grade = number_format($gradeinfo->grade * $lesson->grade / 100, 1);
$a->total = $lesson->grade;
$lesson->add_message(get_string('yourcurrentgradeisoutof', 'lesson', $a), 'notify');
}
}
}
}
Expand Down Expand Up @@ -460,10 +463,12 @@
} else {
$lessoncontent .= $OUTPUT->box(get_string("displayscorewithoutessays", "lesson", $a), 'center');
}
$a = new stdClass;
$a->grade = number_format($gradeinfo->grade * $lesson->grade / 100, 1);
$a->total = $lesson->grade;
$lessoncontent .= $lessonoutput->paragraph(get_string("yourcurrentgradeisoutof", "lesson", $a), 'center');
if ($lesson->grade != GRADE_TYPE_NONE) {
$a = new stdClass;
$a->grade = number_format($gradeinfo->grade * $lesson->grade / 100, 1);
$a->total = $lesson->grade;
$lessoncontent .= $lessonoutput->paragraph(get_string("yourcurrentgradeisoutof", "lesson", $a), 'center');
}

$grade = new stdClass();
$grade->lessonid = $lesson->id;
Expand Down Expand Up @@ -508,7 +513,9 @@

} else {
// display for teacher
$lessoncontent .= $lessonoutput->paragraph(get_string("displayofgrade", "lesson"), 'center');
if ($lesson->grade != GRADE_TYPE_NONE) {
$lessoncontent .= $lessonoutput->paragraph(get_string("displayofgrade", "lesson"), 'center');
}
}
$lessoncontent .= $OUTPUT->box_end(); //End of Lesson button to Continue.

Expand Down

0 comments on commit 719f734

Please sign in to comment.