]> git.mjollnir.org Git - moodle.git/commitdiff
removing $grade_item param from grade_grde methods - not needed anymore, assignment...
authorskodak <skodak>
Wed, 8 Aug 2007 10:27:29 +0000 (10:27 +0000)
committerskodak <skodak>
Wed, 8 Aug 2007 10:27:29 +0000 (10:27 +0000)
fixed typo in grade refresh code

lib/grade/grade_grade.php
lib/grade/grade_item.php

index c415a03cfdeff6fb7e78c894e8961bba92928c85..59a90d014b14f9fb6ce88126742a50c46350d6b6 100644 (file)
@@ -156,13 +156,10 @@ class grade_grade extends grade_object {
 
     /**
      * Loads the grade_item object referenced by $this->itemid and saves it as $this->grade_item for easy access.
-     * @param object $grade_item An optional grade_item given to avoid having to reload one from the DB
      * @return object grade_item.
      */
-    function load_grade_item($grade_item=null) {
-        if (!empty($grade_item) && get_class($grade_item) == 'grade_item') {
-            $this->grade_item = $grade_item;
-        } elseif (empty($this->grade_item) && !empty($this->itemid)) {
+    function load_grade_item() {
+        if (empty($this->grade_item) and !empty($this->itemid)) {
             $this->grade_item = grade_item::fetch(array('id'=>$this->itemid));
         }
         return $this->grade_item;
@@ -170,15 +167,14 @@ class grade_grade extends grade_object {
 
     /**
      * Is grading object editable?
-     * @param object $grade_item An optional grade_item given to avoid having to reload one from the DB
      * @return boolean
      */
-    function is_editable($grade_item=null) {
-        if ($this->is_locked($grade_item)) {
+    function is_editable() {
+        if ($this->is_locked()) {
             return false;
         }
 
-        $grade_item = $this->load_grade_item($grade_item);
+        $grade_item = $this->load_grade_item();
 
         if ($grade_item->gradetype == GRADE_TYPE_NONE) {
             return false;
@@ -192,11 +188,10 @@ class grade_grade extends grade_object {
      * Internally any date in locked field (including future ones) means locked,
      * the date is stored for logging purposes only.
      *
-     * @param object $grade_item An optional grade_item given to avoid having to reload one from the DB
      * @return boolean true if locked, false if not
      */
-    function is_locked($grade_item=null) {
-        $this->load_grade_item($grade_item);
+    function is_locked() {
+        $this->load_grade_item();
 
         return !empty($this->locked) or $this->grade_item->is_locked();
     }
index b9a5e6ac3e4199f1994bf268d6292c6086bd677f..1bd4c0e393c70a0a6505c8060a5d8d6d54c1f598 100644 (file)
@@ -1193,7 +1193,7 @@ class grade_item extends grade_object {
             }
 
             if (!$activity = get_record($this->itemmodule, 'id', $this->iteminstance)) {
-                debuggin('Can not find activity');
+                debugging('Can not find activity');
                 return;
             }