--- loncom/interface/lonnavmaps.pm 2003/01/13 22:41:20 1.126 +++ loncom/interface/lonnavmaps.pm 2003/03/20 22:30:38 1.129.2.3 @@ -2,7 +2,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.126 2003/01/13 22:41:20 bowersj2 Exp $ +# $Id: lonnavmaps.pm,v 1.129.2.3 2003/03/20 22:30:38 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -273,12 +273,6 @@ sub real_handler { $mapIterator->next(); # discard the first BEGIN_MAP my $curRes = $mapIterator->next(); my $counter = 0; -<<<<<<< lonnavmaps.pm - - # We only need to do this if we need to open the maps to show the - # current position - while ($depth > 0 && !$ENV{'form.alreadyHere'}) { -======= my $foundJump = ($jumpType == $NOTHING); # look for jump point if we have one my $looped = 0; @@ -286,7 +280,6 @@ sub real_handler { # current position. This will change the counter so we can't count # for the jump marker with this loop. while ($depth > 0 && !$ENV{'form.alreadyHere'}) { ->>>>>>> 1.122 if ($curRes == $mapIterator->BEGIN_MAP()) { $depth++; } if ($curRes == $mapIterator->END_MAP()) { $depth--; } @@ -305,9 +298,6 @@ sub real_handler { } $ENV{'form.alreadyHere'} = 1; } -<<<<<<< lonnavmaps.pm - -======= $looped = 1; $curRes = $mapIterator->next(); @@ -337,7 +327,6 @@ sub real_handler { $foundJump = 1; } ->>>>>>> 1.122 $curRes = $mapIterator->next(); } @@ -414,13 +403,13 @@ sub real_handler { # just display first if (!$curRes->opendate("0")) { # no parts are open, display as one part - @parts = ("0"); + @parts = (); $condensed = 1; } else { # Otherwise, only display part 0 if we want to # attach feedback or email information to it if ($curRes->hasDiscussion() || $curRes->getFeedback()) { - shift @parts; + #shift @parts; } else { # Now, we decide whether to condense the # parts due to similarity @@ -452,23 +441,19 @@ sub real_handler { if (($statusAllSame && defined($condenseStatuses{$status})) || ($dueAllSame && $status == $curRes->OPEN && $statusAllSame)|| ($openAllSame && $status == $curRes->OPEN_LATER && $statusAllSame) ){ - @parts = ($parts[1]); + @parts = (); $condensed = 1; } } } } - } else { - $parts[0] = "0"; # this is to get past foreach loop below - # you can consider a non-problem resource as a resource - # with only one part without loss, and it simplifies the looping } # Is it a multipart problem with a single part, now in # @parts with "0" filtered out? If so, 'forget' it's a multi-part # problem and treat it like a single-part problem. - if ( scalar(@parts) == 1 ) { + if ( scalar(@parts) == 0 ) { $multipart = 0; } @@ -477,13 +462,16 @@ sub real_handler { # status, but if it's multipart, we're lost, since we can't # retreive the metadata to count the parts if ($curRes->{RESOURCE_ERROR}) { - @parts = ("0"); + @parts = (); } # Step Two: Print the actual data. # For each part we intend to display... - foreach my $part (@parts) { + foreach my $part ('', @parts) { + if ($part eq '0') { + next; + } my $nonLinkedText = ""; # unlinked stuff after title @@ -518,7 +506,7 @@ sub real_handler { my $icon = ""; if ($curRes->is_problem()) { - if ($part eq "0" || $condensed) { + if ($part eq "" || $condensed) { $icon = ''; } else { $icon = $indentString; @@ -595,11 +583,11 @@ sub real_handler { $displayedHereMarker = 1; } - if ($curRes->is_problem() && $part ne "0" && !$condensed) { + if ($curRes->is_problem() && $part ne "" && !$condensed) { $partLabel = " (Part $part)"; $title = ""; } - if ($multipart && $condensed) { + if ($condensed && $curRes->countParts() > 1) { $nonLinkedText .= ' (' . $curRes->countParts() . ' parts)'; } @@ -699,7 +687,7 @@ sub real_handler { $navmap->untieHashes(); - $r->print("