--- loncom/interface/lonnavmaps.pm 2003/06/25 18:27:18 1.211 +++ loncom/interface/lonnavmaps.pm 2003/07/14 19:13:38 1.214 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.211 2003/06/25 18:27:18 bowersj2 Exp $ +# $Id: lonnavmaps.pm,v 1.214 2003/07/14 19:13:38 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1021,7 +1021,7 @@ sub render_long_status { $params->{'multipart'} && $part eq "0"; my $color; - if ($resource->is_problem() && ($resource->countParts() <= 1) ) { + if ($resource->is_problem()) { $color = $colormap{$resource->status}; if (dueInLessThen24Hours($resource, $part) || @@ -1041,6 +1041,10 @@ sub render_long_status { $result .= '(randomly select ' . $resource->randompick() .')'; } + # Debugging code + #$result .= " " . $resource->awarded($part) . '/' . $resource->weight($part) . + # ' - Part: ' . $part; + $result .= "\n"; return $result; @@ -2077,8 +2081,13 @@ sub retrieveResources { $map = $self->getResourceByUrl($map); } + # If nothing was passed, assume top-level map + if (!$map) { + $map = $self->getById('0.0'); + } + # Check the map's validity. - if (!$map || !$map->is_map()) { + if (!$map->is_map()) { # Oh, to throw an exception.... how I'd love that! return (); } @@ -2922,7 +2931,14 @@ sub symb { $self->navHash('map_id_'.$first)) . '___' . $second . '___' . $symbSrc; } -sub title { my $self=shift; return $self->navHash("title_", 1); } +sub title { + my $self=shift; + if ($self->{ID} eq '0.0') { + # If this is the top-level map, return the title of the course + # since this map can not be titled otherwise. + return $ENV{'course.'.$ENV{'request.course.id'}.'.description'}; + } + return $self->navHash("title_", 1); } sub to { my $self=shift; return $self->navHash("to_", 1); } sub compTitle { my $self = shift; @@ -3352,7 +3368,7 @@ sub responseType { my $part = shift; $self->extractParts(); - return $self->{RESPONSE_TYPE}->{$part}; + return $self->{RESPONSE_TYPES}->{$part}; } sub responseIds {