version 1.18, 2001/11/29 19:23:49
|
version 1.20, 2002/04/11 15:43:40
|
Line 156 sub handler {
|
Line 156 sub handler {
|
my $redirecturl=''; |
my $redirecturl=''; |
my $next=''; |
my $next=''; |
my @possibilities=(); |
my @possibilities=(); |
|
|
if (($ENV{'form.postdata'})&&($ENV{'request.course.fn'})) { |
if (($ENV{'form.postdata'})&&($ENV{'request.course.fn'})) { |
$ENV{'form.postdata'}=~/(\w+)\:(.*)/; |
$ENV{'form.postdata'}=~/(\w+)\:(.*)/; |
my $direction=$1; |
my $direction=$1; |
Line 205 sub handler {
|
Line 204 sub handler {
|
if ($position=Apache::lonnet::symbread($currenturl)) { |
if ($position=Apache::lonnet::symbread($currenturl)) { |
# ------------------------------------------------------------------------- Yes |
# ------------------------------------------------------------------------- Yes |
my ($mapurl,$mapnum,$thisurl)=split(/\_\_\_/,$position); |
my ($mapurl,$mapnum,$thisurl)=split(/\_\_\_/,$position); |
$cachehash{$thisurl}=$mapnum; |
$cachehash{$mapurl}{$thisurl}=$mapnum; |
|
$cachehash{$mapurl}{'last_known'}=&Apache::lonnet::declutter($currenturl); |
|
|
# ============================================================ 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', |
&GDBM_READER,0640)) { |
&GDBM_READER,0640)) { |
Line 227 sub handler {
|
Line 228 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{&Apache::lonnet::declutter($redirecturl)} |
$cachehash{$mapurl} |
|
{&Apache::lonnet::declutter($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 |
Line 236 sub handler {
|
Line 238 sub handler {
|
$multichoicehash{'src_'.$_}=$hash{'src_'.$_}; |
$multichoicehash{'src_'.$_}=$hash{'src_'.$_}; |
$multichoicehash{'title_'.$_}=$hash{'title_'.$_}; |
$multichoicehash{'title_'.$_}=$hash{'title_'.$_}; |
$multichoicehash{'type_'.$_}=$hash{'type_'.$_}; |
$multichoicehash{'type_'.$_}=$hash{'type_'.$_}; |
$cachehash |
$cachehash{$mapurl} |
{&Apache::lonnet::declutter( |
{&Apache::lonnet::declutter( |
$multichoicehash |
$multichoicehash |
{'src_'.$_} |
{'src_'.$_} |
Line 251 sub handler {
|
Line 253 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{'last_direction'}=$direction; |
$cachehash{$mapurl}{'last_direction'}=$direction; |
$cachehash{'last_known'}=&Apache::lonnet::declutter($currenturl); |
foreach my $thismap (keys %cachehash) { |
&Apache::lonnet::symblist($mapurl,%cachehash); |
&Apache::lonnet::symblist($thismap,%{$cachehash{$thismap}}); |
|
} |
# ============================================== Do not return before this line |
# ============================================== Do not return before this line |
if ($redirecturl) { |
if ($redirecturl) { |
# ----------------------------------------------------- There is a URL to go to |
# ----------------------------------------------------- There is a URL to go to |