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

raeburn raeburn at source.lon-capa.org
Tue Jun 8 23:22:00 EDT 2021


raeburn		Wed Jun  9 03:22:00 2021 EDT

  Modified files:              
    /modules/msu	localenroll.pm 
  Log:
  - Integration with MSU campus information systems
    - For MSU students in classlists for fall 2021 and beyond student pid will
      have a 1 instead of an A as the first character.  For now, convert the 1
      to an A for consistency with existing records.
  
  
Index: modules/msu/localenroll.pm
diff -u modules/msu/localenroll.pm:1.75 modules/msu/localenroll.pm:1.76
--- modules/msu/localenroll.pm:1.75	Sat Jun  5 15:54:30 2021
+++ modules/msu/localenroll.pm	Wed Jun  9 03:22:00 2021
@@ -1,6 +1,6 @@
 # functions to glue school database system into Lon-CAPA for
 # automated enrollment
-# $Id: localenroll.pm,v 1.75 2021/06/05 15:54:30 raeburn Exp $
+# $Id: localenroll.pm,v 1.76 2021/06/09 03:22:00 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -208,6 +208,7 @@
                           $first = $given;
                       }
                       $first =~ s/\s+$//;
+                      $pid =~ s/^1(\d{8})$/A$1/;
                       print FILE qq| <student username="$pilot">
   <autharg>MSU.EDU</autharg>
   <authtype>krb5</authtype>
@@ -1010,6 +1011,7 @@
             my $sth = $dbh->prepare("SELECT Pid,Pilot_Id FROM LONCAPA_ClassList WHERE Term_Code = '$1' AND Subj_Code = '$2' AND Crse_Code = '$3' AND Sctn_Code = '$4'  ORDER BY Pid");
             $sth->execute();
             while ( my($pid,$pilot,$name)  = $sth->fetchrow_array ) {
+                $pid =~ s/^1(\d{8})$/A$1/;
                 if ($pid =~ m/^A\d{8}$/i) {
                     $$stuinfo{$pid} = $pilot;
                     $pidcount ++;
@@ -1385,6 +1387,7 @@
             $sth->execute();
             while ( my($uname,$pid,$given,$last,$type) = $sth->fetchrow_array ) {
                 $uname=lc($uname);
+                $pid =~ s/^1(\d{8})$/A$1/;
                 $pid=lc($pid);
                 $given =~ s/^\s+//;
                 my ($first,$middle);




More information about the LON-CAPA-cvs mailing list