--- rat/lonwrapper.pm 2016/10/31 12:59:11 1.52 +++ rat/lonwrapper.pm 2016/11/29 19:53:58 1.54 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Wrapper for external and binary files as standalone resources # -# $Id: lonwrapper.pm,v 1.52 2016/10/31 12:59:11 raeburn Exp $ +# $Id: lonwrapper.pm,v 1.54 2016/11/29 19:53:58 damieng Exp $ # # Copyright Michigan State University Board of Trustees # @@ -54,10 +54,14 @@ sub wrapper { ); my $anchor; - if (($is_ext) && ($env{'form.symb'})) { - (undef,undef,my $res) = &Apache::lonnet::decode_symb($env{'form.symb'}); - if ($res =~ /(#[^#]+)$/) { - $anchor = $1; + if ($is_ext) { + if ($env{'form.symb'}) { + (undef,undef,my $res) = &Apache::lonnet::decode_symb($env{'form.symb'}); + if ($res =~ /(#[^#]+)$/) { + $anchor = $1; + } + } elsif ($env{'form.anchor'} ne '') { + $anchor = '#'.$env{'form.anchor'}; } } @@ -110,7 +114,7 @@ sub wrapper { my $script = &Apache::lonhtmlcommon::scripttag(<