--- loncom/interface/lonnavmaps.pm 2009/09/23 14:30:45 1.423.4.2
+++ loncom/interface/lonnavmaps.pm 2010/05/18 20:30:08 1.444.2.1
@@ -1,7 +1,8 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavmaps.pm,v 1.423.4.2 2009/09/23 14:30:45 gci Exp $
+# $Id: lonnavmaps.pm,v 1.444.2.1 2010/05/18 20:30:08 raeburn Exp $
+
#
# Copyright Michigan State University Board of Trustees
#
@@ -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,8 +700,8 @@ sub getDescription {
return &mt("Excused by instructor");
}
if ($status == $res->ATTEMPTED) {
- if ($res->src() eq '/res/gci/gci/internal/submission.problem') {
- return &mt('Question(s) submitted for review');
+ if ($res->is_anonsurvey($part) || $res->is_survey($part)) {
+ return &mt("Survey submission recorded");
} else {
return &mt("Answer submitted, not yet graded");
}
@@ -719,11 +724,7 @@ sub getDescription {
}
}
if ($status == $res->ANSWER_SUBMITTED) {
- if ($res->src() eq '/res/gci/gci/internal/submission.problem') {
- return &mt('Question(s) submitted for review');
- } else {
- return &mt('Answer submitted');
- }
+ return &mt('Answer submitted');
}
}
@@ -888,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"};
@@ -905,35 +901,32 @@ sub render_resource {
my $location=&Apache::loncommon::lonhttpdurl("/adm/lonIcons");
# If this is a new branch, label it so
if ($params->{'isNewBranch'}) {
- $newBranchText = '';
+ $newBranchText = "
";
}
# links to open and close the folder
-
- my $linkopen = "";
-
-
+ my $whitespace = $location.'/whitespace_21.gif';
+ my $linkopen = "
"."";
my $linkclose = "";
# Default icon: unknown page
- my $icon = "
";
+ my $icon = "
";
if ($resource->is_problem()) {
if ($part eq '0' || $params->{'condensed'}) {
- $icon = '
';
+ $icon .='" />';
} else {
$icon = $params->{'indentString'};
}
} else {
- $icon = "
";
+ $icon = "
";
}
# Display the correct map icon to open or shut map
@@ -943,15 +936,15 @@ sub render_resource {
if ($it->{CONDITION}) {
$nowOpen = !$nowOpen;
}
-
+
my $folderType = $resource->is_sequence() ? 'folder' : 'page';
my $title=$resource->title;
- $title=~s/\"/\"/g;
+ $title=~s/\"/\&qout;/g;
if (!$params->{'resource_no_folder_link'}) {
$icon = "navmap.$folderType." . ($nowOpen ? 'closed' : 'open') . '.gif';
- $icon = "
";
-
+ $icon = "
"
+ ."
";
$linkopen = "{'url'} . '?' .
$params->{'queryString'} . '&filter=';
$linkopen .= ($nowOpen xor $it->{CONDITION}) ?
@@ -966,10 +959,8 @@ sub render_resource {
} else {
# Don't allow users to manipulate folder
- $icon = "navmap.$folderType." . ($nowOpen ? 'closed' : 'open') .
- '.nomanip.gif';
- $icon = "
";
+ $icon = "navmap.$folderType." . ($nowOpen ? 'closed' : 'open') . '.gif';
+ $icon = "
"."
";
$linkopen = "";
$linkclose = "";
@@ -985,10 +976,11 @@ sub render_resource {
if (($resource->is_practice()) && ($resource->is_raw_problem())) {
$nonLinkedText .=' '.&mt('not graded').'';
}
-
- # We're done preparing and finally ready to start the rendering
- my $result = "
'.&mt('Tools:').' | '; + $result.=&show_linkitems_toolbar($args->{'linkitems'}); if ($args->{'sort_html'}) { if ($env{'environment.remotenavmap'} ne 'on') { $result.=''. @@ -1525,31 +1520,33 @@ END $result.=$args->{'sort_html'}; } - $result .= " |