version 1.51, 2005/02/17 09:09:57
|
version 1.52, 2005/03/01 00:22:57
|
Line 210 sub handler {
|
Line 210 sub handler {
|
my $newloc; |
my $newloc; |
if (($last) && (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'.db', |
if (($last) && (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'.db', |
&GDBM_READER(),0640))) { |
&GDBM_READER(),0640))) { |
my ($murl,$fn)=&Apache::lonnet::decode_symb($last); |
my ($murl,$id,$fn)=&Apache::lonnet::decode_symb($last); |
my $id; |
|
($murl,$id,$fn)=&Apache::lonnet::decode_symb(&Apache::lonnet::symbread($fn)); |
|
$id=$hash{'map_pc_'.&Apache::lonnet::clutter($murl)}.'.'.$id; |
$id=$hash{'map_pc_'.&Apache::lonnet::clutter($murl)}.'.'.$id; |
$newloc=$hash{'src_'.$id}; |
$newloc=$hash{'src_'.$id}; |
if ($newloc) { |
if ($newloc) { |
Line 244 sub handler {
|
Line 242 sub handler {
|
untie(%hash); |
untie(%hash); |
} |
} |
if ($last) { |
if ($last) { |
$currenturl=&Apache::lonnet::clutter((&Apache::lonnet::decode_symb($last))[1]); |
$currenturl=&Apache::lonnet::clutter((&Apache::lonnet::decode_symb($last))[2]); |
} else { |
} else { |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->header_out(Location => |
$r->header_out(Location => |
Line 257 sub handler {
|
Line 255 sub handler {
|
if ($position=Apache::lonnet::symbread($currenturl)) { |
if ($position=Apache::lonnet::symbread($currenturl)) { |
# ------------------------------------------------------------------------- Yes |
# ------------------------------------------------------------------------- Yes |
my ($startoutmap,$mapnum,$thisurl)=&Apache::lonnet::decode_symb($position); |
my ($startoutmap,$mapnum,$thisurl)=&Apache::lonnet::decode_symb($position); |
$cachehash{$startoutmap}{$thisurl}=$mapnum; |
$cachehash{$startoutmap}{$thisurl}=[$thisurl,$mapnum]; |
$cachehash{$startoutmap}{'last_known'}= |
$cachehash{$startoutmap}{'last_known'}= |
&Apache::lonnet::declutter($currenturl); |
[&Apache::lonnet::declutter($currenturl),$mapnum]; |
|
|
# ============================================================ Tie the big hash |
# ============================================================ Tie the big hash |
if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'.db', |
if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'.db', |
Line 286 sub handler {
|
Line 284 sub handler {
|
if ($#possibilities==0) { |
if ($#possibilities==0) { |
# ---------------------------------------------- Only one possibility, redirect |
# ---------------------------------------------- Only one possibility, redirect |
$redirecturl=&hash_src($next); |
$redirecturl=&hash_src($next); |
$cachehash{$endupmap} |
$cachehash{$endupmap}{$redirecturl}= |
{&Apache::lonnet::declutter($redirecturl)} |
[$redirecturl,(split(/\./,$next))[1]]; |
=(split(/\./,$next))[1]; |
|
} else { |
} else { |
# ------------------------ There are multiple possibilities for a next resource |
# ------------------------ There are multiple possibilities for a next resource |
$multichoice=1; |
$multichoice=1; |
Line 303 sub handler {
|
Line 300 sub handler {
|
$second.'___'.$symbSrc); |
$second.'___'.$symbSrc); |
|
|
my ($choicemap,$choiceres)=split(/\./,$_); |
my ($choicemap,$choiceres)=split(/\./,$_); |
$cachehash |
my $map=&Apache::lonnet::declutter($hash{'src_'.$choicemap}); |
{&Apache::lonnet::declutter($hash{'src_'.$choicemap})} |
my $url=$multichoicehash{'src_'.$_}; |
{&Apache::lonnet::declutter( |
$cachehash{$map}{$url}=[$url,$choiceres]; |
$multichoicehash |
|
{'src_'.$_} |
|
)} |
|
=$choiceres; |
|
} @possibilities; |
} @possibilities; |
} |
} |
} else { |
} else { |
Line 319 sub handler {
|
Line 312 sub handler {
|
# ----------------- The program must come past this point to untie the big hash |
# ----------------- The program must come past this point to untie the big hash |
untie(%hash); |
untie(%hash); |
# --------------------------------------------------------- Store position info |
# --------------------------------------------------------- Store position info |
$cachehash{$startoutmap}{'last_direction'}=$direction; |
$cachehash{$startoutmap}{'last_direction'}=[$direction,'notasymb']; |
foreach my $thismap (keys %cachehash) { |
foreach my $thismap (keys %cachehash) { |
&Apache::lonnet::symblist($thismap,%{$cachehash{$thismap}}); |
my $mapnum=$cachehash{$thismap}->{'mapnum'}; |
|
delete($cachehash{$thismap}->{'mapnum'}); |
|
&Apache::lonnet::symblist($thismap, |
|
%{$cachehash{$thismap}}); |
} |
} |
# ============================================== Do not return before this line |
# ============================================== Do not return before this line |
if ($redirecturl) { |
if ($redirecturl) { |