[LON-CAPA-cvs] cvs: modules /msu localenroll.pm

raeburn lon-capa-cvs@mail.lon-capa.org
Tue, 06 Jul 2004 17:37:11 -0000


raeburn		Tue Jul  6 13:37:11 2004 EDT

  Modified files:              
    /modules/msu	localenroll.pm 
  Log:
  Fix regexp in instcode_format().
  
  
Index: modules/msu/localenroll.pm
diff -u modules/msu/localenroll.pm:1.11 modules/msu/localenroll.pm:1.12
--- modules/msu/localenroll.pm:1.11	Tue Jul  6 04:32:59 2004
+++ modules/msu/localenroll.pm	Tue Jul  6 13:37:11 2004
@@ -1,6 +1,6 @@
 # functions to glue school database system into Lon-CAPA for
 # automated enrollment
-# $Id: localenroll.pm,v 1.11 2004/07/06 08:32:59 albertel Exp $
+# $Id: localenroll.pm,v 1.12 2004/07/06 17:37:11 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -287,13 +287,13 @@
                     );
     @{$$cat_order{'Semester'}} = ('ss','us','fs');
     foreach my $cid (keys %{$instcodes}) {
-        if ($$instcodes{$cid} =~ m/^([suf]s)(\d{2})\w{2,3}\d{3,4}\w?\d{3}$/) {
-            my $year = $2;
-            $year =~ s/^0//;
-            $$codes{$cid}{'Year'} = 2000 + $year;
+        if ($$instcodes{$cid} =~ m/^([suf]s)(\d{2})(\w{2,3})(\d{3,4}\w?)$/) {
             $$codes{$cid}{'Semester'} = $1;
             $$codes{$cid}{'Department'} = $3;
             $$codes{$cid}{'Number'} = $4;
+            my $year = $2;
+            $year =~ s/^0//;
+            $$codes{$cid}{'Year'} = 2000 + $year;
         }
     }
     my $outcome = 'ok';