### Eclipse Workspace Patch 1.0
#P CONTRIB
Index: patches/gradebookplus_v2_1.7/lib.php
===================================================================
RCS file: /cvsroot/moodle/contrib/patches/gradebookplus_v2_1.7/lib.php,v
retrieving revision 1.3.2.16
diff -u -r1.3.2.16 lib.php
--- patches/gradebookplus_v2_1.7/lib.php	29 Nov 2007 15:17:21 -0000	1.3.2.16
+++ patches/gradebookplus_v2_1.7/lib.php	6 Dec 2007 17:05:19 -0000
@@ -1401,13 +1401,18 @@
     $strgrade = get_string("grade");
     $strmax = get_string("maximumshort");
     $stractivityreport = get_string("activityreport");
+    
+            
 
 /// Check to see if groups are being used in this course
-    if ($currentgroup  = get_current_group($course->id) && groupmode($course) != 0) {
-        $students = get_group_students($currentgroup, "u.lastname ASC");
-    } else {
-        $students = grade_get_course_students($course->id);
-    }
+
+    if (groupmode($course) !=0) {
+        if ($currentgroup = get_current_group($course->id)) { // get the current group
+            $students = get_group_students($currentgroup, "u.lastname ASC"); // group members of the group
+            }} 
+            else {// if not groupmode then the group is the entire course so get all course students
+                $students = grade_get_course_students($course->id);
+            }
 
     if (!empty($students)) {
         foreach ($students as $student) {

