--- loncom/interface/lonnavmaps.pm 2009/12/27 01:31:05 1.441
+++ loncom/interface/lonnavmaps.pm 2010/08/15 00:03:25 1.444.2.2
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavmaps.pm,v 1.441 2009/12/27 01:31:05 raeburn Exp $
+# $Id: lonnavmaps.pm,v 1.444.2.2 2010/08/15 00:03:25 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
@@ -478,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;
@@ -492,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 =
(
@@ -526,6 +527,7 @@ my %colormap =
$resObj->INCORRECT => '',
$resObj->OPEN => '',
$resObj->NOTHING_SET => '',
+ $resObj->CREDIT_ATTEMPTED => '',
$resObj->ATTEMPTED => '',
$resObj->ANSWER_SUBMITTED => '',
$resObj->PARTIALLY_CORRECT => '#006600'
@@ -699,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);
@@ -1037,7 +1048,7 @@ sub render_communication_status {
my $location=&Apache::loncommon::lonhttpdurl("/adm/lonMisc");
if ($resource->hasDiscussion()) {
$discussionHTML = $linkopen .
- '' .
+ '
' .
$linkclose;
}
@@ -1047,7 +1058,7 @@ sub render_communication_status {
if ($msgid) {
$feedbackHTML .= ' '
- . '
';
+ . '
';
}
}
}
@@ -1061,7 +1072,7 @@ sub render_communication_status {
$errorcount++;
$errorHTML .= ' '
- . '
';
+ . '
';
}
}
}
@@ -1436,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";
}
@@ -1464,6 +1478,9 @@ sub render {
END
+ if ($env{'form.register'}) {
+ $result .= '';
+ }
if ($args->{'sort'} eq 'discussion') {
my $totdisc = 0;
my $haveDisc = '';
@@ -1485,7 +1502,6 @@ END
$result.='';
}
-
if ($args->{'caller'} eq 'navmapsdisplay') {
$result .= '
'. &Apache::loncommon::help_open_menu('Navigation Screen','Navigation_Screen',undef,'RAT').' | '; @@ -1494,7 +1510,7 @@ END } else { $result .= '|||
".mt('Tools:')." | "; + $result.=''.&mt('Tools:').' | '; $result.=&show_linkitems_toolbar($args->{'linkitems'}); if ($args->{'sort_html'}) { if ($env{'environment.remotenavmap'} ne 'on') { @@ -1755,7 +1771,7 @@ END if (defined($anchor)) { $anchor='#'.$anchor; } my $srcHasQuestion = $src =~ /\?/; $args->{"resourceLink"} = $src. - ($srcHasQuestion?'&':'?') . + ($srcHasQuestion?'&':'?') . 'symb=' . &escape($symb).$anchor; } # Now, we've decided what parts to show. Loop through them and @@ -1817,12 +1833,11 @@ END # it's quite likely this might fix other browsers, too, and # certainly won't hurt anything. if ($displayedJumpMarker) { - $result .= " -"; +"); } $result.=&Apache::loncommon::end_data_table(); @@ -1842,71 +1857,38 @@ sub add_linkitem { $$linkitems{$name}{'text'}=&mt($text); } -sub show_linkitems { - my ($linkitems)=@_; - my @linkorder = ("blank","launchnav","closenav","firsthomework", - "everything","uncompleted","changefolder","clearbubbles"); - - my $result .= (<
- '."\n
'."\n".
+ ''."\n".
+ ' | '."\n";
-
+ $result .= '
| '."\n";
return $result;
}
@@ -2377,7 +2359,7 @@ resource object.
Based on the symb of the resource, get a resource object for that
resource. This is one of the proper ways to get a resource object.
-=item * B