]> git.mjollnir.org Git - moodle.git/commitdiff
minor refactoring in grade export lib
authorskodak <skodak>
Thu, 30 Aug 2007 08:24:07 +0000 (08:24 +0000)
committerskodak <skodak>
Thu, 30 Aug 2007 08:24:07 +0000 (08:24 +0000)
grade/export/lib.php

index 077ae33cd8b5a09184f561e0cb542ddab60e10c9..91db8e6be3b62088c88c68a8fef8ceb799c6be1f 100755 (executable)
@@ -69,7 +69,12 @@ class grade_export {
         $this->publish = $publish;
         $this->strgrades = get_string("grades");
         $this->strgrade = get_string("grade");
-        $this->itemids = $itemids;
+        if (is_array($itemids)) {
+            $this->itemids = $itemids;
+        } else {
+            $this->itemids = array();
+        }
+        
 
         $strmax = get_string("maximumshort");
 
@@ -117,9 +122,9 @@ class grade_export {
         }
 
         // if grade_item ids are specified
-        if ($itemids) {
+        if (empty($this->itemids)) {
             $gradeitems = array();
-            foreach ($itemids as $iid) {
+            foreach ($this->itemids as $iid) {
                 $gradeitems[] = grade_item::fetch(array('id'=>(int)$iid, 'courseid'=>$this->id));
             }
         } else {