version 1.648, 2017/12/29 15:55:21
|
version 1.649, 2017/12/29 16:01:33
|
Line 1907 sub do_paste_from_buffer {
|
Line 1907 sub do_paste_from_buffer {
|
cdom => $coursedom, |
cdom => $coursedom, |
cnum => $coursenum, |
cnum => $coursenum, |
); |
); |
|
if ($prefix eq 'ext.tool') { |
|
if ($prefixchg{$suffix} eq 'docstosupp') { |
|
$info{'delgradable'} = 1; |
|
} |
|
} |
if (($srcdom{$suffix} =~ /^$match_domain$/) && ($srcnum{$suffix} =~ /^$match_courseid$/)) { |
if (($srcdom{$suffix} =~ /^$match_domain$/) && ($srcnum{$suffix} =~ /^$match_courseid$/)) { |
unless (($srcdom{$suffix} eq $coursedom) && ($srcnum{$suffix} eq $coursenum)) { |
unless (($srcdom{$suffix} eq $coursedom) && ($srcnum{$suffix} eq $coursenum)) { |
$fromothercrs = 1; |
$fromothercrs = 1; |
Line 1998 sub do_paste_from_buffer {
|
Line 2003 sub do_paste_from_buffer {
|
©_templated_files($url,$srcdom{$suffix},$srcnum{$suffix},$srcmapidx{$suffix}, |
©_templated_files($url,$srcdom{$suffix},$srcnum{$suffix},$srcmapidx{$suffix}, |
$coursedom,$coursenum,$template,$newidx,"$folder.$container"); |
$coursedom,$coursenum,$template,$newidx,"$folder.$container"); |
} |
} |
|
} elsif ($url =~ /ext\.tool$/) { |
|
if (($newidx) && ($folder=~/^default/)) { |
|
my $marker = (split(m{/},$url))[4]; |
|
my %toolsettings = &Apache::lonnet::dump('exttool_'.$marker,$coursedom,$coursenum); |
|
my $val = 'no'; |
|
if ($toolsettings{'gradable'}) { |
|
$val = 'yes'; |
|
} |
|
&LONCAPA::map::storeparameter($newidx,'parameter_0_gradable',$val, |
|
'string_yesno'); |
|
&remember_parms($newidx,'gradable','set',$val); |
|
} |
} |
} |
$LONCAPA::map::resources[$newidx]=$title.':'.&LONCAPA::map::qtunescape($url). |
$LONCAPA::map::resources[$newidx]=$title.':'.&LONCAPA::map::qtunescape($url). |
':'.$ext.':normal:res'; |
':'.$ext.':normal:res'; |
Line 2246 sub dbcopy {
|
Line 2263 sub dbcopy {
|
} |
} |
} |
} |
$db_name =~ s{_\d*$ }{_$suffix}x; |
$db_name =~ s{_\d*$ }{_$suffix}x; |
|
if (($prefix eq 'exttool') && ($dbref->{'delgradable'}) && ($contents{'gradable'})) { |
|
delete($contents{'gradable'}); |
|
} |
$result=&Apache::lonnet::put($db_name,\%contents, |
$result=&Apache::lonnet::put($db_name,\%contents, |
$coursedom,$coursenum); |
$coursedom,$coursenum); |
if ($result eq 'ok') { |
if ($result eq 'ok') { |
Line 2530 sub url_paste_fixups {
|
Line 2550 sub url_paste_fixups {
|
$changed = 1; |
$changed = 1; |
} |
} |
} |
} |
} elsif ($ressrc =~ m{^/adm/($match_domain)/($match_courseid)/.+$}) { |
} elsif ($ressrc =~ m{^/adm/($match_domain)/($match_courseid)/(.+)$}) { |
next if ($skip); |
next if ($skip); |
my $srcdom = $1; |
my $srcdom = $1; |
my $srcnum = $2; |
my $srcnum = $2; |
|
my $rem = $3; |
|
my ($is_exttool,$exttoolchg); |
|
if ($rem =~ m{\d+/ext\.tool$}) { |
|
$is_exttool = 1; |
|
} |
if (($srcdom ne $cdom) || ($srcnum ne $cnum)) { |
if (($srcdom ne $cdom) || ($srcnum ne $cnum)) { |
$rewrites->{$oldurl}{$id} = $ressrc; |
$rewrites->{$oldurl}{$id} = $ressrc; |
$dbcopies->{$oldurl}{$id}{'src'} = $ressrc; |
$dbcopies->{$oldurl}{$id}{'src'} = $ressrc; |
$dbcopies->{$oldurl}{$id}{'cdom'} = $srcdom; |
$dbcopies->{$oldurl}{$id}{'cdom'} = $srcdom; |
$dbcopies->{$oldurl}{$id}{'cnum'} = $srcnum; |
$dbcopies->{$oldurl}{$id}{'cnum'} = $srcnum; |
$changed = 1; |
$changed = 1; |
|
if ($is_exttool) { |
|
$exttoolchg = 1; |
|
} |
|
} elsif (($rem =~ m{\d+/ext\.tool$}) && |
|
($env{'form.docs.markedcopy_options'} ne 'move')) { |
|
$dbcopies->{$oldurl}{$id}{'src'} = $ressrc; |
|
$dbcopies->{$oldurl}{$id}{'cdom'} = $srcdom; |
|
$dbcopies->{$oldurl}{$id}{'cnum'} = $srcnum; |
|
$changed = 1; |
|
$exttoolchg = 1; |
|
} |
|
if (($is_exttool) && ($prefixchg)) { |
|
if ($oldurl =~ m{^/uploaded/$match_domain/$match_courseid/default}) { |
|
if ($exttoolchg) { |
|
$dbcopies->{$oldurl}{$id}{'delgradable'} = 1; |
|
} |
|
} |
} |
} |
} elsif ($ressrc =~ m{^/adm/$match_domain/$match_username/\d+/(smppg|bulletinboard)$}) { |
} elsif ($ressrc =~ m{^/adm/$match_domain/$match_username/\d+/(smppg|bulletinboard)$}) { |
if (($fromcdom ne $cdom) || ($fromcnum ne $cnum) || |
if (($fromcdom ne $cdom) || ($fromcnum ne $cnum) || |