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

raeburn lon-capa-cvs@mail.lon-capa.org
Thu, 08 Apr 2004 09:14:41 -0000


raeburn		Thu Apr  8 05:14:41 2004 EDT

  Modified files:              
    /rat	lonpageflip.pm 
  Log:
  Accommodate case where we are moving forwards (or backwards) and encounter an empty folder, followed (or preceded) by a page. This situation can occur for a course structure created from an IMS import.
  
  
Index: rat/lonpageflip.pm
diff -u rat/lonpageflip.pm:1.46 rat/lonpageflip.pm:1.47
--- rat/lonpageflip.pm:1.46	Wed Oct 29 17:09:17 2003
+++ rat/lonpageflip.pm	Thu Apr  8 05:14:41 2004
@@ -2,7 +2,7 @@
 #
 # Page flip handler
 #
-# $Id: lonpageflip.pm,v 1.46 2003/10/29 22:09:17 www Exp $
+# $Id: lonpageflip.pm,v 1.47 2004/04/08 09:14:41 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -120,6 +120,10 @@
       $hash{'map_type_'.$hash{'map_pc_'.$hash{'src_'.$next}}} eq 'sequence') {
 			  $mapurl=$hash{'src_'.$next};
 			  $next=$hash{'map_start_'.$hash{'src_'.$next}};
+                     } elsif (
+# This jumps back up from an empty sequence, to a page up one level
+                         $hash{'map_type_'.$hash{'map_pc_'.$hash{'src_'.$next}}} eq 'page') {
+                         $mapurl=$hash{'map_id_'.(split(/\./,$next))[0]};
                      }
                   } elsif 
                     ((split(/\./,$startoutrid))[0]!=(split(/\./,$next))[0]) {
@@ -156,7 +160,11 @@
       $hash{'map_type_'.$hash{'map_pc_'.$hash{'src_'.$next}}} eq 'sequence') {
 			  $mapurl=$hash{'src_'.$next};
 			  $next=$hash{'map_finish_'.$hash{'src_'.$next}};
-                     }
+                      } elsif (
+      $hash{'map_type_'.$hash{'map_pc_'.$hash{'src_'.$next}}} eq 'page') {
+# This jumps back up from an empty sequence, to a page up one level
+                          $mapurl=$hash{'map_id_'.(split(/\./,$next))[0]};
+                      }
                   } elsif 
                     ((split(/\./,$startoutrid))[0]!=(split(/\./,$next))[0]) {
 # This comes back up from a map (going up one level);