--- rat/lonpageflip.pm 2001/11/29 19:23:49 1.18 +++ rat/lonpageflip.pm 2002/04/11 01:57:36 1.19 @@ -2,7 +2,7 @@ # # Page flip handler # -# $Id: lonpageflip.pm,v 1.18 2001/11/29 19:23:49 www Exp $ +# $Id: lonpageflip.pm,v 1.19 2002/04/11 01:57:36 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -205,7 +205,7 @@ sub handler { if ($position=Apache::lonnet::symbread($currenturl)) { # ------------------------------------------------------------------------- Yes my ($mapurl,$mapnum,$thisurl)=split(/\_\_\_/,$position); - $cachehash{$thisurl}=$mapnum; + $cachehash{$mapurl}{$thisurl}=$mapnum; # ============================================================ Tie the big hash if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'.db', &GDBM_READER,0640)) { @@ -227,7 +227,8 @@ sub handler { if ($#possibilities==0) { # ---------------------------------------------- Only one possibility, redirect $redirecturl=$hash{'src_'.$next}; - $cachehash{&Apache::lonnet::declutter($redirecturl)} + $cachehash{$mapurl} + {&Apache::lonnet::declutter($redirecturl)} =(split(/\./,$next))[1]; } else { # ------------------------ There are multiple possibilities for a next resource @@ -236,7 +237,7 @@ sub handler { $multichoicehash{'src_'.$_}=$hash{'src_'.$_}; $multichoicehash{'title_'.$_}=$hash{'title_'.$_}; $multichoicehash{'type_'.$_}=$hash{'type_'.$_}; - $cachehash + $cachehash{$mapurl} {&Apache::lonnet::declutter( $multichoicehash {'src_'.$_} @@ -251,9 +252,12 @@ sub handler { # ----------------- The program must come past this point to untie the big hash untie(%hash); # --------------------------------------------------------- Store position info - $cachehash{'last_direction'}=$direction; - $cachehash{'last_known'}=&Apache::lonnet::declutter($currenturl); - &Apache::lonnet::symblist($mapurl,%cachehash); + $cachehash{$mapurl}{'last_direction'}=$direction; + $cachehash{$mapurl}{'last_known'}= + &Apache::lonnet::declutter($currenturl); + foreach my $thismap (keys %cachehash) { + &Apache::lonnet::symblist($thismap,%{$cachehash{$thisurl}}); + } # ============================================== Do not return before this line if ($redirecturl) { # ----------------------------------------------------- There is a URL to go to