--- rat/lonpageflip.pm 2002/05/23 15:07:55 1.25 +++ rat/lonpageflip.pm 2002/08/12 18:21:42 1.28 @@ -2,7 +2,7 @@ # # Page flip handler # -# $Id: lonpageflip.pm,v 1.25 2002/05/23 15:07:55 www Exp $ +# $Id: lonpageflip.pm,v 1.28 2002/08/12 18:21:42 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -53,20 +53,20 @@ my %hash; sub addrid { my ($current,$new,$condid)=@_; unless ($condid) { $condid=0; } - if (&Apache::lonnet::allowed('bre',$hash{'src_'.$new})) { + if ($current) { $current.=','.$new; } else { $current=''.$new; } - } + return $current; } sub fullmove { my ($rid,$mapurl,$direction)=@_; if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'.db', - &GDBM_READER,0640)) { + &GDBM_READER(),0640)) { ($rid,$mapurl)=&move($rid,$mapurl,$direction); untie(%hash); } @@ -184,7 +184,7 @@ sub handler { # -------------------------------------------------------- Return to last known my $last; if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'_symb.db', - &GDBM_READER,0640)) { + &GDBM_READER(),0640)) { $last=$hash{'last_known'}; untie(%hash); } @@ -206,7 +206,7 @@ sub handler { ($currenturl=~/^\/adm\/wrapper\//)) { my $last; if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'_symb.db', - &GDBM_READER,0640)) { + &GDBM_READER(),0640)) { $last=$hash{'last_known'}; untie(%hash); } @@ -230,7 +230,7 @@ sub handler { # ============================================================ Tie the big hash if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'.db', - &GDBM_READER,0640)) { + &GDBM_READER(),0640)) { my $rid=$hash{'map_pc_/res/'.$startoutmap}.'.'.$mapnum; # ------------------------------------------------- Move forward, backward, etc @@ -238,8 +238,9 @@ sub handler { ($next,$endupmap)=&move($rid,$startoutmap,$direction); # -------------------------------------- Do we have one and only one empty URL? my $safecount=0; - while (($next) && ($next!~/\,/) && (!$hash{'src_'.$next}) - && ($safecount<25)) { + while (($next) && ($next!~/\,/) && + ((!$hash{'src_'.$next}) || ($hash{'randomout_'.$next})) + && ($safecount<10000)) { ($next,$endupmap)=&move($next,$endupmap,$direction); $safecount++; } @@ -304,14 +305,14 @@ Please click on the the resource you int ENDSTART - map { + foreach (@possibilities) { $r->print( ''); - } @possibilities; + } $r->print('
TitleType
'. $multichoicehash{'title_'.$_}. ''.$multichoicehash{'type_'.$_}. '
'); return OK; } else {