--- loncom/interface/londocs.pm 2017/12/29 15:11:18 1.647 +++ loncom/interface/londocs.pm 2017/12/29 15:55:21 1.648 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.647 2017/12/29 15:11:18 raeburn Exp $ +# $Id: londocs.pm,v 1.648 2017/12/29 15:55:21 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -677,7 +677,9 @@ sub group_import { $toolhash{$item} = &unescape($toolhash{$item}); } if ($folder =~ /^supplemental/) { - delete($toolhash{'gradable'}); + delete($toolhash{'gradable'}); + } else { + $toolhash{'gradable'} =~ s/\D+//g; } if (ref($ltitoolsref) eq 'HASH') { if (ref($ltitoolsref->{$toolid}) eq 'HASH') { @@ -768,13 +770,19 @@ sub group_import { } my $changegradable; if (($residx) && ($folder =~ /^default/)) { - if (exists($toolsettings{'gradable'})) { - if (!exists($toolhash{'gradable'})) { + if ($toolsettings{'gradable'}) { + unless (($toolhash{'gradable'}) || (defined($LONCAPA::map::zombies[$residx]))) { push(@deleted,'gradable'); $changegradable = 1; } - } elsif (exists($toolhash{'gradable'})) { + } elsif ($toolhash{'gradable'}) { + $changegradable = 1; + } + if (($caller eq 'londocs') && (defined($LONCAPA::map::zombies[$residx]))) { $changegradable = 1; + if ($toolsettings{'gradable'}) { + $toolhash{'gradable'} = 1; + } } } my $putres = &Apache::lonnet::put('exttool_'.$marker,\%toolhash,$coursedom,$coursenum); @@ -1892,7 +1900,7 @@ sub do_paste_from_buffer { } if ($url=~ m{/(bulletinboard|smppg|ext\.tool)$}) { my $prefix = $1; - my $fromothercrs; + my $fromothercrs; #need to copy the db contents to a new one, unless this is a move. my %info = ( src => $url,