--- loncom/interface/lonnavmaps.pm 2008/01/20 01:52:47 1.410 +++ loncom/interface/lonnavmaps.pm 2008/10/10 16:07:16 1.415 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.410 2008/01/20 01:52:47 raeburn Exp $ +# $Id: lonnavmaps.pm,v 1.415 2008/10/10 16:07:16 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -198,7 +198,7 @@ sub getDescription { return &mt("Not currently assigned."); } if ($status == $res->OPEN_LATER) { - return "Open " .timeToHumanString($open,'start'); + return &mt("Open ") .timeToHumanString($open,'start'); } if ($status == $res->OPEN) { if ($due) { @@ -236,7 +236,7 @@ sub getDescription { my $maxtries = $res->maxtries($part); my $triesString = ""; if ($tries && $maxtries) { - $triesString = "($tries of $maxtries tries used)"; + $triesString = '('.&mt('[_1] of [_2] tries used',$tries,$maxtries).')'; if ($maxtries > 1 && $maxtries - $tries == 1) { $triesString = "$triesString"; } @@ -854,7 +854,10 @@ sub render_resource { if (!$resource->condval()) { $nonLinkedText .= ' ('.&mt('conditionally hidden').') '; } - + if (($resource->is_practice()) && ($resource->is_raw_problem())) { + $nonLinkedText .=' '.&mt('not graded').''; + } + # We're done preparing and finally ready to start the rendering my $result = ""; @@ -2299,17 +2302,22 @@ sub parmval { my $hashkey = $what."|||".$symb; if (defined($self->{PARM_CACHE}->{$hashkey})) { - if (wantarray) { - return @{$self->{PARM_CACHE}->{$hashkey}}; - } else { - return $self->{PARM_CACHE}->{$hashkey}->[0]; - } + if (ref($self->{PARM_CACHE}->{$hashkey}) eq 'ARRAY') { + if (defined($self->{PARM_CACHE}->{$hashkey}->[0])) { + if (wantarray) { + return @{$self->{PARM_CACHE}->{$hashkey}}; + } else { + return $self->{PARM_CACHE}->{$hashkey}->[0]; + } + } + } else { + return $self->{PARM_CACHE}->{$hashkey}; + } } - my $result = $self->parmval_real($what, $symb, $recurse); $self->{PARM_CACHE}->{$hashkey} = $result; if (wantarray) { - return @{$result}; + return @{$result}; } return $result->[0]; } @@ -3605,6 +3613,15 @@ sub is_problem { } return 0; } +sub is_raw_problem { + my $self=shift; + my $src = $self->src(); + if ($src =~ /\.(problem|exam|quiz|assess|survey|form|library|task)$/) { + return 1; + } + return 0; +} + sub contains_problem { my $self=shift; if ($self->is_page()) {