--- loncom/automation/batchcreatecourse.pm 2008/07/02 18:44:16 1.27 +++ loncom/automation/batchcreatecourse.pm 2009/08/08 19:55:15 1.28 @@ -1,5 +1,5 @@ # -# $Id: batchcreatecourse.pm,v 1.27 2008/07/02 18:44:16 raeburn Exp $ +# $Id: batchcreatecourse.pm,v 1.28 2009/08/08 19:55:15 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -370,7 +370,7 @@ sub parse_coursereqs { # build_course() # # inputs -# domain +# course domain # course request number # context - auto if called from command line, web if called from DC web interface # ref to hash of course creation information @@ -379,8 +379,13 @@ sub parse_coursereqs { # ref to scalar used to accumulate messages sent to new users # ref to scalar used to accumulate results of new user additions # ref to hash of enrollment counts for different roles -# ref to scalar used to accumulate iformation about added roles -# ref to scalar used to accumulate +# ref to scalar used to accumulate information about added roles +# ref to scalar used to accumulate +# ref to scalar used to accumulate information about access keys +# domain of DC creating course +# username of DC creating course +# optional course number, if unique course number already obtained (e.g., for +# course requests submitted via course request form. # # outputs # LON-CAPA courseID for new (created) course @@ -388,7 +393,7 @@ sub parse_coursereqs { ######################################################### sub build_course { - my ($cdom,$num,$context,$details,$longroles,$logmsg,$newusermsg,$addresult,$enrollcount,$output,$keysmsg,$udom,$uname) = @_; + my ($cdom,$num,$context,$details,$longroles,$logmsg,$newusermsg,$addresult,$enrollcount,$output,$keysmsg,$udom,$uname,$cnum) = @_; my $owner_uname = $$details{$num}{'owner'}; my $owner_domain = $$details{$num}{'domain'}; my $owner = $owner_uname.':'.$owner_domain; @@ -504,7 +509,7 @@ sub build_course { $$logmsg .= &mt('Invalid home server for course').': '.$$details{$num}{'coursehome'}; return; } - my ($success, $msg) = &Apache::loncommon::construct_course($courseargs,$logmsg,\$courseid,\$crsudom,\$crsunum,$udom,$uname,$context); + my ($success, $msg) = &Apache::loncommon::construct_course($courseargs,$logmsg,\$courseid,\$crsudom,\$crsunum,$udom,$uname,$context,$cnum); $$logmsg .= $msg; if (!$success) { return;