--- loncom/automation/batchcreatecourse.pm 2020/05/22 22:01:59 1.40.2.1.2.1
+++ loncom/automation/batchcreatecourse.pm 2019/07/26 14:52:26 1.40.2.2
@@ -1,5 +1,5 @@
#
-# $Id: batchcreatecourse.pm,v 1.40.2.1.2.1 2020/05/22 22:01:59 raeburn Exp $
+# $Id: batchcreatecourse.pm,v 1.40.2.2 2019/07/26 14:52:26 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -89,7 +89,6 @@ use strict;
# 1
# 1
#
-#
# 1
# 1
#
@@ -212,7 +211,7 @@ sub create_courses {
$longroles{'Community'}{$1} = $3;
}
}
- my ($logmsg,$keysmsg,$newusermsg,$addresult,%codehash);
+ my ($logmsg,$keysmsg,$newusermsg,$addresult,%codehash,%instcodes);
my %enrollcount = ();
my $newcoursedir = LONCAPA::tempdir().'/addcourse/'.$dom.'/'.$context;
if ($context eq 'auto') {
@@ -240,12 +239,15 @@ sub create_courses {
if ($code) {
$codehash{$courseid} = $code;
}
+ if ($details{$num}{'coursecode'} ne '') {
+ push(@{$instcodes{$details{$num}{'coursecode'}}},$courseid);
+ }
}
}
}
}
}
- return ($output,$logmsg,$keysmsg,\%codehash);
+ return ($output,$logmsg,$keysmsg,\%codehash,\%instcodes);
}
#############################################################
@@ -270,7 +272,7 @@ sub parse_coursereqs {
my $role = '';
my @items = ('title','optional_id','coursecode','defaultcredits','coursehome','reshome','nonstandard','adds','drops','topmap','firstres','clonecrs','clonedom','datemode','dateshift','showphotos','setpolicy','setcontent','setcomment','setkeys','keyauth','disresdis','disablechat','openall','notify_owner','notify_dc','crstype','crsquota','uniquecode');
my @possroles = qw(st ad ep ta in cc co);
- my @dateitems = ('enrollstart','enrollend','accessstart','accessend','openallfrom');
+ my @dateitems = ('enrollstart','enrollend','accessstart','accessend');
my @useritems = ('autharg','authtype','firstname','generation','lastname','middlename','studentID');
my $p = HTML::Parser->new
(
@@ -543,7 +545,6 @@ sub build_course {
disresdis => $details->{'disresdis'},
disablechat => $details->{'disablechat'},
openall => $details->{'openall'},
- openallfrom => $details->{'openallfrom'},
firstres => $firstres
};
if ($details->{'textbook'}) {