mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
minor refactoring in grade export lib
This commit is contained in:
parent
c901b7a652
commit
350770f466
1 changed files with 8 additions and 3 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue