--- loncom/interface/lonnavmaps.pm 2009/03/27 11:33:19 1.433
+++ loncom/interface/lonnavmaps.pm 2010/02/28 22:36:38 1.444
@@ -1,7 +1,8 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavmaps.pm,v 1.433 2009/03/27 11:33:19 bisitz Exp $
+# $Id: lonnavmaps.pm,v 1.444 2010/02/28 22:36:38 raeburn Exp $
+
#
# Copyright Michigan State University Board of Trustees
#
@@ -31,7 +32,7 @@
=head1 NAME
-Apache::lonnavmaps.pm
+Apache::lonnavmaps - Subroutines to handle and render the navigation
=head1 SYNOPSIS
@@ -477,6 +478,7 @@ use Apache::loncommon();
use Apache::lonenc();
use Apache::lonlocal;
use Apache::lonnet;
+
use POSIX qw (floor strftime);
use Time::HiRes qw( gettimeofday tv_interval );
use LONCAPA;
@@ -491,7 +493,7 @@ sub NOTHING { return 3; }
my $resObj = "Apache::lonnavmaps::resource";
-# Keep these mappings in sync with lonquickgrades, which uses the colors
+# Keep these mappings in sync with lonquickgrades, which usesthe colors
# instead of the icons.
my %statusIconMap =
(
@@ -504,10 +506,13 @@ my %statusIconMap =
$resObj->ERROR => ''
);
-my %iconAltTags =
- ( 'navmap.correct.gif' => 'Correct',
- 'navmap.wrong.gif' => 'Incorrect',
- 'navmap.open.gif' => 'Open' );
+my %iconAltTags = #texthash does not work here
+ ( 'navmap.correct.gif' => 'Correct',
+ 'navmap.wrong.gif' => 'Incorrect',
+ 'navmap.open.gif' => 'Open',
+ 'navmap.partial.gif' => 'Partially Correct',
+ 'navmap.ellipsis.gif' => 'Attempted',
+ );
# Defines a status->color mapping, null string means don't color
my %colormap =
@@ -597,7 +602,7 @@ sub getLinkForResource {
my ($map,$id,$src)=&Apache::lonnet::decode_symb($res->symb());
if ($map=~/\.page$/) {
my $url=&Apache::lonnet::clutter($map);
- $anchor=&escape($src->shown_symb());
+ $anchor=&escape($res->shown_symb());
return ($url,$res->shown_symb(),$anchor);
}
}
@@ -695,7 +700,11 @@ sub getDescription {
return &mt("Excused by instructor");
}
if ($status == $res->ATTEMPTED) {
- return &mt("Answer submitted, not yet graded");
+ if ($res->is_anonsurvey($part) || $res->is_survey($part)) {
+ return &mt("Survey submission recorded");
+ } else {
+ return &mt("Answer submitted, not yet graded");
+ }
}
if ($status == $res->TRIES_LEFT) {
my $tries = $res->tries($part);
@@ -880,11 +889,6 @@ sub render_resource {
my $link = $params->{"resourceLink"};
# The URL part is not escaped at this point, but the symb is...
- # The stuff to the left of the ? must have ' replaced by \' since
- # it will be quoted with ' in the href.
-
- my ($left,$right) = split(/\?/, $link);
- $link = $left.'?'.$right;
my $src = $resource->src();
my $it = $params->{"iterator"};
@@ -1038,7 +1042,7 @@ sub render_communication_status {
my $location=&Apache::loncommon::lonhttpdurl("/adm/lonMisc");
if ($resource->hasDiscussion()) {
$discussionHTML = $linkopen .
- '' .
+ '
' .
$linkclose;
}
@@ -1048,7 +1052,7 @@ sub render_communication_status {
if ($msgid) {
$feedbackHTML .= ' '
- . '
';
+ . '
';
}
}
}
@@ -1062,7 +1066,7 @@ sub render_communication_status {
$errorcount++;
$errorHTML .= ' '
- . '
';
+ . '
';
}
}
}
@@ -1095,7 +1099,7 @@ sub render_quick_status {
if ($icon) {
my $location=
&Apache::loncommon::lonhttpdurl("/adm/lonIcons/$icon");
- $result .= "$linkopen
$linkclose";
+ $result .= $linkopen.'
'.$linkclose;
} else {
$result .= " ";
}
@@ -1419,15 +1423,15 @@ sub render {
my $location=&Apache::loncommon::lonhttpdurl("/adm/lonMisc");
if ($navmap->{LAST_CHECK}) {
$result .=
- '
'.&mt('New discussion since').' '.
+ '
'.&mt('New discussion since').' '.
strftime("%A, %b %e at %I:%M %P", localtime($navmap->{LAST_CHECK})).
'
'.
+ ' '.&mt('New message (click to open)').'
'. '