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

www lon-capa-cvs@mail.lon-capa.org
Fri, 12 Apr 2002 13:47:21 -0000


www		Fri Apr 12 09:47:21 2002 EDT

  Modified files:              
    /rat	lonpageflip.pm 
  Log:
  Hopefully fixed "forward"
  
  
Index: rat/lonpageflip.pm
diff -u rat/lonpageflip.pm:1.22 rat/lonpageflip.pm:1.23
--- rat/lonpageflip.pm:1.22	Thu Apr 11 15:21:52 2002
+++ rat/lonpageflip.pm	Fri Apr 12 09:47:21 2002
@@ -2,7 +2,7 @@
 #
 # Page flip handler
 #
-# $Id: lonpageflip.pm,v 1.22 2002/04/11 19:21:52 www Exp $
+# $Id: lonpageflip.pm,v 1.23 2002/04/12 13:47:21 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -65,6 +65,7 @@
 
 sub move {
     my ($rid,$mapurl,$direction)=@_;
+    my $startoutrid=$rid;
 
     my $next='';
 
@@ -95,11 +96,16 @@
                       }
                   } split(/\,/,$posnext);
                   if ($hash{'is_map_'.$next}) {
+# This jumps to the beginning of a new map (going down level)
                       if (
       $hash{'map_type_'.$hash{'map_pc_'.$hash{'src_'.$next}}} eq 'sequence') {
 			  $mapurl=$hash{'src_'.$next};
 			  $next=$hash{'map_start_'.$hash{'src_'.$next}};
                      }
+                  } elsif 
+                    ((split(/\./,$startoutrid))[0]!=(split(/\./,$next))[0]) {
+# This comes up from a map (coming up one level);
+		      $mapurl=$hash{'map_id_'.(split(/\./,$next))[0]};
                   }
               } elsif ($direction eq 'back') {
 # ------------------------------------------------------------------- Backwards
@@ -133,7 +139,6 @@
                      }
                   }
 	      }
-
               return ($next,$mapurl);
 }
 
@@ -205,7 +210,8 @@
 # ------------------------------------------------------------------------- Yes
 	  my ($startoutmap,$mapnum,$thisurl)=split(/\_\_\_/,$position);
           $cachehash{$startoutmap}{$thisurl}=$mapnum;
-          $cachehash{$startoutmap}{'last_known'}=&Apache::lonnet::declutter($currenturl);
+          $cachehash{$startoutmap}{'last_known'}=
+                                       &Apache::lonnet::declutter($currenturl);
 
 # ============================================================ Tie the big hash
           if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'.db',