MDL-36223 Assign: User outline report grade display
authorDamyon Wiese <damyon@moodle.com>
Thu, 2 May 2013 07:41:43 +0000 (15:41 +0800)
committerDamyon Wiese <damyon@moodle.com>
Thu, 2 May 2013 07:48:09 +0000 (15:48 +0800)
Use str_long_grade for user outline report because it handles scales and
no grade.

Thanks to Jean-Daniel Descoteaux for suggesting this fix.

mod/assign/lib.php

index 240a8f7..8ed7eaf 100644 (file)
@@ -1017,11 +1017,11 @@ function assign_user_outline($course, $user, $coursemodule, $assignment) {
     $gradingitem = $gradinginfo->items[0];
     $gradebookgrade = $gradingitem->grades[$user->id];
 
-    if (!$gradebookgrade) {
+    if (empty($gradebookgrade->str_long_grade)) {
         return null;
     }
     $result = new stdClass();
-    $result->info = get_string('outlinegrade', 'assign', $gradebookgrade->grade);
+    $result->info = get_string('outlinegrade', 'assign', $gradebookgrade->str_long_grade);
     $result->time = $gradebookgrade->dategraded;
 
     return $result;