From: skodak Date: Sun, 8 Oct 2006 09:04:59 +0000 (+0000) Subject: Grades computed incorrectly if assignment name appears more than twice in a course... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=91b678f30621a2ee1fbb580e92c3b592925ad556;p=moodle.git Grades computed incorrectly if assignment name appears more than twice in a course MDL-6876 , patch submitted by Gary Anderson --- diff --git a/grade/lib.php b/grade/lib.php index 33e384ccff..60e9301f95 100644 --- a/grade/lib.php +++ b/grade/lib.php @@ -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 != '') {