Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-37883 Assignment Grade import/export. Additional fix to prevent d…

…ifferent grade rounding on export.
  • Loading branch information...
commit 47d8bb6e25daacaa93e9b6c9144a1f201ef1b38c 1 parent efdb676
@damyon damyon authored
View
3  mod/assign/feedback/offline/importgradesform.php
@@ -88,7 +88,6 @@ public function definition() {
while ($record = $gradeimporter->next()) {
$user = $record->user;
$grade = $record->grade;
- $gradedesc = $grade;
$modified = $record->modified;
$userdesc = fullname($user);
if ($assignment->is_blind_marking()) {
@@ -134,7 +133,7 @@ public function definition() {
if (!$skip) {
$update = true;
$updates[] = get_string('gradeupdate', 'assignfeedback_offline',
- array('grade'=>$gradedesc, 'student'=>$userdesc));
+ array('grade'=>format_float($grade, 2), 'student'=>$userdesc));
}
if ($ignoremodified || !$stalemodificationdate) {
View
6 mod/assign/gradingtable.php
@@ -402,7 +402,7 @@ function display_grade($grade, $editable, $userid, $modified) {
if ($grade == -1 || $grade === null) {
return '';
}
- return format_float($grade);
+ return format_float($grade, 2);
} else {
// This is a custom scale.
$scale = $this->assignment->display_grade($grade, false);
@@ -636,6 +636,10 @@ function col_timemarked(stdClass $row) {
if ($row->timemarked && $row->grade !== NULL && $row->grade >= 0) {
$o = userdate($row->timemarked);
}
+ if ($row->timemarked && $this->is_downloading()) {
+ // Force it for downloads as it affects import.
+ $o = userdate($row->timemarked);
+ }
return $o;
}

0 comments on commit 47d8bb6

Please sign in to comment.
Something went wrong with that request. Please try again.