--- loncom/interface/lonnavmaps.pm 2009/12/07 03:25:16 1.440.2.1
+++ loncom/interface/lonnavmaps.pm 2010/01/26 11:33:48 1.443
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavmaps.pm,v 1.440.2.1 2009/12/07 03:25:16 raeburn Exp $
+# $Id: lonnavmaps.pm,v 1.443 2010/01/26 11:33:48 foxr 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 =
(
@@ -699,11 +700,7 @@ 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');
- } else {
- return &mt("Answer submitted, not yet graded");
- }
+ return &mt("Answer submitted, not yet graded");
}
if ($status == $res->TRIES_LEFT) {
my $tries = $res->tries($part);
@@ -723,11 +720,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');
}
}
@@ -1045,7 +1038,7 @@ sub render_communication_status {
my $location=&Apache::loncommon::lonhttpdurl("/adm/lonMisc");
if ($resource->hasDiscussion()) {
$discussionHTML = $linkopen .
- '' .
+ '' .
$linkclose;
}
@@ -1055,7 +1048,7 @@ sub render_communication_status {
if ($msgid) {
$feedbackHTML .= ' '
- . '';
+ . '';
}
}
}
@@ -1069,7 +1062,7 @@ sub render_communication_status {
$errorcount++;
$errorHTML .= ' '
- . '';
+ . '';
}
}
}
@@ -3540,7 +3533,11 @@ sub navHash {
my $self = shift;
my $param = shift;
my $id = shift;
- return $self->{NAV_MAP}->navhash($param . ($id?$self->{ID}:""));
+ my $arg = $param . ($id?$self->{ID}:"");
+ if (defined($arg)) {
+ return $self->{NAV_MAP}->navhash($arg);
+ }
+ return;
}
=pod
@@ -3783,6 +3780,35 @@ sub is_problem {
}
return 0;
}
+#
+# The has below is the set of status that are considered 'incomplete'
+#
+my %incomplete_hash =
+(
+ TRIES_LEFT() => 1,
+ OPEN() => 1,
+ ATTEMPTED() => 1
+
+ );
+#
+# Return tru if a problem is incomplete... for now incomplete means that
+# any part of the problem is incomplete.
+# Note that if the resources is not a problem, 0 is returned.
+#
+sub is_incomplete {
+ my $self = shift;
+ if ($self->is_problem()) {
+ &Apache::lonnet::logthis('is problem');
+ foreach my $part (@{$self->parts()}) {
+ &Apache::lonnet::logthis("$part status ".$self->status($part));
+ if (exists($incomplete_hash{$self->status($part)})) {
+ return 1;
+ }
+ }
+ }
+ return 0;
+
+}
sub is_raw_problem {
my $self=shift;
my $src = $self->src();