--- rat/lonsequence.pm 2002/05/23 10:58:05 1.9 +++ rat/lonsequence.pm 2002/05/23 15:07:55 1.11 @@ -2,7 +2,7 @@ # # Sequence Handler # -# $Id: lonsequence.pm,v 1.9 2002/05/23 10:58:05 www Exp $ +# $Id: lonsequence.pm,v 1.11 2002/05/23 15:07:55 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -44,6 +44,7 @@ use Apache::Constants qw(:common :http R use GDBM_File; use Apache::lonratedt; use Apache::lonratsrv; +use Apache::lonpageflip; # ----------------------------------------------------------- Could not resolve @@ -179,28 +180,28 @@ sub handler { if (tie(%bighash,'GDBM_File',$ENV{'request.course.fn'}.'.db', &GDBM_READER,0640)) { my $disid=''; - my $whatend=''; + if ($direction eq 'back') { $disid=$bighash{'map_finish_'.$requrl}; - $whatend='End'; } else { $disid=$bighash{'map_start_'.$requrl}; - $whatend='Beginning'; } if ($disid) { $disurl=$bighash{'src_'.$disid}; $dismapid=(split(/\./,$disid))[1]; } - my $symb=''; - my $sequencetitle=''; - unless($disurl) { - if ($symb=&Apache::lonnet::symbread()) { - my ($mapurl,$mapid)=split(/\_\_\_/,$symb); - $sequencetitle=$bighash{'title_'. - $bighash{'map_pc_/res/'.$mapurl}.'.'. - $mapid}; +# ------------------------- If this is an empty one, skip to next non-empty one + if ((!$disurl) && ($disid)) { + $direction=($direction?$direction:'forward'); + ($disid,$requrl)= + &Apache::lonpageflip::fullmove($disid, + &Apache::lonnet::declutter($requrl),$direction); + if ($disid) { + $disurl=$bighash{'src_'.$disid}; + $dismapid=(split(/\./,$disid))[1]; } - } + } + # --------------------------------------- Untie hash, make sure to come by here untie(%bighash); }