--- loncom/interface/lonmenu.pm 2016/05/13 22:48:05 1.448 +++ loncom/interface/lonmenu.pm 2016/08/15 15:52:16 1.452 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.448 2016/05/13 22:48:05 raeburn Exp $ +# $Id: lonmenu.pm,v 1.452 2016/08/15 15:52:16 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -812,7 +812,11 @@ sub innerregister { if ($currdir =~ m-/$-) { $is_const_dir = 1; if ($thisdisfn eq '') { - $is_const_dir = 2; + unless (($env{'request.course.id'}) && + ($env{'course.'.$env{'request.course.id'}.'.num'} eq $uname) && + ($env{'course.'.$env{'request.course.id'}.'.domain'} eq $udom)) { + $is_const_dir = 2; + } } } else { $currdir =~ s|[^/]+$||; @@ -873,12 +877,15 @@ ENDMENUITEMS $got_prt = 1; if (($env{'user.adv'}) && ($env{'request.uri'} =~ /^\/res/) && (!$env{'request.enc'})) { - # wishlist is only available for users with access to resource-pool - # and links can only be set for resources within the resource-pool - $menuitems .= (< 'A proctor key is required', ); my $navmap = Apache::lonnavmaps::navmap->new(); - my ($missing,$tried); + my ($missing,$tried) = (0,0); if (ref($navmap)) { - $missing=0; - $tried=0; my @resources=(); if ($type eq 'map') { my ($mapurl,$rid,$resurl)=&Apache::lonnet::decode_symb($env{'request.symb'}); @@ -1667,13 +1672,7 @@ sub done_button_js { } } foreach my $res (@resources) { - if ($res->singlepart()) { - if (!$res->tries()) { - $missing++; - } else { - $tried++; - } - } else { + if (ref($res->parts()) eq 'ARRAY') { foreach my $part (@{$res->parts()}) { if (!$res->tries($part)) { $missing++; @@ -1697,6 +1696,7 @@ sub done_button_js { $lt{'miss'} .= ' '.&mt('If you confirm you are done you will be unable to submit an answer for it.').'

'; } } + $donebuttontext = &HTML::Entities::encode($donebuttontext,'<>&"'); if ($proctor) { if ($height !~ /^\d+$/) { $height = 400; @@ -1721,7 +1721,7 @@ sub done_button_js {

$lt{'preamble'} $lt{$type}

$lt{'miss'}

$lt{'proctor'}

-
+
@@ -1795,7 +1795,7 @@ END
- +