[LON-CAPA-cvs] cvs: loncom /interface lonnavmaps.pm
albertel
lon-capa-cvs-allow@mail.lon-capa.org
Fri, 05 Oct 2007 18:48:21 -0000
albertel Fri Oct 5 14:48:21 2007 EDT
Modified files:
/loncom/interface lonnavmaps.pm
Log:
- BUG#5468 - show duedate for practice problems on nav screen
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.401 loncom/interface/lonnavmaps.pm:1.402
--- loncom/interface/lonnavmaps.pm:1.401 Fri Aug 31 20:41:42 2007
+++ loncom/interface/lonnavmaps.pm Fri Oct 5 14:48:20 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavmaps.pm,v 1.401 2007/09/01 00:41:42 albertel Exp $
+# $Id: lonnavmaps.pm,v 1.402 2007/10/05 18:48:20 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -198,7 +198,11 @@
}
if ($status == $res->OPEN) {
if ($res->duedate($part)) {
- return &mt("Due")." " .timeToHumanString($res->duedate($part),'end');
+ if ($res->is_practice()) {
+ return &mt("Closes ")." " .timeToHumanString($res->duedate($part),'start');
+ } else {
+ return &mt("Due")." " .timeToHumanString($res->duedate($part),'end');
+ }
} else {
return &mt("Open, no due date");
}
@@ -207,7 +211,11 @@
return &mt("Answer open")." " . timeToHumanString($res->answerdate($part),'start');
}
if ($status == $res->PAST_DUE_NO_ANSWER) {
- return &mt("Was due")." " . timeToHumanString($res->duedate($part),'end');
+ if ($res->is_practice()) {
+ return &mt("Closed")." " . timeToHumanString($res->duedate($part),'start');
+ } else {
+ return &mt("Was due")." " . timeToHumanString($res->duedate($part),'end');
+ }
}
if (($status == $res->ANSWER_OPEN || $status == $res->PARTIALLY_CORRECT)
&& $res->handgrade($part) ne 'yes') {
@@ -982,7 +990,7 @@
$params->{'multipart'} && $part eq "0";
my $color;
- if ($resource->is_problem()) {
+ if ($resource->is_problem() || $resource->is_practice()) {
$color = $colormap{$resource->status};
if (dueInLessThan24Hours($resource, $part) ||
@@ -992,13 +1000,13 @@
}
if ($resource->kind() eq "res" &&
- $resource->is_problem() &&
+ ($resource->is_problem() || $resource->is_practice()) &&
!$firstDisplayed) {
if ($color) {$result .= "<font color=\"$color\"><b>"; }
$result .= getDescription($resource, $part);
if ($color) {$result .= "</b></font>"; }
}
- if ($resource->is_map() && advancedUser() && $resource->randompick()) {
+ if ($resource->is_map() && &advancedUser() && $resource->randompick()) {
$result .= &mt('(randomly select [_1])', $resource->randompick());
}
if ($resource->is_map() && &advancedUser() && $resource->randomorder()) {