--- grade/report/overview/lib.php  2008-10-22 16:05:50.000000000 -0500
+++ grade/report/overview/lib.php       2008-11-06 10:31:16.000000000 -0600
@@ -114,6 +114,8 @@
 
         // MDL-11679, only show 'mycourses' instead of all courses
         if ($courses = get_my_courses($this->user->id, 'c.sortorder ASC', 'id, shortname')) {
+            // $numusers is only for THIS course, thus will fail if the number of gradable roles
+            // are different in other courses.
             $numusers = $this->get_numusers(false);
 
             foreach ($courses as $course) {
@@ -146,6 +148,20 @@
                                    AND itemid = {$grade_item->id}";
                     $rank = count_records_sql($sql) + 1;
 
+                    // Grab the context of the course in question
+                    $context = get_context_instance(CONTEXT_COURSE, $course->id);
+
+                    // Counts the sql for gradeable users in the course
+                    $sql = "SELECT count(u.id)
+                              FROM {$CFG->prefix}role_assignments r
+                                  JOIN {$CFG->prefix}user u 
+                                  ON u.id = r.userid
+                              WHERE (r.contextid = $context->id)
+                                  AND r.roleid IN ({$CFG->gradebookroles})
+                                  AND u.deleted = 0";
+  
+                    $numusers = count_records_sql($sql);
+
                     $data[] = "$rank/$numusers";
 
                 } else {

