version 1.727, 2025/03/15 01:03:33
|
version 1.728, 2025/06/14 02:50:25
|
Line 1704 sub group_import {
|
Line 1704 sub group_import {
|
my $marker = $2; |
my $marker = $2; |
my $info = $3; |
my $info = $3; |
my ($toolid,$toolprefix,$tooltype,%toolhash,%toolsettings); |
my ($toolid,$toolprefix,$tooltype,%toolhash,%toolsettings); |
my @extras = ('linktext','explanation','crslabel','crstitle','crsappend','returnurl','backtourl'); |
my @extras = ('linktext','explanation','crslabel','crstitle','crsappend','returnurl','backtourl','desturl','delay'); |
my @toolinfo = split(/:/,$info); |
my @toolinfo = split(/:/,$info); |
if ($residx) { |
if ($residx) { |
%toolsettings=&Apache::lonnet::dump('exttool_'.$marker,$coursedom,$coursenum); |
%toolsettings=&Apache::lonnet::dump('exttool_'.$marker,$coursedom,$coursenum); |
Line 1722 sub group_import {
|
Line 1722 sub group_import {
|
($toolhash{'target'},$toolhash{'width'},$toolhash{'height'}, |
($toolhash{'target'},$toolhash{'width'},$toolhash{'height'}, |
$toolhash{'linktext'},$toolhash{'explanation'},$toolhash{'crslabel'}, |
$toolhash{'linktext'},$toolhash{'explanation'},$toolhash{'crslabel'}, |
$toolhash{'crstitle'},$toolhash{'crsappend'},$toolhash{'gradable'}, |
$toolhash{'crstitle'},$toolhash{'crsappend'},$toolhash{'gradable'}, |
$toolhash{'returnurl'},$toolhash{'backtourl'}) = @toolinfo; |
$toolhash{'returnurl'},$toolhash{'backtourl'},$toolhash{'desturl'}, |
|
$toolhash{'delay'}) = @toolinfo; |
foreach my $item (@extras) { |
foreach my $item (@extras) { |
$toolhash{$item} = &unescape($toolhash{$item}); |
$toolhash{$item} = &unescape($toolhash{$item}); |
} |
} |
|
foreach my $item ('crsappend','gradable','returnurl', |
|
'backtourl','desturl','delay') { |
|
$toolhash{$item} =~ s/^\s+//; |
|
$toolhash{$item} =~ s/\s+$//; |
|
} |
if ($folder =~ /^supplemental/) { |
if ($folder =~ /^supplemental/) { |
delete($toolhash{'gradable'}); |
delete($toolhash{'gradable'}); |
} else { |
} else { |
Line 1786 sub group_import {
|
Line 1792 sub group_import {
|
} |
} |
} |
} |
} |
} |
|
my $nocrsdest = 1; |
if (ref($tools{'crsconf'}) eq 'HASH') { |
if (ref($tools{'crsconf'}) eq 'HASH') { |
foreach my $item ('label','title','linktext','explanation') { |
foreach my $item ('label','title','linktext','explanation') { |
my $crsitem; |
my $crsitem; |
Line 1817 sub group_import {
|
Line 1824 sub group_import {
|
delete($toolhash{'returnurl'}); |
delete($toolhash{'returnurl'}); |
delete($toolhash{'backtourl'}); |
delete($toolhash{'backtourl'}); |
} |
} |
|
if ($tools{'crsconf'}{'desturl'}) { |
|
if ($toolhash{'desturl'} =~ m{^(https?\://|/)}) { |
|
undef($nocrsdest); |
|
} else { |
|
delete($toolhash{'desturl'}); |
|
delete($toolhash{'delay'}); |
|
} |
|
} else { |
|
delete($toolhash{'desturl'}); |
|
delete($toolhash{'delay'}); |
|
} |
} |
} |
if ($toolhash{'passback'}) { |
if ($toolhash{'passback'}) { |
my $gradesecret = UUID::Tiny::create_uuid_as_string(UUID_V4); |
my $gradesecret = UUID::Tiny::create_uuid_as_string(UUID_V4); |
Line 1828 sub group_import {
|
Line 1846 sub group_import {
|
$toolhash{'rostersecret'} = $rostersecret; |
$toolhash{'rostersecret'} = $rostersecret; |
$toolhash{'rostersecretdate'} = time; |
$toolhash{'rostersecretdate'} = time; |
} |
} |
|
if ($nocrsdest) { |
|
foreach my $item ('desturl','delay') { |
|
if (exists($toolhash{$item})) { |
|
delete($toolhash{$item}); |
|
} |
|
} |
|
} elsif (exists($toolhash{'delay'})) { |
|
unless ($toolhash{'delay'} =~ /^(\d+\.?\d*)$/) { |
|
delete($toolhash{'delay'}); |
|
} |
|
} |
my $changegradable; |
my $changegradable; |
if (($residx) && ($folder =~ /^default/)) { |
if (($residx) && ($folder =~ /^default/)) { |
if ($toolsettings{'gradable'}) { |
if ($toolsettings{'gradable'}) { |
Line 1852 sub group_import {
|
Line 1881 sub group_import {
|
if (($toolsettings{'returnurl'} ne '') && (!exists($toolhash{'returnurl'}))) { |
if (($toolsettings{'returnurl'} ne '') && (!exists($toolhash{'returnurl'}))) { |
push(@deleted,'returnurl'); |
push(@deleted,'returnurl'); |
} |
} |
|
if (($toolsettings{'desturl'} ne '') && (!exists($toolhash{'desturl'}))) { |
|
push(@deleted,'desturl'); |
|
} |
|
if (($toolsettings{'delay'} ne '') && (!exists($toolhash{'delay'}))) { |
|
push(@deleted,'delay'); |
|
} |
} |
} |
my $putres = &Apache::lonnet::put('exttool_'.$marker,\%toolhash,$coursedom,$coursenum); |
my $putres = &Apache::lonnet::put('exttool_'.$marker,\%toolhash,$coursedom,$coursenum); |
if ($putres eq 'ok') { |
if ($putres eq 'ok') { |