Permalink
Browse files

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

…MOODLE_24_STABLE
  • Loading branch information...
2 parents 7b8110d + 5fe2acd commit 2f286d765831130e5c4a1d194a2aca259879cef0 @stronk7 stronk7 committed Mar 11, 2013
Showing with 12 additions and 5 deletions.
  1. +12 −5 mod/lesson/report.php
View
@@ -287,10 +287,10 @@
$numofattempts++;
$avescore += $try["grade"];
$avetime += $timetotake;
- if ($try["grade"] > $highscore || $highscore == NULL) {
+ if ($try["grade"] > $highscore || $highscore === NULL) {
$highscore = $try["grade"];
}
- if ($try["grade"] < $lowscore || $lowscore == NULL) {
+ if ($try["grade"] < $lowscore || $lowscore === NULL) {
$lowscore = $try["grade"];
}
if ($timetotake > $hightime || $hightime == NULL) {
@@ -349,10 +349,10 @@
} else {
$lowtime = format_time($lowtime);
}
- if ($highscore == NULL) {
+ if ($highscore === NULL) {
$highscore = get_string("notcompleted", "lesson");
}
- if ($lowscore == NULL) {
+ if ($lowscore === NULL) {
$lowscore = get_string("notcompleted", "lesson");
}
@@ -365,7 +365,14 @@
$stattable->align = array('center', 'center', 'center', 'center', 'center', 'center');
$stattable->wrap = array('nowrap', 'nowrap', 'nowrap', 'nowrap', 'nowrap', 'nowrap');
$stattable->attributes['class'] = 'standardtable generaltable';
- $stattable->data[] = array($avescore.'%', $avetime, $highscore.'%', $lowscore.'%', $hightime, $lowtime);
+
+ if (is_numeric($highscore)) {
+ $highscore .= '%';
+ }
+ if (is_numeric($lowscore)) {
+ $lowscore .= '%';
+ }
+ $stattable->data[] = array($avescore.'%', $avetime, $highscore, $lowscore, $hightime, $lowtime);
echo html_writer::table($stattable);
} else if ($action === 'reportdetail') {

0 comments on commit 2f286d7

Please sign in to comment.