--- rat/lonpageflip.pm 2005/11/09 11:39:00 1.58 +++ rat/lonpageflip.pm 2006/01/09 18:39:31 1.61 @@ -2,7 +2,7 @@ # # Page flip handler # -# $Id: lonpageflip.pm,v 1.58 2005/11/09 11:39:00 www 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') { @@ -401,18 +401,29 @@ sub handler { # --------------------------------------------------------- There was a problem &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; + my %lt=&Apache::lonlocal::texthash('title' => 'End of Sequence', + 'explain' => + 'You have reached the end of the sequence of materials.', + 'back' => 'Go Back', + 'nav' => 'Navigate Course Content', + 'wherenext' => + 'There are several possibilities of where to go next', + 'pick' => + 'Please click on the the resource you intend to access', + 'titleheader' => 'Title', + 'type' => 'Type'); if ($#possibilities>0) { my $bodytag= &Apache::loncommon::bodytag('Multiple Resources'); $r->print(<Choose Next Location $bodytag -

There are several possibilities of where to go next

+

$lt{'wherenext'}

-Please click on the the resource you intend to access: +$lt{'pick'}:

- + ENDSTART foreach (@possibilities) { $r->print( @@ -423,26 +434,24 @@ ENDSTART ''); } - $r->print('
TitleType
$lt{'titleheader'}$lt{'type'}
'.$multichoicehash{'type_'.$_}. '
'); - return OK; + $r->print(''); } else { my $bodytag=&Apache::loncommon::bodytag('No Resource'); - $r->print(<print(<No Resource $bodytag -

Next resource could not be identified.

-

You probably are at the beginning or the end of the -course.

- - - +

$lt{'title'}

+

$lt{'explain'}

ENDNONE - return OK; - } - } + } + $r->print(< +
  • $lt{'back'}
  • +
  • $lt{'nav'}
  • + +ENDMENU + return OK; + } } else { # ------------------------------------------------- Problem, could not tie hash $env{'user.error.msg'}="/adm/flip:bre:0:1:Course Data Missing"; @@ -450,9 +459,6 @@ ENDNONE } } else { # ---------------------------------------- No, could not determine where we are - if ( &Apache::lonnet::mod_perl_version() == 2 ) { - &Apache::lonnet::cleanenv(); - } $r->internal_redirect('/adm/ambiguous'); } } else {