--- loncom/homework/structuretags.pm 2023/11/28 04:48:15 1.582 +++ loncom/homework/structuretags.pm 2024/01/13 12:07:13 1.583 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.582 2023/11/28 04:48:15 raeburn Exp $ +# $Id: structuretags.pm,v 1.583 2024/01/13 12:07:13 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1439,20 +1439,25 @@ sub needs_linkprot_passback { $lti_in_use = $domlti{$itemnum}; } my ($state,$others,$listed,$scope,$protect,$display,$target,$exit) = split(/,/,$deeplink); - my $passback; - if ($scope eq 'resource') { + my ($passback,$pbscope); + if ($scope eq 'res') { if ($deeplink_symb eq $symb) { $passback = 1; + $pbscope = 'resource'; } } elsif ($scope eq 'map') { if (&Apache::lonnet::clutter($deeplink_map) eq $map) { $passback = 1; + $pbscope = 'nonrec'; + } + } elsif ($scope eq 'rec') { + my @recurseup = &get_map_hierarchy($map,$env{'request.course.id'}); + if (grep(/^\Q$deeplink_map\E$/,@recurseup)) { + $passback = 1; + $pbscope = 'map'; } - } elsif ($scope eq 'recurse') { -#FIXME check if $deeplink_map contains $map - $passback = 1; } - return ($passback,$scope,$deeplink_map,$deeplink_symb,$crsdef,$itemnum,$lti_in_use); + return ($passback,$pbscope,$deeplink_map,$deeplink_symb,$crsdef,$itemnum,$lti_in_use); } } }