--- loncom/interface/lonnavmaps.pm 2003/05/27 21:00:23 1.193 +++ loncom/interface/lonnavmaps.pm 2003/06/12 13:20:27 1.199 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.193 2003/05/27 21:00:23 bowersj2 Exp $ +# $Id: lonnavmaps.pm,v 1.199 2003/06/12 13:20:27 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -966,6 +966,10 @@ sub render_communication_status { } } + if ($params->{'multipart'} && $part != '0') { + $discussionHTML = $feedbackHTML = $errorHTML = ''; + } + return "$discussionHTML$feedbackHTML$errorHTML "; } @@ -1021,8 +1025,6 @@ sub render_long_status { $result .= '(randomly select ' . $resource->randompick() .')'; } - $result .= " \n"; - return $result; } @@ -1413,8 +1415,13 @@ sub render { @parts = ($parts[0]); $args->{'condensed'} = 1; } - } + # Multipart problem with one part: always "condense" (happens + # to match the desirable behavior) + if ($curRes->countParts() == 1) { + @parts = ($parts[0]); + $args->{'condensed'} = 1; + } } } @@ -1779,6 +1786,16 @@ object for that resource. This method, o (as in the resource object) is the only proper way to obtain a resource object. +=item * B(symb): + +Based on the symb of the resource, get a resource object for that +resource. This is one of the proper ways to get a resource object. + +=item * B(map_pc): + +Based on the map_pc of the resource, get a resource object for +the given map. This is one of the proper ways to get a resource object. + =cut # The strategy here is to cache the resource objects, and only construct them @@ -1809,6 +1826,14 @@ sub getBySymb { return $self->getById($map->map_pc() . '.' . $id); } +sub getByMapPc { + my $self = shift; + my $map_pc = shift; + my $map_id = $self->{NAV_HASH}->{'map_id_' . $map_pc}; + $map_id = $self->{NAV_HASH}->{'ids_' . $map_id}; + return $self->getById($map_id); +} + =pod =item * B():