--- rat/lonsequence.pm 2002/05/23 10:19:30 1.8 +++ rat/lonsequence.pm 2002/05/23 10:58:05 1.9 @@ -2,7 +2,7 @@ # # Sequence Handler # -# $Id: lonsequence.pm,v 1.8 2002/05/23 10:19:30 www Exp $ +# $Id: lonsequence.pm,v 1.9 2002/05/23 10:58:05 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -73,7 +73,7 @@ sub attemptread { # ---------------------------------------------------------------- View Handler sub viewmap { - my ($r,$url,$adv,$errtext)=@_; + my ($r,$url)=@_; $r->print(''); if ($ENV{'form.forceselect'}) { $r->print(< @@ -95,12 +95,10 @@ function queue(val) { } } - - ENDSCRIPT } - $r->print(''.&buttons($adv)); + $r->print(''); if ($ENV{'form.forceselect'}) { $r->print(< @@ -109,9 +107,6 @@ onClick="javascript:select_group()"> ENDSELECT } - if ($errtext) { - $r->print($errtext.'
'); - } my $idx=0; foreach (&attemptread(&Apache::lonnet::filelocation('',$url))) { if (defined($_)) { @@ -165,7 +160,10 @@ sub handler { my $requrl=$r->uri; # ------------------------------------------------------------ Tie symb db file - if ($ENV{'request.course.fn'}) { + my $disurl=''; + my $dismapid=''; + + if (($ENV{'request.course.fn'}) && (!$ENV{'form.forceselect'})) { my $last; if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'_symb.db', &GDBM_READER,0640)) { @@ -189,8 +187,6 @@ sub handler { $disid=$bighash{'map_start_'.$requrl}; $whatend='Beginning'; } - my $disurl=''; - my $dismapid=''; if ($disid) { $disurl=$bighash{'src_'.$disid}; $dismapid=(split(/\./,$disid))[1]; @@ -207,38 +203,24 @@ sub handler { } # --------------------------------------- Untie hash, make sure to come by here untie(%bighash); - if ($disurl) { + } + } + +# now either disurl is set (going to first page), or we need another display + + if ($disurl) { # -------------------------------------------------- Has first or last resource - &Apache::lonnet::symblist($requrl,$disurl => $dismapid, + &Apache::lonnet::symblist($requrl,$disurl => $dismapid, 'last_known' => &Apache::lonnet::declutter($disurl)); - $r->content_type('text/html'); - $r->header_out(Location => 'http://'.$ENV{'HTTP_HOST'}.$disurl); - return REDIRECT; - } else { -# ---------- Does not have first or last resource, try to find out where we are - unless ($symb) { - $r->internal_redirect('/adm/ambiguous'); - } - $r->content_type('text/html'); - $r->send_http_header; - $r->print(< -

$whatend of

-

$sequencetitle

- -ENDSYMB - return OK - } - } else { - &getlost($r,'Could not access course structure.'); - return OK; - } + $r->content_type('text/html'); + $r->header_out(Location => 'http://'.$ENV{'HTTP_HOST'}.$disurl); + return REDIRECT; } else { - $ENV{'user.error.msg'}="$requrl:bre:0:0:Course not initialized"; - return HTTP_NOT_ACCEPTABLE; + $r->content_type('text/html'); + $r->send_http_header; + &viewmap($r,$requrl); + return OK; } - - return OK; } 1;