--- loncom/interface/lonnavmaps.pm 2017/12/18 23:13:53 1.537
+++ loncom/interface/lonnavmaps.pm 2018/01/15 00:51:42 1.540
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavmaps.pm,v 1.537 2017/12/18 23:13:53 raeburn Exp $
+# $Id: lonnavmaps.pm,v 1.540 2018/01/15 00:51:42 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -658,6 +658,9 @@ sub getDescription {
} elsif ($slot_status == $res->RESERVABLE) {
$slotmsg = &mt('Reservable, reservations close [_1]',
timeToHumanString($slot_time,'end'));
+ } elsif ($slot_status == $res->NEEDS_CHECKIN) {
+ $slotmsg = &mt('Reserved, check-in needed - ends [_1]',
+ timeToHumanString($slot_time,'end'));
} elsif ($slot_status == $res->RESERVABLE_LATER) {
$slotmsg = &mt('Reservable, reservations open [_1]',
timeToHumanString($slot_time,'start'));
@@ -699,7 +702,17 @@ sub getDescription {
}
if (($status == $res->ANSWER_OPEN || $status == $res->PARTIALLY_CORRECT)
&& $res->handgrade($part) ne 'yes') {
- return &Apache::lonhtmlcommon::direct_parm_link(&mt("Answer available"),$res->symb(),'answerdate,duedate',$part);
+ my $msg = &mt('Answer available');
+ my $parmlist = 'answerdate,duedate';
+ if (($res->is_tool) && ($res->is_gradable())) {
+ if (($status == $res->PARTIALLY_CORRECT) && ($res->parmval('retrypartial',$part))) {
+ $msg = &mt('Grade received');
+ $parmlist = 'retrypartial';
+ } else {
+ $msg = &mt('Grade available');
+ }
+ }
+ return &Apache::lonhtmlcommon::direct_parm_link($msg,$res->symb(),$parmlist,$part);
}
if ($status == $res->EXCUSED) {
return &mt("Excused by instructor");
@@ -953,7 +966,28 @@ sub render_resource {
# links to open and close the folder
my $whitespace = $location.'/whitespace_21.gif';
- my $linkopen = "
"."";
+ my $linkopen = "
";
+ my $nomodal;
+ if (($params->{'modalLink'}) && (!$resource->is_sequence())) {
+ if ($link =~m{^(?:|/adm/wrapper)/ext/([^#]+)}) {
+ my $exturl = $1;
+ if (($ENV{'SERVER_PORT'} == 443) && ($exturl !~ /^https:/)) {
+ $nomodal = 1;
+ }
+ } elsif (($link eq "/public/$LONCAPA::match_domain/$LONCAPA::match_courseid/syllabus") &&
+ ($env{'request.course.id'}) && ($ENV{'SERVER_PORT'} == 443) &&
+ ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) {
+ $nomodal = 1;
+ }
+ my $esclink = &js_escape($link);
+ if ($nomodal) {
+ $linkopen .= "";
+ } else {
+ $linkopen .= "";
+ }
+ } else {
+ $linkopen .= "";
+ }
my $linkclose = "";
# Default icon: unknown page
@@ -1081,10 +1115,19 @@ sub render_resource {
}
if (!$params->{'resource_nolink'} && !$resource->is_sequence() && !$resource->is_empty_sequence) {
- $result .= "$curMarkerBegin$title$partLabel$curMarkerEnd$editmapLink$nonLinkedText";
- } else {
- $result .= "$curMarkerBegin$linkopen$title$partLabel$curMarkerEnd$editmapLink$nonLinkedText";
+ $linkclose = '';
+ if ($params->{'modalLink'}) {
+ my $esclink = &js_escape($link);
+ if ($nomodal) {
+ $linkopen = "";
+ } else {
+ $linkopen = "";
+ }
+ } else {
+ $linkopen = "";
+ }
}
+ $result .= "$curMarkerBegin$linkopen$title$partLabel$linkclose$curMarkerEnd$editmapLink$nonLinkedText";
return $result;
}
@@ -1722,6 +1765,11 @@ END
$cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
}
+ my $inhibitmenu;
+ if ($args->{'modalLink'}) {
+ $inhibitmenu = '&inhibitmenu=yes';
+ }
+
while (1) {
if ($args->{'sort'}) {
$curRes = shift(@resources);
@@ -1875,7 +1923,7 @@ END
} else {
$args->{"resourceLink"} = $src.
($srcHasQuestion?'&':'?') .
- 'symb=' . &escape($symb).$anchor;
+ 'symb=' . &escape($symb).$inhibitmenu.$anchor;
}
}
# Now, we've decided what parts to show. Loop through them and
@@ -5836,7 +5884,7 @@ sub check_for_slot {
($checkedin,$checkedinslot) = $self->checkedin();
unless ((grep(/^\Q$checkedin\E/,@proctors)) &&
($checkedinslot eq $slot_name)) {
- return (NEEDS_CHECKIN,undef,$slot_name);
+ return (NEEDS_CHECKIN,$end,$slot_name);
}
}
return (RESERVED,$end,$slot_name);