[LON-CAPA-cvs] cvs: rat / lonpageflip.pm

www lon-capa-cvs@mail.lon-capa.org
Thu, 11 Apr 2002 01:57:36 -0000


www		Wed Apr 10 21:57:36 2002 EDT

  Modified files:              
    /rat	lonpageflip.pm 
  Log:
  Very broken now.
  
  
Index: rat/lonpageflip.pm
diff -u rat/lonpageflip.pm:1.18 rat/lonpageflip.pm:1.19
--- rat/lonpageflip.pm:1.18	Thu Nov 29 14:23:49 2001
+++ rat/lonpageflip.pm	Wed Apr 10 21:57:36 2002
@@ -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 @@
       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 @@
                   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 @@
 			  $multichoicehash{'src_'.$_}=$hash{'src_'.$_};
                           $multichoicehash{'title_'.$_}=$hash{'title_'.$_};
                           $multichoicehash{'type_'.$_}=$hash{'type_'.$_};
-                          $cachehash
+                          $cachehash{$mapurl}
                             {&Apache::lonnet::declutter(
 						      $multichoicehash
                                                          {'src_'.$_}
@@ -251,9 +252,12 @@
 # ----------------- 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