Skip to content

Commit

Permalink
Some fixes to make preferences work correctly (if not set then they a…
Browse files Browse the repository at this point in the history
…re 0) and so now ranges and averages show correctly on grader report when these are set to defaults in preferences MDL-11618
  • Loading branch information
moodler committed Oct 8, 2007
1 parent 323ccc2 commit 4354a3e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions grade/report/grader/lib.php
Expand Up @@ -908,7 +908,8 @@ function get_avghtml($grouponly=false) {
$displaytype = GRADE_DISPLAY_TYPE_REAL;

} else if ($averagesdisplaytype == GRADE_REPORT_PREFERENCE_DEFAULT
or $averagesdisplaytype == GRADE_REPORT_PREFERENCE_INHERIT) {
|| $averagesdisplaytype == GRADE_REPORT_PREFERENCE_INHERIT
|| $averagesdisplaytype == 0) {
$displaytype = $item->get_displaytype();

} else {
Expand All @@ -917,7 +918,7 @@ function get_avghtml($grouponly=false) {

// Override grade_item setting if a display preference (not inherit) was set for the averages
if ($averagesdecimalpoints == GRADE_REPORT_PREFERENCE_DEFAULT
or $averagesdecimalpoints == GRADE_REPORT_PREFERENCE_INHERIT) {
|| $averagesdecimalpoints == GRADE_REPORT_PREFERENCE_INHERIT) {
$decimalpoints = $item->get_decimals();

} else {
Expand Down Expand Up @@ -967,7 +968,8 @@ function get_rangehtml() {
$displaytype = GRADE_DISPLAY_TYPE_REAL;

} else if ($rangesdisplaytype == GRADE_REPORT_PREFERENCE_DEFAULT
or $rangesdisplaytype == GRADE_REPORT_PREFERENCE_INHERIT) {
|| $rangesdisplaytype == GRADE_REPORT_PREFERENCE_INHERIT
|| $rangesdisplaytype == 0 ) {
$displaytype = $item->get_displaytype();

} else {
Expand Down

0 comments on commit 4354a3e

Please sign in to comment.