]> git.mjollnir.org Git - moodle.git/commitdiff
Grades computed incorrectly if assignment name appears more than twice in a course...
authorskodak <skodak>
Sun, 8 Oct 2006 09:04:59 +0000 (09:04 +0000)
committerskodak <skodak>
Sun, 8 Oct 2006 09:04:59 +0000 (09:04 +0000)
grade/lib.php

index 33e384ccffe0482585ad1b312b8bfa6e8072c929..60e9301f95244d09668e806df487d6fc571c8ed0 100644 (file)
@@ -157,7 +157,7 @@ function grade_get_formatted_grades() {
     global $CFG;
     global $course;
     global $preferences;
-    $i = 1;
+    $i = 2; // index to differentiate activities with the same name MDL-6876
     $grades = grade_get_grades();
     if (isset($grades)) {
         // iterate through all students
@@ -179,7 +179,7 @@ function grade_get_formatted_grades() {
                             if ($instance->name != '') {                
                                 // duplicate grade item name, the user should know better than to name to things by the same name, but to make sure grades don't disappear lets modify the name slightly
                                 if (isset($all_categories["$cur_category"]["$instance->name"])) {
-                                    $instance->name= $instance->name.' *'.$i.'*';
+                                    $instance->name= $instance->name.' #'.$i++;
                                 }
 
                                 if (isset($students_grade->grades) && $students_grade->grades != '') {