version 1.29, 2002/08/18 21:45:41
|
version 1.35, 2003/03/01 15:13:59
|
Line 50 use GDBM_File;
|
Line 50 use GDBM_File;
|
|
|
my %hash; |
my %hash; |
|
|
|
sub cleanup { |
|
if (tied(%hash)){ |
|
&Apache::lonnet::logthis('Cleanup pageflip: hash'); |
|
unless (untie(%hash)) { |
|
&Apache::lonnet::logthis('Failed cleanup pageflip: hash'); |
|
} |
|
} |
|
} |
|
|
sub addrid { |
sub addrid { |
my ($current,$new,$condid)=@_; |
my ($current,$new,$condid)=@_; |
unless ($condid) { $condid=0; } |
unless ($condid) { $condid=0; } |
Line 83 sub move {
|
Line 92 sub move {
|
my $posnext=''; |
my $posnext=''; |
if ($direction eq 'forward') { |
if ($direction eq 'forward') { |
# --------------------------------------------------------------------- Forward |
# --------------------------------------------------------------------- Forward |
if ($hash{'type_'.$rid} eq 'finish') { |
while ($hash{'type_'.$rid} eq 'finish') { |
$rid=$hash{'ids_'.&Apache::lonnet::clutter($mapurl)}; |
$rid=$hash{'ids_'.$hash{'map_id_'.(split(/\./,$rid))[0]}}; |
} |
} |
map { |
map { |
my $thiscond= |
my $thiscond= |
Line 119 sub move {
|
Line 128 sub move {
|
} |
} |
} elsif ($direction eq 'back') { |
} elsif ($direction eq 'back') { |
# ------------------------------------------------------------------- Backwards |
# ------------------------------------------------------------------- Backwards |
if ($hash{'type_'.$rid} eq 'start') { |
while ($hash{'type_'.$rid} eq 'start') { |
$rid=$hash{'ids_'.&Apache::lonnet::clutter($mapurl)}; |
$rid=$hash{'ids_'.$hash{'map_id_'.(split(/\./,$rid))[0]}}; |
} |
} |
map { |
map { |
my $thiscond= |
my $thiscond= |
&Apache::lonnet::directcondval($hash{'condid_'.$hash{'undercond_'.$_}}); |
&Apache::lonnet::directcondval($hash{'condid_'.$hash{'undercond_'.$_}}); |
Line 202 sub handler {
|
Line 211 sub handler {
|
} |
} |
$currenturl=~s/^http\:\/\///; |
$currenturl=~s/^http\:\/\///; |
$currenturl=~s/^[^\/]+//; |
$currenturl=~s/^[^\/]+//; |
unless (($currenturl=~/^\/res\//) || |
# |
($currenturl=~/^\/adm\/wrapper\//)) { |
# Is the current URL on the map? If not, start with last known URL |
|
# |
|
unless (&Apache::lonnet::is_on_map($currenturl)) { |
my $last; |
my $last; |
if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'_symb.db', |
if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'_symb.db', |
&GDBM_READER(),0640)) { |
&GDBM_READER(),0640)) { |
Line 262 sub handler {
|
Line 273 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_'.$_}; |
|
(my $first, my $second) = $_ =~ /(\d+).(\d+)/; |
|
my $symbSrc = Apache::lonnet::declutter($hash{'src_'.$_}); |
|
$multichoicehash{'symb_'.$_} = |
|
Apache::lonnet::declutter($hash{'map_id_'.$first}.'___'. |
|
$second.'___'.$symbSrc); |
|
|
my ($choicemap,$choiceres)=split(/\./,$_); |
my ($choicemap,$choiceres)=split(/\./,$_); |
$cachehash |
$cachehash |
{&Apache::lonnet::declutter($hash{'src_'.$choicemap})} |
{&Apache::lonnet::declutter($hash{'src_'.$choicemap})} |
Line 286 sub handler {
|
Line 303 sub handler {
|
# ============================================== 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 |
|
# ------------------------------------------------- Check for critical messages |
|
if ((time-$ENV{'user.criticalcheck.time'})>300) { |
|
my @what=&Apache::lonnet::dump |
|
('critical',$ENV{'user.domain'}, |
|
$ENV{'user.name'}); |
|
if ($what[0]) { |
|
if (($what[0] ne 'con_lost') && |
|
($what[0]!~/^error\:/)) { |
|
$redirecturl='/adm/email?critical=display'; |
|
} |
|
} |
|
&Apache::lonnet::appenv('user.criticalcheck.time'=>time); |
|
} |
|
|
$r->content_type('text/html'); |
$r->content_type('text/html'); |
$r->header_out(Location => |
$r->header_out(Location => |
'http://'.$ENV{'HTTP_HOST'}.$redirecturl); |
'http://'.$ENV{'HTTP_HOST'}.$redirecturl); |
Line 309 ENDSTART
|
Line 340 ENDSTART
|
foreach (@possibilities) { |
foreach (@possibilities) { |
$r->print( |
$r->print( |
'<tr><td><a href="'. |
'<tr><td><a href="'. |
$multichoicehash{'src_'.$_}.'">'. |
$multichoicehash{'src_'.$_}.'?symb=' . |
|
Apache::lonnet::escape($multichoicehash{'symb_'.$_}).'">'. |
$multichoicehash{'title_'.$_}. |
$multichoicehash{'title_'.$_}. |
'</a></td><td>'.$multichoicehash{'type_'.$_}. |
'</a></td><td>'.$multichoicehash{'type_'.$_}. |
'</td></tr>'); |
'</td></tr>'); |