--- loncom/lonnet/perl/lonnet.pm 2017/12/18 23:14:03 1.1362 +++ loncom/lonnet/perl/lonnet.pm 2017/12/29 23:51:50 1.1365 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.1362 2017/12/18 23:14:03 raeburn Exp $ +# $Id: lonnet.pm,v 1.1365 2017/12/29 23:51:50 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -5229,6 +5229,9 @@ sub set_first_access { 'course.'.$courseid.'.timerinterval.'.$res => $interval, } ); + if (($cachedtime) && (abs($start-$cachedtime) < 5)) { + $cachedtimes{"$courseid\0$res"} = $start; + } } return $putres; } @@ -11729,7 +11732,15 @@ sub metadata { # uploaded map containing the tool. The value is retrieved via # &EXT(), if a valid symb is available. Otherwise the value of # gradable in the exttool_$marker.db file for the tool instance -# is retrived via &get(). +# is retrieved via &get(). +# +# When lonuserstate::traceroute() calls lonnet::EXT() for +# hiddenresource and encrypturl (during course initialization) +# the map-level parameter for resource.0.gradable included in the +# uploaded map containing the tool will not yet have been stored +# in the user_course_parms.db file for the user's session, so in +# this case fall back to retrieving gradable status from the +# exttool_$marker.db file. # # In order to avoid an infinite loop, &metadata() will return # before a call to &EXT(), if the uri is for an external tool @@ -11744,7 +11755,7 @@ sub metadata { my ($checked,$use_passback); if ($toolsymb ne '') { (undef,undef,my $tooluri) = &decode_symb($toolsymb); - if ($tooluri eq $uri) { + if (($tooluri eq $uri) && (&EXT('resource.0.gradable',$toolsymb))) { $checked = 1; if (&EXT('resource.0.gradable',$toolsymb) =~ /^yes$/i) { $use_passback = 1; @@ -11754,7 +11765,7 @@ sub metadata { unless ($checked) { my ($ignore,$cdom,$cnum,$marker) = split(m{/},$uri); $marker=~s/\D//g; - if (!$marker) { + if ($marker) { my %toolsettings=&get('exttool_'.$marker,['gradable'],$cdom,$cnum); $use_passback = $toolsettings{'gradable'}; }