--- loncom/interface/lonnavmaps.pm 2003/01/31 22:46:50 1.133 +++ loncom/interface/lonnavmaps.pm 2003/02/04 16:14:27 1.134 @@ -2,7 +2,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.133 2003/01/31 22:46:50 bowersj2 Exp $ +# $Id: lonnavmaps.pm,v 1.134 2003/02/04 16:14:27 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -717,6 +717,7 @@ sub real_handler { $navmap->untieHashes(); $r->print(""); + $r->rflush(); return OK; } @@ -1083,16 +1084,10 @@ sub render_resource { my $nonLinkedText = ''; # stuff after resource title not in link - my $it = $params->{'iterator'}; + my $link = $params->{"resourceLink"}; + my $src = $resource->src(); + my $it = $params->{"iterator"}; my $filter = $it->{FILTER}; - my $stack = $it->getStack(); - my $src = getLinkForResource($stack); - - my $srcHasQuestion = $src =~ /\?/; - my $link = $src. - ($srcHasQuestion?'&':'?') . - 'symb=' . &Apache::lonnet::escape($resource->symb()). - '"'; my $title = $resource->compTitle(); if ($src =~ /^\/uploaded\//) { @@ -1184,14 +1179,51 @@ sub render_resource { $nonLinkedText .= ' (' . $resource->countParts() . ' parts)'; } - $result .= " $curMarkerBegin$title$partLabel$curMarkerEnd $nonLinkedText"; + $result .= " $curMarkerBegin$title$partLabel$curMarkerEnd $nonLinkedText"; return $result; } sub render_communication_status { my ($resource, $part, $params) = @_; - return "comm_status"; + my $discussionHTML = ""; my $feedbackHTML = ""; my $errorHTML = ""; + + my $link = $params->{"resourceLink"}; + my $linkopen = ""; + my $linkclose = ""; + + if ($resource->hasDiscussion()) { + $discussionHTML = $linkopen . + '' . + $linkclose; + } + + if ($resource->getFeedback()) { + my $feedback = $resource->getFeedback(); + foreach (split(/\,/, $feedback)) { + if ($_) { + $feedbackHTML .= ' ' + . ''; + } + } + } + + if ($resource->getErrors()) { + my $errors = $resource->getErrors(); + foreach (split(/,/, $errors)) { + if ($_) { + $errorHTML .= ' ' + . ''; + } + } + } + + return "$discussionHTML$feedbackHTML$errorHTML "; + } sub render_quick_status { my ($resource, $part, $params) = @_; @@ -1380,10 +1412,20 @@ sub render { my $backgroundColor = $backgroundColors[$rownum % scalar(@backgroundColors)]; $result .= " \n"; + + # Set up some data about the parts that the cols might want + my $filter = $it->{FILTER}; + my $stack = $it->getStack(); + my $src = getLinkForResource($stack); + + my $srcHasQuestion = $src =~ /\?/; + $args->{"resourceLink"} = $src. + ($srcHasQuestion?'&':'?') . + 'symb=' . &Apache::lonnet::escape($curRes->symb()). + '"'; # Now, display each column. foreach my $col (@$cols) { - $result .= " "; # If this is the first column and it's time to print # the anchor, do so @@ -1401,7 +1443,6 @@ sub render { $result .= &{$preparedColumns[$col]}($curRes, $part, $args); } - $result .= "\n"; } $result .= " \n"; @@ -1411,6 +1452,11 @@ sub render { $curRes = $it->next(); } + # Print out the part that jumps to #curloc if it exists + if ($args->{"displayedJumpMarker"}) { + $result .= "\n"; + } + $result .= ""; return $result;