version 1.78, 2005/04/07 06:56:23
|
version 1.85, 2006/01/16 23:11:50
|
Line 90 sub writefile {
|
Line 90 sub writefile {
|
my %crsdata=&Apache::lonnet::coursedescription($courseid); |
my %crsdata=&Apache::lonnet::coursedescription($courseid); |
return &Apache::lonnet::finishuserfileupload( |
return &Apache::lonnet::finishuserfileupload( |
$crsdata{'num'},$crsdata{'domain'}, |
$crsdata{'num'},$crsdata{'domain'}, |
$crsdata{'home'}, |
|
'output',$which); |
'output',$which); |
} |
} |
|
|
Line 160 sub copyresourcedb {
|
Line 159 sub copyresourcedb {
|
my %newdata=(); |
my %newdata=(); |
undef %newdata; |
undef %newdata; |
my $startdate=$data{$origcrsid.'.0.opendate'}; |
my $startdate=$data{$origcrsid.'.0.opendate'}; |
|
if (!$startdate) { |
|
# now global start date for assements try the enrollment start |
|
my %start=&Apache::lonnet::get('environment', |
|
['default_enrollment_start_date'], |
|
$origcrsdata{'domain'},$origcrsdata{'num'}); |
|
|
|
$startdate = $start{'default_enrollment_start_date'}; |
|
} |
my $today=time; |
my $today=time; |
my $delta=0; |
my $delta=0; |
if ($startdate) { |
if ($startdate) { |
Line 194 sub copyresourcedb {
|
Line 201 sub copyresourcedb {
|
$thiskey=~s/^$origcrsid/$newcrsid/; |
$thiskey=~s/^$origcrsid/$newcrsid/; |
$newdata{$thiskey}=$data{$_}; |
$newdata{$thiskey}=$data{$_}; |
if ($data{$_.'.type'}=~/^date_(start|end)$/) { |
if ($data{$_.'.type'}=~/^date_(start|end)$/) { |
$newdata{$thiskey}=$newdata{$thiskey}+$delta; |
if ($delta > 0) { |
|
$newdata{$thiskey}=$newdata{$thiskey}+$delta; |
|
} else { |
|
# no delta, it's unlikely we want the old dates and times |
|
delete($newdata{$thiskey}); |
|
delete($newdata{$thiskey.'.type'}); |
|
} |
} |
} |
} |
} |
return &Apache::lonnet::put |
return &Apache::lonnet::put |
Line 215 sub copyuserfiles {
|
Line 228 sub copyuserfiles {
|
|
|
sub copydbfiles { |
sub copydbfiles { |
my ($origcrsid,$newcrsid)=@_; |
my ($origcrsid,$newcrsid)=@_; |
|
|
|
my ($origcrs_discussion) = ($origcrsid=~m|^/(.*)|); |
|
$origcrs_discussion=~s|/|_|g; |
foreach (&crsdirlist($origcrsid)) { |
foreach (&crsdirlist($origcrsid)) { |
if ($_=~/\.db$/) { |
if ($_=~/\.db$/) { |
unless |
unless |
($_=~/^(nohist\_|discussiontimes|classlist|versionupdate|resourcedata)/) { |
($_=~/^(nohist\_|discussiontimes|classlist|versionupdate|resourcedata|\Q$origcrs_discussion\E|slots|slot_reservations|(grading|review)queue|CODEs)/) { |
©db($origcrsid,$newcrsid,$_); |
©db($origcrsid,$newcrsid,$_); |
|
my $histfile=$_; |
|
$histfile=~s/\.db$/\.hist/; |
|
©file($origcrsid,$newcrsid,$histfile); |
} |
} |
} |
} |
} |
} |
Line 782 sub construct_course {
|
Line 801 sub construct_course {
|
foreach my $item (@sections) { |
foreach my $item (@sections) { |
my ($sec,$gp) = split/:/,$item; |
my ($sec,$gp) = split/:/,$item; |
my $class = $args->{'crscode'}.$sec; |
my $class = $args->{'crscode'}.$sec; |
my $addcheck = &Apache::lonnet::auto_new_course($crsunum,$crsudom,$class,$cenv{'internal.courseowner'}); |
my $addcheck = &Apache::lonnet::auto_new_course($$crsunum,$$crsudom,$class,$cenv{'internal.courseowner'}); |
$cenv{'internal.sectionnums'} .= $item.','; |
$cenv{'internal.sectionnums'} .= $item.','; |
unless ($addcheck eq 'ok') { |
unless ($addcheck eq 'ok') { |
push @badclasses, $class; |
push @badclasses, $class; |