From: skodak Date: Thu, 30 Aug 2007 08:24:07 +0000 (+0000) Subject: minor refactoring in grade export lib X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=350770f4667e120eb0c3bf98e5b3cb32f1726ece;p=moodle.git minor refactoring in grade export lib --- diff --git a/grade/export/lib.php b/grade/export/lib.php index 077ae33cd8..91db8e6be3 100755 --- a/grade/export/lib.php +++ b/grade/export/lib.php @@ -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 {