]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13653 droplow not ignoring ungraded items un sum aggregation; merged from MOODLE_...
authorskodak <skodak>
Mon, 25 Feb 2008 12:17:46 +0000 (12:17 +0000)
committerskodak <skodak>
Mon, 25 Feb 2008 12:17:46 +0000 (12:17 +0000)
lib/grade/grade_category.php

index dc707f613b93ead1808f4c26341491cdb081ae3c..e8d7a36095c30de38ee2ef8697b6bb60613f37d9 100644 (file)
@@ -684,6 +684,15 @@ class grade_category extends grade_object {
             }
         }
 
+        // use 0 if grade missing, droplow used and aggregating all items
+        if (!$this->aggregateonlygraded and !empty($this->droplow)) {
+            foreach($items as $itemid=>$value) {
+                if (!isset($grade_values[$itemid]) and !in_array($itemid, $excluded)) {
+                    $grade_values[$itemid] = 0;
+                }
+            }
+        }
+
         $max = 0;
 
         //find max grade