--- rat/lonpageflip.pm 2005/11/15 18:39:45 1.60 +++ rat/lonpageflip.pm 2006/01/09 18:39:31 1.61 @@ -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 @@ sub move { 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 @@ sub move { ((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') {