--- loncom/interface/lonnavmaps.pm 2012/06/08 21:24:16 1.486
+++ loncom/interface/lonnavmaps.pm 2012/10/04 15:28:51 1.488
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavmaps.pm,v 1.486 2012/06/08 21:24:16 raeburn Exp $
+# $Id: lonnavmaps.pm,v 1.488 2012/10/04 15:28:51 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
@@ -692,7 +692,7 @@ sub getDescription {
my $maxtries = $res->maxtries($part);
my $triesString = "";
if ($tries && $maxtries) {
- $triesString = '('.&mt('[_1] of [quant,_2,try,tries] used',$tries,$maxtries).')';
+ $triesString = '('.&mt('[_1] of [quant,_2,try,tries] used',$tries,$maxtries).')';
if ($maxtries > 1 && $maxtries - $tries == 1) {
$triesString = "$triesString";
}
@@ -996,7 +996,7 @@ sub render_resource {
$nonLinkedText .= ' ('.&mt('conditionally hidden').') ';
}
if (($resource->is_practice()) && ($resource->is_raw_problem())) {
- $nonLinkedText .=' '.&mt('not graded').'';
+ $nonLinkedText .=' '.&mt('not graded').'';
}
# We're done preparing and finally ready to start the rendering
@@ -1129,21 +1129,23 @@ sub render_long_status {
$params->{'multipart'} && $part eq "0";
my $color;
+ my $info = '';
if ($resource->is_problem() || $resource->is_practice()) {
$color = $colormap{$resource->status};
if (dueInLessThan24Hours($resource, $part) ||
lastTry($resource, $part)) {
$color = $hurryUpColor;
+ $info = ' title="'.&mt('Due in less than 24 hours!').'"';
}
}
if ($resource->kind() eq "res" &&
$resource->is_raw_problem() &&
!$firstDisplayed) {
- if ($color) {$result .= ""; }
+ if ($color) {$result .= ''; }
$result .= getDescription($resource, $part);
- if ($color) {$result .= ""; }
+ if ($color) {$result .= ""; }
}
if ($resource->is_map() && &advancedUser() && $resource->randompick()) {
$result .= &mt('(randomly select [_1])', $resource->randompick());
@@ -1225,11 +1227,11 @@ sub render_parts_summary_status {
}
$return.= $td . $totalParts . ' parts: ';
foreach my $status (@statuses) {
- if ($overallstatus{$status}) {
- $return.="" . $overallstatus{$status} . ' '
- . $statusStrings{$status} . "";
- }
+ if ($overallstatus{$status}) {
+ $return.='' . $overallstatus{$status} . ' '
+ . $statusStrings{$status} . '';
+ }
}
$return.= $endtd;
return $return;
@@ -4363,19 +4365,34 @@ sub printable {
my ($self, $part) = @_;
- # Get the print open/close dates for the resource.
+ &Apache::lonnet::logthis($self->symb());
- my $start = $self->parmval("printstartdate", $part);
- my $end = $self->parmval("printenddate", $part);
# The following cases apply:
- # - No dates set: Printable.
+ # - If a start date is not set, it is replaced by the open date.
+ # - Ditto for start/open replaced by content open.
+ # - If neither start nor printdates are set the part is printable.
# - Start date set but no end date: Printable if now >= start date.
# - End date set but no start date: Printable if now <= end date.
# - both defined: printable if start <= now <= end
#
+
+ # Get the print open/close dates for the resource.
+
+ my $start = $self->parmval("printstartdate", $part);
+ my $end = $self->parmval("printenddate", $part);
+
+ if (!$start) {
+ $start = $self->parmval("opendate", $part);
+ }
+ if (!$start) {
+ $start = $self->parmval("contentopen", $part);
+ }
+
+
my $now = time();
+
my $startok = 1;
my $endok = 1;