--- loncom/enrollment/Enrollment.pm 2006/01/02 20:19:37 1.26 +++ loncom/enrollment/Enrollment.pm 2006/01/12 01:30:44 1.27 @@ -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 @@ sub update_LC { 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 @@ sub update_LC { } 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 @@ sub update_LC { # 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) {