[LON-CAPA-cvs] cvs: loncom /enrollment Autoenroll.pl
raeburn
raeburn at source.lon-capa.org
Wed Sep 14 16:58:27 EDT 2016
raeburn Wed Sep 14 20:58:27 2016 EDT
Modified files:
/loncom/enrollment Autoenroll.pl
Log:
- Bug 5464
Can set failsafe value in domain (or override in Auto-enrollment course
configuration to avoid unwanted dropping of students when no data are
retrieved for a particular inststitutional section.
Index: loncom/enrollment/Autoenroll.pl
diff -u loncom/enrollment/Autoenroll.pl:1.33 loncom/enrollment/Autoenroll.pl:1.34
--- loncom/enrollment/Autoenroll.pl:1.33 Fri Mar 1 05:20:01 2013
+++ loncom/enrollment/Autoenroll.pl Wed Sep 14 20:58:27 2016
@@ -1,7 +1,7 @@
#!/usr/bin/perl
#
#Automated Enrollment script
-# $Id: Autoenroll.pl,v 1.33 2013/03/01 05:20:01 raeburn Exp $
+# $Id: Autoenroll.pl,v 1.34 2016/09/14 20:58:27 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -52,7 +52,7 @@
foreach my $dom (@domains) {
#only run if configured to
my $run_enroll = 0;
- my $domsettings;
+ my ($domsettings,$autofailsafe);
my %domconfig =
&Apache::lonnet::get_dom('configuration',['autoenroll','coursedefaults'],$dom);
if (ref($domconfig{'autoenroll'}) eq 'HASH') {
@@ -60,6 +60,9 @@
if ($domsettings->{'run'} eq '1') {
$run_enroll = 1;
}
+ if ($domsettings->{'autofailsafe'} ne '') {
+ $autofailsafe = $domsettings->{'autofailsafe'};
+ }
} else {
$run_enroll = &localenroll::run($dom);
}
@@ -160,7 +163,11 @@
if ($enrollvar{$crs}{defaultcredits}) {
$defaultcredits = $enrollvar{$crs}{defaultcredits};
}
- my ($changecount,$response) = &LONCAPA::Enrollment::update_LC($dom,$crs,$enrollvar{$crs}{autoadds},$enrollvar{$crs}{autodrops},$enrollvar{$crs}{startdate},$enrollvar{$crs}{enddate},$enrollvar{$crs}{authtype},$enrollvar{$crs}{autharg},$showcredits,$defaultcredits,$affiliates{$crs},$LC_code{$crs},\$logmsg,\$newusermsg,'automated');
+ my $failsafe = $autofailsafe;
+ if ($enrollvar{$crs}{'autodropfailsafe'}) {
+ $failsafe = $enrollvar{$crs}{'autodropfailsafe'};
+ }
+ my ($changecount,$response) = &LONCAPA::Enrollment::update_LC($dom,$crs,$enrollvar{$crs}{autoadds},$enrollvar{$crs}{autodrops},$enrollvar{$crs}{startdate},$enrollvar{$crs}{enddate},$enrollvar{$crs}{authtype},$enrollvar{$crs}{autharg},$showcredits,$defaultcredits,$failsafe,$affiliates{$crs},$LC_code{$crs},\$logmsg,\$newusermsg,'automated');
print $fh &mt('Messages start for [_1]',$crs)."\n";
print $fh "$logmsg\n";
print $fh &mt('Messages end for [_1]',$crs)."\n";
More information about the LON-CAPA-cvs
mailing list