--- loncom/interface/lonnavmaps.pm 2002/11/14 16:51:03 1.105 +++ loncom/interface/lonnavmaps.pm 2002/11/14 21:36:23 1.106 @@ -2,7 +2,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.105 2002/11/14 16:51:03 bowersj2 Exp $ +# $Id: lonnavmaps.pm,v 1.106 2002/11/14 21:36:23 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -71,7 +71,7 @@ sub handler { &Apache::loncommon::no_cache($r); $r->send_http_header; - # Create the nav map the nav map + # Create the nav map my $navmap = Apache::lonnavmaps::navmap->new( $ENV{"request.course.fn"}.".db", $ENV{"request.course.fn"}."_parms.db", 1, 1); @@ -435,11 +435,7 @@ sub handler { 'symb='.&Apache::lonnet::escape($curRes->symb()). '"'; - my $title = $curRes->title(); - if (!$title) { - $title = $curRes->src(); - $title = substr ($title, rindex($title, "/") + 1); - } + my $title = $curRes->compTitle(); my $partLabel = ""; my $newBranchText = ""; @@ -530,6 +526,7 @@ sub handler { } $r->print(" ${newBranchText}${linkopen}$icon${linkclose}\n"); + #$r->print($curRes->awarded($part)); my $curMarkerBegin = ""; my $curMarkerEnd = ""; @@ -1782,6 +1779,8 @@ These are methods that help you retrieve =over 4 +=item * B: Returns a "composite title", that is equal to $res->title() if the resource has a title, and is otherwise the last part of the URL (e.g., "problem.problem"). + =item * B: Returns true if the resource is external. =item * B: Returns the "goesto" value from the compiled nav map. (It is likely you want to use B instead.) @@ -1831,7 +1830,15 @@ sub symb { } sub title { my $self=shift; return $self->navHash("title_", 1); } sub to { my $self=shift; return $self->navHash("to_", 1); } - +sub compTitle { + my $self = shift; + my $title = $self->title(); + if (!$title) { + $title = $self->src(); + $title = substr($title, rindex($title, '/') + 1); + } + return $title; +} =pod B @@ -1991,6 +1998,10 @@ sub answerdate { } return $self->parmval("answerdate", $part); } +sub awarded { + (my $self, my $part) = @_; + return $self->parmval("awarded", $part); +} sub duedate { (my $self, my $part) = @_; return $self->parmval("duedate", $part);