[LON-CAPA-cvs] cvs: loncom /interface londropadd.pm

matthew lon-capa-cvs@mail.lon-capa.org
Fri, 03 May 2002 16:30:48 -0000


matthew		Fri May  3 12:30:48 2002 EDT

  Modified files:              
    /loncom/interface	londropadd.pm 
  Log:
  Fixes BUG 329.
  Changed 'ERROR: $error' to "ERROR: $error".
  Previously the check for an error was independent of the display of the list
  of students to drop.  Now any error in retrieving the list of students will
  prevent the drop list from being displayed. 
  
  
Index: loncom/interface/londropadd.pm
diff -u loncom/interface/londropadd.pm:1.37 loncom/interface/londropadd.pm:1.38
--- loncom/interface/londropadd.pm:1.37	Wed May  1 16:54:10 2002
+++ loncom/interface/londropadd.pm	Fri May  3 12:30:48 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to drop and add students in courses 
 #
-# $Id: londropadd.pm,v 1.37 2002/05/01 20:54:10 matthew Exp $
+# $Id: londropadd.pm,v 1.38 2002/05/03 16:30:48 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -687,6 +687,7 @@
         }
         return (undef,%currentlist);
     } else {
+        $tmp =~ s/^error://;
         return ($tmp,undef);
     }
 }
@@ -695,12 +696,11 @@
 sub menu_phase_two_drop {
     my $r=shift;
     my $cid=$ENV{'request.course.id'};
-    my ($error,%currentlist)=&get_current_classlist($ENV{'course.'.$cid.'.domain'},
-                                           $ENV{'course.'.$cid.'.num'});
+    my ($error,%currentlist)=&get_current_classlist
+        ($ENV{'course.'.$cid.'.domain'},$ENV{'course.'.$cid.'.num'});
     if (defined($error)) {
-        $r->print('<pre>ERROR:$error</pre>');
-    }
-    if (!defined(%currentlist)) { 
+        $r->print("<pre>ERROR:$error</pre>");
+    } elsif (!defined(%currentlist)) { 
         $r->print("There are no students currently enrolled.\n");
     } else {
         # Print out the available choices