]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14844 "Quiz Report: Bar Graph doesn't displayed maximum grade" added perfect...
authorjamiesensei <jamiesensei>
Thu, 15 May 2008 11:01:23 +0000 (11:01 +0000)
committerjamiesensei <jamiesensei>
Thu, 15 May 2008 11:01:23 +0000 (11:01 +0000)
mod/quiz/report/reportlib.php

index f6dd86993275be7092ddf17e49f1a32e05e2f00e..c325abcfff877e7c76e7f4deb7caa981b5f8ddb7 100644 (file)
@@ -120,8 +120,13 @@ function quiz_report_grade_bands($bands, $quizid, $useridlist){
     ORDER BY band";
     $data = get_records_sql_menu($sql);
     //need to create array elements with values 0 at indexes where there is no element
-    $data =  $data + array_fill(0, $bands, 0);
+    $data =  $data + array_fill(0, $bands+1, 0);
     ksort($data);
+    //place the maximum (prefect grade) into the last band i.e. make last 
+    //band for example 9 <= g <=10 (where 10 is the perfect grade) rather than
+    //just 9 <= g <10.
+    $data[$bands-1] += $data[$bands];
+    unset($data[$bands]);
     return $data;
 }
 function quiz_report_highlighting_grading_method($quiz, $qmsubselect, $qmfilter){