--- loncom/interface/lonnavmaps.pm 2007/05/23 20:46:29 1.399 +++ loncom/interface/lonnavmaps.pm 2007/08/29 00:55:37 1.400 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.399 2007/05/23 20:46:29 albertel Exp $ +# $Id: lonnavmaps.pm,v 1.400 2007/08/29 00:55:37 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -991,7 +991,10 @@ sub render_long_status { if ($color) {$result .= ""; } } if ($resource->is_map() && advancedUser() && $resource->randompick()) { - $result .= '(randomly select ' . $resource->randompick() .')'; + $result .= &mt('(randomly select [_1])', $resource->randompick()); + } + if ($resource->is_map() && &advancedUser() && $resource->randomorder()) { + $result .= &mt('(randomly ordered)'); } # Debugging code @@ -2511,6 +2514,10 @@ sub retrieveResources { my @resources = (); + if (&$filterFunc($map)) { + push(@resources, $map); + } + # Run down the iterator and collect the resources. my $curRes; @@ -2520,7 +2527,7 @@ sub retrieveResources { next; } - push @resources, $curRes; + push(@resources, $curRes); if ($bailout) { return @resources; @@ -3364,8 +3371,13 @@ false. =item * B: -Returns true for a map if the randompick feature is being used on the -map. (?) +Returns the number of randomly picked items for a map if the randompick +feature is being used on the map. + +=item * B: + +Returns true for a map if the randomorder feature is being used on the +map. =item * B: @@ -3397,6 +3409,10 @@ sub randompick { my $self = shift; return $self->parmval('randompick'); } +sub randomorder { + my $self = shift; + return ($self->parmval('randomorder') =~ /^yes$/i); +} sub link { my $self=shift; if ($self->encrypted()) { return &Apache::lonenc::encrypted($self->src); }