[LON-CAPA-cvs] cvs: loncom /homework grades.pm

banghart lon-capa-cvs-allow@mail.lon-capa.org
Thu, 11 Oct 2007 21:27:51 -0000


banghart		Thu Oct 11 17:27:51 2007 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  	Saving work in progress. Deal with students in multiple groups.
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.452 loncom/homework/grades.pm:1.453
--- loncom/homework/grades.pm:1.452	Thu Oct 11 16:25:34 2007
+++ loncom/homework/grades.pm	Thu Oct 11 17:27:50 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.452 2007/10/11 20:25:34 banghart Exp $
+# $Id: grades.pm,v 1.453 2007/10/11 21:27:50 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -526,14 +526,18 @@
 	    }
 	}
 	# filter students according to groups selected
+	my @stu_groups = split(/,/,$group);
 	if (@getgroup) {
 	    my $exclude = 1;
 	    foreach my $grp(@getgroup) {
-	        if ($group eq $grp) {
-	            $exclude = 0;
-	        } elsif (($grp eq 'none') && !$group) {
-	            $exclude = 0;
+	        foreach my $stu_group(@stu_groups) {
+	            if ($stu_group eq $grp) {
+	                $exclude = 0;
+    	            } 
 	        }
+    	        if (($grp eq 'none') && !$group) {
+        	        $exclude = 0;
+        	}
 	    }
 	    if ($exclude) {
 	        delete($classlist->{$student});