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

raeburn lon-capa-cvs@mail.lon-capa.org
Thu, 12 Jan 2006 01:30:45 -0000


raeburn		Wed Jan 11 20:30:45 2006 EDT

  Modified files:              
    /loncom/enrollment	Enrollment.pm 
  Log:
  Warning now recorded if a new username being added shares a student ID with a username already in the course in LON-CAPA, regardless of whether the username currently associated with the common student ID is being dropped, and/or whether autodrops are enabled.
  
  
Index: loncom/enrollment/Enrollment.pm
diff -u loncom/enrollment/Enrollment.pm:1.26 loncom/enrollment/Enrollment.pm:1.27
--- loncom/enrollment/Enrollment.pm:1.26	Mon Jan  2 15:19:37 2006
+++ loncom/enrollment/Enrollment.pm	Wed Jan 11 20:30:44 2006
@@ -1,5 +1,5 @@
 # Automated Enrollment manager
-# $Id: Enrollment.pm,v 1.26 2006/01/02 20:19:37 raeburn Exp $
+# $Id: Enrollment.pm,v 1.27 2006/01/12 01:30:44 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -167,7 +167,7 @@
                 push @okusers, $uname;
             }
             elsif (@sections > 1) {
-                $$logmsg =  "$uname appears in classlists for the more than one section of this course, i.e. in sections: ";
+                $$logmsg .=  "$uname appears in classlists for more than one section of this course, i.e. in sections: ";
                 foreach (@sections) {
                     $$logmsg .= " $_,";
                 }
@@ -281,12 +281,16 @@
             } else {
 # Check for changed usernames by checking studentIDs
                 if ( ($stuinfo[ $place{studentID} ] ne '') && (grep/^$stuinfo[ $place{studentID} ]$/,@LCids) ) {
-                    if (grep/^$$currlist{$uname}[ $place{'studentID'} ]$/,@allINids) {
-                        foreach my $match ( @{ $unameFromLCid{ $stuinfo[ $place{studentID} ] } }  ) {
-                            if (grep/^$match$/,@okusers) {
-                                $$logmsg .= "A possible change in username has been detected for a student enrolled in this course. The existing LON-CAPA classlist contains user: $uname and student ID: ".$$currlist{$uname}[ $place{studentID} ].".  This username has been dropped from the institutional classlist, but the same student ID is used for user: $match who still appears in the institutional classlist. You may need to contact your Domain Coordinator to request a move of the student data files for user: $uname to $match".$linefeed;
+                    foreach my $match ( @{ $unameFromLCid{ $stuinfo[ $place{studentID} ] } }  ) {
+                        $$logmsg .= "A possible change in username has been detected for a student enrolled in this course. The existing LON-CAPA classlist contains user: $match and student ID: ".$stuinfo[ $place{studentID} ].". ";
+                        if (grep/^$match$/,@okusers) {
+                            $$logmsg .= "The username $match remains in the institutional classlist, but the same student ID is used for new user: $uname now found in the institutional classlist. You may need to contact your Domain Coordinator to determine how to reolve this issue and whether to move student data files for user: $match to $uname. ";
+                        } else {
+                            unless ($drops == 1) {
+                                $$logmsg .= "This username - $match - has been dropped from the institutional classlist, but the student ID of this user is also used by $uname who now appears in the institutional classlist. You may need to contact your Domain Coordinator to request a move of the student data files for user: $match to $uname. ";
                             }
                         }
+                        $$logmsg .= "Because of this student ID conflict, the new username - $uname - has not been added to the LON-CAPA classlist.".$linefeed;      
                     }
                 } elsif ($adds == 1) {
                     my ($auth,$authparam,$first,$middle,$last,$gene,$usec,$end,$start,$emailaddr,$pid,$emailenc);
@@ -332,7 +336,7 @@
 # Check for changed usernames by checking studentIDs
                     if (grep/^$$currlist{$uname}[ $stuid ]$/,@allINids) {
                         foreach my $match (@{$unameFromINid{$$currlist{$uname}[ $stuid ]}} ) {
-                            $$logmsg .= "A possible change in username has been detected for a student enrolled in this course. The existing LON-CAPA classlist contains user: $uname and student ID: $$currlist{$uname}[ $place{studentID} ].  This username has been dropped from the institutional classlist, but the same student ID is used for user: $match who still appears in the institutional classlist. You may need to move the student data files for user: $uname to $match.".$linefeed;
+                            $$logmsg .= "A possible change in username has been detected for a student enrolled in this course. The existing LON-CAPA classlist contains user: $uname and student ID: $$currlist{$uname}[ $place{studentID} ].  This username has been dropped from the institutional classlist, but the same student ID is used for user: $match who still appears in the institutional classlist. You may need to move the student data files for user: $uname to $match. Because of this, user $uname has not been dropped from the course.".$linefeed;
                             push @saved,$uname;
                         }
                     } elsif (@saved == 0) {