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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 10 Nov 2003 16:38:06 -0000


albertel		Mon Nov 10 11:38:06 2003 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  - convert to use get_env_multiple
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.154 loncom/homework/grades.pm:1.155
--- loncom/homework/grades.pm:1.154	Mon Nov 10 11:35:57 2003
+++ loncom/homework/grades.pm	Mon Nov 10 11:38:06 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.154 2003/11/10 16:35:57 albertel Exp $
+# $Id: grades.pm,v 1.155 2003/11/10 16:38:06 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -749,8 +749,7 @@
 sub processGroup {
     my ($request)  = shift;
     my $ctr        = 0;
-    my @stuchecked = (ref($ENV{'form.stuinfo'}) ? @{$ENV{'form.stuinfo'}}
-		      : ($ENV{'form.stuinfo'}));
+    my @stuchecked = &Apache::loncommon::get_env_multiple('form.stuinfo');
     my $total      = scalar(@stuchecked)-1;
 
     foreach (@stuchecked) {
@@ -1829,12 +1828,7 @@
 							       $ENV{'form.msgsub'},$message);
 	    }
 	    if ($ENV{'form.collaborator'.$ctr}) {
-		my @collabstrs;
-		if (ref($ENV{'form.collaborator'.$ctr}) eq 'ARRAY') {
-		    @collabstrs=@{$ENV{'form.collaborator'.$ctr}};
-		} else {
-		    @collabstrs=$ENV{'form.collaborator'.$ctr};
-		}
+		my @collabstrs=&Apache::loncommon::get_env_multiple("form.collaborator$ctr");
 		foreach my $collabstr (@collabstrs) {
 		    my ($part,@collaborators) = split(/:/,$collabstr);
 		    foreach (@collaborators) {
@@ -3784,16 +3778,17 @@
     $result.='<tr bgcolor="#ffffe6" valign="top"><td>'."\n".
 	'&nbsp;Select Section: <select name="section">'."\n";
     if (ref($sections)) {
-	foreach (sort (@$sections)) {$result.='<option value="'.$_.'" '.
-					 ($saveSec eq $_ ? 'selected="on"' : '').'>'.$_.'</option>'."\n";}
+	foreach (sort (@$sections)) {
+	    $result.='<option value="'.$_.'" '.
+		($saveSec eq $_ ? 'selected="on"':'').'>'.$_.'</option>'."\n";
+	}
     }
     $result.= '<option value="all" '.($saveSec eq 'all' ? 'selected="on"' : ''). '>all</select> &nbsp; ';
 
     $result.='Student Status:</b>'.&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,1,undef);
 
-    if (ref($sections)) {
-	$result.='&nbsp;(Section "no" implies the students were not assigned a section.)<br />' 
-	    if (grep /no/,@$sections);
+    if (ref($sections) && (grep /no/,@$sections)) {
+	$result.='&nbsp;(Section "no" implies the students were not assigned a section.)<br />';
     }
     $result.='</td></tr>';