--- loncom/enrollment/Enrollment.pm 2021/09/08 12:13:13 1.55 +++ loncom/enrollment/Enrollment.pm 2021/12/28 02:04:35 1.57 @@ -1,5 +1,5 @@ # Automated Enrollment manager -# $Id: Enrollment.pm,v 1.55 2021/09/08 12:13:13 raeburn Exp $ +# $Id: Enrollment.pm,v 1.57 2021/12/28 02:04:35 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -25,6 +25,7 @@ # package LONCAPA::Enrollment; +use lib '/home/httpd/lib/perl'; use Apache::loncoursedata; use Apache::lonnet; use Apache::loncommon(); @@ -35,14 +36,13 @@ use HTML::Parser; use LONCAPA::Configuration; use Math::Random; use Time::Local; -use lib '/home/httpd/lib/perl'; use strict; sub update_LC { my ($dom,$crs,$adds,$drops,$startdate,$enddate,$authtype,$autharg, - $showcredits,$defaultcredits,$autofailsafe,$classesref,$groupref, - $logmsg,$newusermsg,$context,$phototypes) = @_; + $showcredits,$defaultcredits,$autofailsafe,$failsafe,$classesref, + $groupref,$logmsg,$newusermsg,$context,$phototypes) = @_; # Get institutional code and title of this class my %courseinfo = (); &get_courseinfo($dom,$crs,\%courseinfo); @@ -452,11 +452,20 @@ sub update_LC { # Check enrollment count for institutional section of student to be dropped if ($$currlist{$uname}[$instidx]) { if (exists($classcount{$$currlist{$uname}[$instidx]})) { - if ($classcount{$$currlist{$uname}[$instidx]} == 0) { + if ($failsafe eq 'any') { if ($autofailsafe) { - push(@{$delaydrops{$$currlist{$uname}[$instidx]}},$uname); + push(@{$delaydrops{$$currlist{$uname}[$instidx]}},$uname); next; } + } else { + unless ($failsafe eq 'off') { + if ($classcount{$$currlist{$uname}[$instidx]} == 0) { + if ($autofailsafe) { + push(@{$delaydrops{$$currlist{$uname}[$instidx]}},$uname); + next; + } + } + } } } }