--- loncom/automation/batchcreatecourse.pm 2016/09/01 01:05:05 1.40.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 2016/09/01 01:05:05 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 # @@ -211,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') { @@ -239,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); } #############################################################