Skip to content

Commit

Permalink
MDL-50959 gradebook: fix XML grade export
Browse files Browse the repository at this point in the history
  • Loading branch information
lameze authored and David Monllao committed Sep 17, 2015
1 parent 115c527 commit 8c55a50
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion grade/export/xml/grade_export_xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public function print_grades($feedback = false) {
foreach ($userdata->grades as $itemid => $grade) {
$grade_item = $this->grade_items[$itemid];
$grade->grade_item =& $grade_item;
$gradestr = $this->format_grade($grade, $this->displaytype); // no formating for now

// MDL-11669, skip exported grades or bad grades (if setting says so)
if ($export_tracking) {
Expand All @@ -90,10 +89,15 @@ public function print_grades($feedback = false) {
fwrite($handle, "\t\t<student>{$user->idnumber}</student>\n");
// Format and display the grade in the selected display type (real, letter, percentage).
if (is_array($this->displaytype)) {
// Grades display type came from the return of export_bulk_export_data() on grade publishing.
foreach ($this->displaytype as $gradedisplayconst) {
$gradestr = $this->format_grade($grade, $gradedisplayconst);
fwrite($handle, "\t\t<score>$gradestr</score>\n");
}
} else {
// Grade display type submitted directly from the grade export form.
$gradestr = $this->format_grade($grade, $this->displaytype);
fwrite($handle, "\t\t<score>$gradestr</score>\n");
}

if ($this->export_feedback) {
Expand Down

0 comments on commit 8c55a50

Please sign in to comment.