--- loncom/enrollment/Enrollment.pm 2017/06/18 22:29:01 1.50 +++ loncom/enrollment/Enrollment.pm 2017/10/27 13:35:37 1.52 @@ -1,5 +1,5 @@ # Automated Enrollment manager -# $Id: Enrollment.pm,v 1.50 2017/06/18 22:29:01 raeburn Exp $ +# $Id: Enrollment.pm,v 1.52 2017/10/27 13:35:37 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -329,7 +329,7 @@ sub update_LC { } } # Check for institutional section change - if ($$currlist{$uname}[$instidx] ne $instsec) { + if (($$currlist{$uname}[$instidx] ne $instsec) && (!$added)) { my $modify_instsec_result = &Apache::lonnet::modify_student_enrollment($dom,$uname,undef,undef,undef,undef,undef,$stuinfo[ $place{groupID} ],$enddate,$startdate,'auto','',$cid,'',$context,$credits,$instsec); if ($modify_instsec_result =~ /^ok/) { @@ -443,7 +443,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 .= &mt('A possible change in username has been detected for a student enrolled in this course.').' '.&mt('The existing LON-CAPA classlist contains user: [_1] and student/employee ID: [_2].',$uname,$$currlist{$uname}[ $place{studentID} ]).' '.&mt('This username has been dropped from the institutional classlist, but the same student/employee ID is used for user: [_1] who still appears in the institutional classlist.',$match).' '.&mt('You may need to move the student data files for user: [_1] to [_2]',$uname,$match).' '.&mt('Because of this, user [_1] has not been dropped from the course.',$uname).$linefeed; + $$logmsg .= &mt('A possible change in username has been detected for a student enrolled in this course.').' '.&mt('The existing LON-CAPA classlist contains user: [_1] and student/employee ID: [_2].',$uname,$$currlist{$uname}[ $stuid ]).' '.&mt('This username has been dropped from the institutional classlist, but the same student/employee ID is used for user: [_1] who still appears in the institutional classlist.',$match).' '.&mt('You may need to move the student data files for user: [_1] to [_2]',$uname,$match).' '.&mt('Because of this, user [_1] has not been dropped from the course.',$uname).$linefeed; push @saved,$uname; } } elsif (@saved == 0) {