--- loncom/interface/lonnavmaps.pm 2003/01/13 22:41:20 1.126
+++ loncom/interface/lonnavmaps.pm 2003/01/30 21:36:57 1.132
@@ -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.132 2003/01/30 21:36:57 bowersj2 Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -46,6 +46,24 @@ use Apache::Constants qw(:common :http);
use Apache::loncommon();
use POSIX qw (floor strftime);
+my %navmaphash;
+my %parmhash;
+
+sub cleanup {
+ if (tied(%navmaphash)){
+ &Apache::lonnet::logthis('Cleanup navmaps: navmaphash');
+ unless (untie(%navmaphash)) {
+ &Apache::lonnet::logthis('Failed cleanup navmaps: navmaphash');
+ }
+ }
+ if (tied(%parmhash)){
+ &Apache::lonnet::logthis('Cleanup navmaps: parmhash');
+ unless (untie(%parmhash)) {
+ &Apache::lonnet::logthis('Failed cleanup navmaps: parmhash');
+ }
+ }
+}
+
sub handler {
my $r = shift;
real_handler($r);
@@ -273,12 +291,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 +298,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 +316,6 @@ sub real_handler {
}
$ENV{'form.alreadyHere'} = 1;
}
-<<<<<<< lonnavmaps.pm
-
-=======
$looped = 1;
$curRes = $mapIterator->next();
@@ -337,13 +345,12 @@ sub real_handler {
$foundJump = 1;
}
->>>>>>> 1.122
$curRes = $mapIterator->next();
}
undef $res; # so we don't accidentally use it later
my $indentLevel = 0;
- my $indentString = "";
+ my $indentString = "
";
my $isNewBranch = 0;
my $now = time();
@@ -381,13 +388,6 @@ sub real_handler {
if (ref($curRes)) { $counter++; }
- # Is this resource being ignored because it is in a random-out
- # map and it was not selected?
- if (ref($curRes) && !advancedUser() && $curRes->randomout()) {
- $curRes = $mapIterator->next();
- next; # if yes, then just ignore this resource
- }
-
if (ref($curRes)) {
my $deltalevel = $isNewBranch? 1 : 0; # reserves space for branch icon
@@ -420,6 +420,9 @@ sub real_handler {
# Otherwise, only display part 0 if we want to
# attach feedback or email information to it
if ($curRes->hasDiscussion() || $curRes->getFeedback()) {
+ # Is this right? I think this will toss it
+ # if it DOES have discussion, not if it doesn't?
+ # - Jeremy (yes, commenting on his own code)
shift @parts;
} else {
# Now, we decide whether to condense the
@@ -442,7 +445,7 @@ sub real_handler {
}
}
- # $allSame is true if all the statuses were
+ # $*allSame is true if all the statuses were
# the same. Now, if they are all the same and
# match one of the statuses to condense, or they
# are all open with the same due date, or they are
@@ -699,7 +702,7 @@ sub real_handler {
$navmap->untieHashes();
- $r->print("