version 1.2, 2005/03/02 19:50:52
|
version 1.3, 2005/03/04 14:07:15
|
Line 16 use Apache::lonlocal;
|
Line 16 use Apache::lonlocal;
|
# of a file containing an XML description of a course request (lonbatchccrs.pm). |
# of a file containing an XML description of a course request (lonbatchccrs.pm). |
# |
# |
# XML file(s) describing courses that are to be created in domain $dom are stored in |
# XML file(s) describing courses that are to be created in domain $dom are stored in |
# /home/httpd/perl/tmp/addcourse/$dom. Each XML file is deleted after it has been |
# /home/httpd/perl/tmp/addcourse/$dom |
# parsed. |
|
# |
# |
# &create_courses() will create an account for the course owner |
# &create_courses() will create an account for the course owner |
# (if one does not currently exist), will create the course (cloning if necessary), |
# (if one does not currently exist), will create the course (cloning if necessary), |
Line 137 use Apache::lonlocal;
|
Line 136 use Apache::lonlocal;
|
# files listed in @$requests are deleted |
# files listed in @$requests are deleted |
# after the files have been parsed. |
# after the files have been parsed. |
# |
# |
# Directory searched for files listed in @$requests |
# Directory for retrieval of files listed in @$requests is: |
# is /home/httpd/perl/tmp/addcourse/$dom/auto if $context is auto |
# /home/httpd/perl/tmp/addcourse/$dom/auto/pending if $context = auto |
# and /home/httpd/perl/tmp/addcourse/$dom/web/$uname if $context is web |
# /home/httpd/perl/tmp/addcourse/$dom/web/$udom_$uname if $context = web |
# |
# |
# inputs (five) - requests - ref to array of filename(s) containing course requests |
# inputs (five) - requests - ref to array of filename(s) containing course requests |
# courseids - ref to hash to store LON-CAPA course ids of new courses |
# courseids - ref to hash to store LON-CAPA course ids of new courses |
# context - auto if called from command line, web if called from browser |
# context - auto if called from command line, web if called from browser |
# dom - domain for which the course is being created |
# dom - domain for which the course is being created |
# uname - username of DC who is requesting course creation from browser |
# uname - username of DC who is requesting course creation |
|
# udom - domain of DC who is requesting course creation |
# |
# |
# outputs (three) - output - text recording user roles added etc. |
# outputs (three) - output - text recording user roles added etc. |
# logmsg - text to be logged |
# logmsg - text to be logged |
Line 153 use Apache::lonlocal;
|
Line 153 use Apache::lonlocal;
|
############################################################# |
############################################################# |
|
|
sub create_courses { |
sub create_courses { |
my ($requests,$courseids,$context,$dom,$uname) = @_; |
my ($requests,$courseids,$context,$dom,$uname,$udom) = @_; |
my $output; |
my $output; |
my $perlvarref = LONCAPA::Configuration::read_conf('loncapa.conf'); |
my $perlvarref = LONCAPA::Configuration::read_conf('loncapa.conf'); |
# Get role names |
# Get role names |
Line 169 sub create_courses {
|
Line 169 sub create_courses {
|
my ($logmsg,$keysmsg,$newusermsg,$addresult); |
my ($logmsg,$keysmsg,$newusermsg,$addresult); |
my %enrollcount = (); |
my %enrollcount = (); |
my $newcoursedir = $$perlvarref{'lonDaemons'}.'/tmp/addcourse/'.$dom.'/'.$context; |
my $newcoursedir = $$perlvarref{'lonDaemons'}.'/tmp/addcourse/'.$dom.'/'.$context; |
if ($uname) { |
if ($context eq 'auto') { |
unless ($context eq 'auto') { |
$newcoursedir .= '/pending'; |
$newcoursedir .= '/'.$uname; |
} else { |
|
if ($uname && $udom) { |
|
$newcoursedir .= '/'.$udom.'_'.$uname; |
|
} else { |
|
$logmsg = "batchcreatecourse::create_courses() called without username and/or domain of requesting Domain Coordinator"; |
} |
} |
} |
} |
if (@{$requests} > 0) { |
if (@{$requests} > 0) { |
Line 349 sub parse_coursereqs {
|
Line 353 sub parse_coursereqs {
|
######################################################### |
######################################################### |
|
|
sub build_course { |
sub build_course { |
my ($cdom,$num,$context,$details,$longoles,$logmsg,$newusermsg,$addresult,$enrollcount,$output,$keysmsg) = @_; |
my ($cdom,$num,$context,$details,$longoles,$logmsg,$newusermsg,$addresult,$enrollcount,$output,$keysmsg,$udom,$uname) = @_; |
my $owner_uname = $$details{$num}{'owner'}; |
my $owner_uname = $$details{$num}{'owner'}; |
my $owner_domain = $$details{$num}{'domain'}; |
my $owner_domain = $$details{$num}{'domain'}; |
my $owner = $owner_uname.':'.$owner_domain; |
my $owner = $owner_uname.':'.$owner_domain; |
Line 457 sub build_course {
|
Line 461 sub build_course {
|
return; |
return; |
} |
} |
|
|
&Apache::loncreatecourse::construct_course($courseargs,$logmsg,\$courseid,\$crsudom,\$crsunum); |
&Apache::loncreatecourse::construct_course($courseargs,$logmsg,\$courseid,\$crsudom,\$crsunum,$udom,$uname); |
} else { |
} else { |
return; |
return; |
} |
} |