--- loncom/interface/lonnavmaps.pm 2009/08/15 18:43:52 1.435
+++ loncom/interface/lonnavmaps.pm 2010/12/30 21:32:17 1.444.2.3
@@ -1,7 +1,8 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavmaps.pm,v 1.435 2009/08/15 18:43:52 raeburn Exp $
+# $Id: lonnavmaps.pm,v 1.444.2.3 2010/12/30 21:32:17 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 =
@@ -522,6 +527,7 @@ my %colormap =
$resObj->INCORRECT => '',
$resObj->OPEN => '',
$resObj->NOTHING_SET => '',
+ $resObj->CREDIT_ATTEMPTED => '',
$resObj->ATTEMPTED => '',
$resObj->ANSWER_SUBMITTED => '',
$resObj->PARTIALLY_CORRECT => '#006600'
@@ -597,7 +603,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 +701,16 @@ 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->CREDIT_ATTEMPTED) {
+ if ($res->is_anonsurvey($part) || $res->is_survey($part)) {
+ return &mt("Credit for survey submission");
+ }
}
if ($status == $res->TRIES_LEFT) {
my $tries = $res->tries($part);
@@ -880,11 +895,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 +1048,7 @@ sub render_communication_status {
my $location=&Apache::loncommon::lonhttpdurl("/adm/lonMisc");
if ($resource->hasDiscussion()) {
$discussionHTML = $linkopen .
- '' .
+ '
' .
$linkclose;
}
@@ -1048,7 +1058,7 @@ sub render_communication_status {
if ($msgid) {
$feedbackHTML .= ' '
- . '
';
+ . '
';
}
}
}
@@ -1062,7 +1072,7 @@ sub render_communication_status {
$errorcount++;
$errorHTML .= ' '
- . '
';
+ . '
';
}
}
}
@@ -1095,7 +1105,7 @@ sub render_quick_status {
if ($icon) {
my $location=
&Apache::loncommon::lonhttpdurl("/adm/lonIcons/$icon");
- $result .= "$linkopen
$linkclose";
+ $result .= $linkopen.'
'.$linkclose;
} else {
$result .= " ";
}
@@ -1437,19 +1447,22 @@ sub render {
if ($printCloseAll && !$args->{'resource_no_folder_link'}) {
my ($link,$text);
if ($condition) {
- $link='"navmaps?condition=0&filter=&'.$queryString.
- '&here='.&escape($here).'"';
+ $link='navmaps?condition=0&filter=&'.$queryString.
+ '&here='.&escape($here);
$text='Close all folders';
} else {
- $link='"navmaps?condition=1&filter=&'.$queryString.
- '&here='.&escape($here).'"';
+ $link='navmaps?condition=1&filter=&'.$queryString.
+ '&here='.&escape($here);
$text='Open all folders';
}
+ if ($env{'form.register'}) {
+ $link .= '®ister='.$env{'form.register'};
+ }
if ($args->{'caller'} eq 'navmapsdisplay') {
&add_linkitem($args->{'linkitems'},'changefolder',
- 'location.href='.$link,$text);
+ "location.href='$link'",$text);
} else {
- $result.=''.&mt($text).'';
+ $result.= ''.&mt($text).'';
}
$result .= "\n";
}
@@ -1465,6 +1478,9 @@ sub render {
END
+ if ($env{'form.register'}) {
+ $result .= '';
+ }
if ($args->{'sort'} eq 'discussion') {
my $totdisc = 0;
my $haveDisc = '';
@@ -1486,26 +1502,22 @@ END
$result.='';
}
-
if ($args->{'caller'} eq 'navmapsdisplay') {
$result .= '
'. - &Apache::loncommon::help_open_menu('Navigation Screen','Navigation_Screen',undef,'RAT').' | '; - if ($env{'environment.remotenavmap'} ne 'on') { - $result .= ''; - } else { - $result .= ' | |||||
".mt('Tools:')." | "; - $result.=&show_linkitems_toolbar($args->{'linkitems'}); + &Apache::loncommon::help_open_menu('Navigation Screen','Navigation_Screen',undef,'RAT').''. + ' | '.&mt('Tools:').' | '. + &show_linkitems_toolbar($args->{'linkitems'}); if ($args->{'sort_html'}) { if ($env{'environment.remotenavmap'} ne 'on') { - $result.=''. - ' | '.$args->{'sort_html'}.' | ||
'. - $args->{'sort_html'}.' | '. + ' | '.$args->{'sort_html'}.' | '; + } else { + $result .= '||||
'. + $args->{'sort_html'}.' |