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

matthew lon-capa-cvs@mail.lon-capa.org
Fri, 16 Jul 2004 19:50:23 -0000


matthew		Fri Jul 16 15:50:23 2004 EDT

  Modified files:              
    /loncom/homework	grades.pm 
  Log:
  Use word 'none' instead of 'no' to indicate the section of students with
  no section (statistics, chart, spreadsheet, and the classlist all use 'none').
  Cleaned up &get_classlist to not depend on order of elements in student array.
  Removed verbage about the meaning of "no".
  
  
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.204 loncom/homework/grades.pm:1.205
--- loncom/homework/grades.pm:1.204	Fri Jul  2 04:19:48 2004
+++ loncom/homework/grades.pm	Fri Jul 16 15:50:23 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # The LON-CAPA Grading handler
 #
-# $Id: grades.pm,v 1.204 2004/07/02 08:19:48 albertel Exp $
+# $Id: grades.pm,v 1.205 2004/07/16 19:50:23 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -349,27 +349,36 @@
     #
     my %sections;
     my %fullnames;
-    foreach (keys(%$classlist)) {
-        # the following undefs are for 'domain', and 'username' respectively.
-	my (undef,undef,$end,$start,$id,$section,$fullname,$status)=
-            @{$classlist->{$_}};
+    foreach my $student (keys(%$classlist)) {
+        my $end      = 
+            $classlist->{$student}->[&Apache::loncoursedata::CL_END()];
+        my $start    = 
+            $classlist->{$student}->[&Apache::loncoursedata::CL_START()];
+        my $id       = 
+            $classlist->{$student}->[&Apache::loncoursedata::CL_ID()];
+        my $section  = 
+            $classlist->{$student}->[&Apache::loncoursedata::CL_SECTION()];
+        my $fullname = 
+            $classlist->{$student}->[&Apache::loncoursedata::CL_FULLNAME()];
+        my $status   = 
+            $classlist->{$student}->[&Apache::loncoursedata::CL_STATUS()];
 	# filter students according to status selected
 	if ($filterlist && $ENV{'form.Status'} ne 'Any') {
 	    if ($ENV{'form.Status'} ne $status) {
-		delete ($classlist->{$_});
+		delete ($classlist->{$student});
 		next;
 	    }
 	}
-	$section = ($section ne '' ? $section : 'no');
+	$section = ($section ne '' ? $section : 'none');
 	if (&canview($section)) {
 	    if ($getsec eq 'all' || $getsec eq $section) {
 		$sections{$section}++;
-		$fullnames{$_}=$fullname;
+		$fullnames{$student}=$fullname;
 	    } else {
-		delete($classlist->{$_});
+		delete($classlist->{$student});
 	    }
 	} else {
-	    delete($classlist->{$_});
+	    delete($classlist->{$student});
 	}
     }
     my %seen = ();
@@ -2299,7 +2308,7 @@
     my $sectionClass;
     if ($ENV{'form.section'} eq 'all') {
 	$sectionClass='Class </h3>';
-    } elsif ($ENV{'form.section'} eq 'no') {
+    } elsif ($ENV{'form.section'} eq 'none') {
 	$sectionClass='Students in no Section </h3>';
     } else {
 	$sectionClass='Students in Section '.$ENV{'form.section'}.'</h3>';
@@ -4876,9 +4885,6 @@
 
     $result.=&mt('Student Status').':</b>'.&Apache::lonhtmlcommon::StatusOptions($saveStatus,undef,1,undef);
 
-    if (ref($sections) && (grep /no/,@$sections)) {
-	$result.='&nbsp;(Section "no" implies the students were not assigned a section.)<br />';
-    }
     $result.='</td></tr>';
 
     $result.='<tr bgcolor="#ffffe6"valign="top"><td>'.