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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 09 Jan 2006 18:39:31 -0000


albertel		Mon Jan  9 13:39:31 2006 EDT

  Modified files:              
    /rat	lonpageflip.pm 
  Log:
  - BUG#4318, the use of $_ was screwing this up
  
  
Index: rat/lonpageflip.pm
diff -u rat/lonpageflip.pm:1.60 rat/lonpageflip.pm:1.61
--- rat/lonpageflip.pm:1.60	Tue Nov 15 13:39:45 2005
+++ rat/lonpageflip.pm	Mon Jan  9 13:39:31 2006
@@ -2,7 +2,7 @@
 #
 # Page flip handler
 #
-# $Id: lonpageflip.pm,v 1.60 2005/11/15 18:39:45 albertel Exp $
+# $Id: lonpageflip.pm,v 1.61 2006/01/09 18:39:31 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -96,25 +96,25 @@
                   while ($hash{'type_'.$rid} eq 'finish') {
 	             $rid=$hash{'ids_'.$hash{'map_id_'.(split(/\./,$rid))[0]}};
                   }
-                  map {
-                      my $thiscond=
-      &Apache::lonnet::directcondval($hash{'condid_'.$hash{'undercond_'.$_}});
+		  foreach my $id (split(/\,/,$hash{'to_'.$rid})) {
+		      my $thiscond=
+      &Apache::lonnet::directcondval($hash{'condid_'.$hash{'undercond_'.$id}});
                       if ($thiscond>=$mincond) {
 		          if ($posnext) {
-		             $posnext.=','.$_.':'.$thiscond;
+		             $posnext.=','.$id.':'.$thiscond;
                           } else {
-                             $posnext=$_.':'.$thiscond;
+                             $posnext=$id.':'.$thiscond;
 		          }
                           if ($thiscond>$mincond) { $mincond=$thiscond; }
 	              }
-                  } split(/\,/,$hash{'to_'.$rid});
-                  map {
-                      my ($linkid,$condval)=split(/\:/,$_);
+                  } 
+		  foreach my $id (split(/\,/,$posnext))  {
+                      my ($linkid,$condval)=split(/\:/,$id);
                       if ($condval>=$mincond) {
 		          $next=&addrid($next,$hash{'goesto_'.$linkid},
                                 $hash{'condid_'.$hash{'undercond_'.$linkid}});
                       }
-                  } split(/\,/,$posnext);
+                  }
                   if ($hash{'is_map_'.$next}) {
 # This jumps to the beginning of a new map (going down level)
                       if (
@@ -130,7 +130,7 @@
                     ((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
                  while ($hash{'type_'.$rid} eq 'start') {