[LON-CAPA-cvs] cvs: loncom /enrollment Enrollment.pm

raeburn lon-capa-cvs@mail.lon-capa.org
Mon, 13 Sep 2004 16:36:34 -0000


raeburn		Mon Sep 13 12:36:34 2004 EDT

  Modified files:              
    /loncom/enrollment	Enrollment.pm 
  Log:
  Bug #3463. Students previous enrolled (now dropped), and set to Manual/Locked will NOT be auto-enrolled if they re-register. 
  
  
Index: loncom/enrollment/Enrollment.pm
diff -u loncom/enrollment/Enrollment.pm:1.17 loncom/enrollment/Enrollment.pm:1.18
--- loncom/enrollment/Enrollment.pm:1.17	Mon Aug 23 13:07:27 2004
+++ loncom/enrollment/Enrollment.pm	Mon Sep 13 12:36:34 2004
@@ -1,5 +1,5 @@
 # Automated Enrollment manager
-# $Id: Enrollment.pm,v 1.17 2004/08/23 17:07:27 raeburn Exp $
+# $Id: Enrollment.pm,v 1.18 2004/09/13 16:36:34 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -51,6 +51,7 @@
     my @localstudents = ();
     my @futurestudents = ();
     my @activestudents = ();
+    my @excludedstudents = ();
     my $currlist;
     foreach my $uname (keys %{$roster} ) {
         if ($uname =~ m/^(.+):$dom$/) {
@@ -62,6 +63,8 @@
                 push @futurestudents, $1;
                 @{$$currlist{$1}} = @{$$roster{$uname}};
                 push @localstudents, $1;
+            } elsif ($$roster{$uname}[$lockedtype] == 1) {
+                push @excludedstudents, $1;
             }
         }
     }
@@ -124,7 +127,9 @@
 # Check for multiple sections for a single student 
     my @okusers = ();
     foreach my $uname (@reg_students)  {
-        if (@{$allenrolled{$uname}} > 1) {
+        if (grep/^$uname$/,@excludedstudents) {
+            $$logmsg .= "No re-enrollment for $uname - user was previously manually unenrolled and locked.".$linefeed;
+        } elsif (@{$allenrolled{$uname}} > 1) {
             my @sections = ();
             my $saved;
             for (my $i=0; $i<@{$allenrolled{$uname}}; $i++) {