minor refactoring in grade export lib

This commit is contained in:
skodak 2007-08-30 08:24:07 +00:00
parent c901b7a652
commit 350770f466

View file

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