version 1.7, 2007/09/03 15:34:16
|
version 1.10, 2008/03/18 20:51:12
|
Line 2
|
Line 2
|
# |
# |
# Automated Course Creation script |
# Automated Course Creation script |
# |
# |
|
# $Id$ |
|
# |
# Copyright Michigan State University Board of Trustees |
# Copyright Michigan State University Board of Trustees |
# |
# |
# This file is part of the LearningOnline Network with CAPA (LON-CAPA). |
# This file is part of the LearningOnline Network with CAPA (LON-CAPA). |
Line 101
|
Line 103
|
|
|
print $fh "Sending to batch - auto,$defdom,$dcname,$dcdom ".join(":",@requests)."\n"; |
print $fh "Sending to batch - auto,$defdom,$dcname,$dcdom ".join(":",@requests)."\n"; |
my ($result,$logmsg) = &LONCAPA::batchcreatecourse::create_courses(\@requests,\%courseids,'auto',$defdom,$dcname,$dcdom); |
my ($result,$logmsg) = &LONCAPA::batchcreatecourse::create_courses(\@requests,\%courseids,'auto',$defdom,$dcname,$dcdom); |
my $output; |
my $outcome; |
if ($result ne '') { |
if ($result ne '') { |
$output = $result."\n"; |
$outcome = $result."\n"; |
} |
} |
if ($logmsg ne '') { |
if ($logmsg ne '') { |
$output .= $logmsg."\n"; |
$outcome .= $logmsg."\n"; |
} |
} |
|
print $fh $outcome; |
|
|
|
my $output; |
# Copy requests from pending directory to processed directory and unlink. |
# Copy requests from pending directory to processed directory and unlink. |
foreach my $request (@requests) { |
foreach my $request (@requests) { |
if ((-e "$batchdir/pending/$request") && $request !~ /\.\./ && $request ne '' &&$request ne './') { |
if ((-e "$batchdir/pending/$request") && $request !~ /\.\./ && $request ne '' &&$request ne './') { |
open(FILE,"<$batchdir/pending/$request"); |
open(FILE,"<$batchdir/pending/$request"); |
my @buffer = <FILE>; |
my @buffer = <FILE>; |