]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19218 fixed missing method grade_category::is_extracredit_used() - not merged...
authorskodak <skodak>
Sun, 17 May 2009 19:19:33 +0000 (19:19 +0000)
committerskodak <skodak>
Sun, 17 May 2009 19:19:33 +0000 (19:19 +0000)
lib/grade/grade_category.php

index e02035f4a552acca5f30acd1caa81ec9bc35d2b6..621cfed598e1a115b3ac5943cfe9f60555f56895 100644 (file)
@@ -835,6 +835,16 @@ class grade_category extends grade_object {
         }
     }
 
+    /**
+     * Returns true if category uses extra credit of any kind
+     * @return boolean true if extra credit used
+     */
+    function is_extracredit_used() {
+        return ($this->aggregation == GRADE_AGGREGATE_WEIGHTED_MEAN2
+             or $this->aggregation == GRADE_AGGREGATE_EXTRACREDIT_MEAN
+             or $this->aggregation == GRADE_AGGREGATE_SUM);
+    }
+
     /**
      * Returns true if category uses special aggregation coeficient
      * @return boolean true if coeficient used