--- loncom/interface/lonnavmaps.pm 2003/06/25 18:32:06 1.212 +++ loncom/interface/lonnavmaps.pm 2003/07/14 15:01:07 1.213 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.212 2003/06/25 18:32:06 bowersj2 Exp $ +# $Id: lonnavmaps.pm,v 1.213 2003/07/14 15:01:07 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -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;