--- loncom/automation/batchcreatecourse.pm 2014/01/03 18:42:16 1.40
+++ loncom/automation/batchcreatecourse.pm 2020/05/22 20:55:45 1.40.2.3
@@ -1,5 +1,5 @@
#
-# $Id: batchcreatecourse.pm,v 1.40 2014/01/03 18:42:16 raeburn Exp $
+# $Id: batchcreatecourse.pm,v 1.40.2.3 2020/05/22 20:55:45 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -83,11 +83,13 @@ use strict;
#
# 1
# 1
+# 1
# 0
# keyadmin:msu
# 1
# 1
#
+#
# 1
# 1
#
@@ -152,7 +154,7 @@ use strict;
#
# Many of these are binary options (corresponding to either checkboxes or
# radio buttons in the interactive CCRS page). Examples include:
-# setpolicy, setcontent, setkeys, disableresdis, disablechat, openall,
+# setpolicy, setcontent, setcomment, setkeys, disableresdis, disablechat, openall,
# uniquecode
#
# A value of 1 between opening and closing tags is equivalent to a
@@ -210,7 +212,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') {
@@ -238,12 +240,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);
}
#############################################################
@@ -266,9 +271,9 @@ sub parse_coursereqs {
my $xlist = 0;
my $userkey = '';
my $role = '';
- my @items = ('title','optional_id','coursecode','defaultcredits','coursehome','reshome','nonstandard','adds','drops','topmap','firstres','clonecrs','clonedom','datemode','dateshift','showphotos','setpolicy','setcontent','setkeys','keyauth','disresdis','disablechat','openall','notify_owner','notify_dc','crstype','crsquota','uniquecode');
+ 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');
+ my @dateitems = ('enrollstart','enrollend','accessstart','accessend','openallfrom');
my @useritems = ('autharg','authtype','firstname','generation','lastname','middlename','studentID');
my $p = HTML::Parser->new
(
@@ -534,12 +539,14 @@ sub build_course {
endaccess => $details->{'accessend'},
setpolicy => $details->{'setpolicy'},
setcontent => $details->{'setcontent'},
+ setcomment => $details->{'setcomment'},
reshome => $reshome,
setkeys => $details->{'setkeys'},
keyauth => $details->{'keyauth'},
disresdis => $details->{'disresdis'},
disablechat => $details->{'disablechat'},
openall => $details->{'openall'},
+ openallfrom => $details->{'openallfrom'},
firstres => $firstres
};
if ($details->{'textbook'}) {