--- loncom/interface/londocs.pm 2017/11/30 01:52:14 1.642 +++ loncom/interface/londocs.pm 2017/11/30 02:17:50 1.643 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.642 2017/11/30 01:52:14 raeburn Exp $ +# $Id: londocs.pm,v 1.643 2017/11/30 02:17:50 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -52,6 +52,7 @@ use File::MMagic; use File::Copy; use Apache::lonlocal; use Cwd; +use UUID::Tiny ':std'; use LONCAPA qw(:DEFAULT :match); my $iconpath; @@ -675,8 +676,8 @@ sub group_import { $toolhash{$item} = &unescape($toolhash{$item}); } if (ref($ltitoolsref) eq 'HASH') { - my @deleted; if (ref($ltitoolsref->{$toolid}) eq 'HASH') { + my @deleted; $toolhash{'id'} = $toolid; if (($toolhash{'target'} eq 'iframe') || ($toolhash{'target'} eq 'tab') || ($toolhash{'target'} eq 'window')) { @@ -751,6 +752,16 @@ sub group_import { } } } + if ($toolhash{'passback'}) { + my $gradesecret = UUID::Tiny::create_uuid_as_string(UUID_V4); + $toolhash{'gradesecret'} = $gradesecret; + $toolhash{'gradesecretdate'} = time; + } + if ($toolhash{'roster'}) { + my $rostersecret = UUID::Tiny::create_uuid_as_string(UUID_V4); + $toolhash{'rostersecret'} = $rostersecret; + $toolhash{'rostersecretdate'} = time; + } my $putres = &Apache::lonnet::put('exttool_'.$marker,\%toolhash,$coursedom,$coursenum); if ($putres eq 'ok') { if (@deleted) {