version 1.41, 2002/12/04 14:05:07
|
version 1.44, 2003/04/07 20:47:06
|
Line 318 sub pastetarget {
|
Line 318 sub pastetarget {
|
# modifies @resources |
# modifies @resources |
|
|
sub startfinish { |
sub startfinish { |
|
# Remove all start and finish |
foreach (@order) { |
foreach (@order) { |
my ($name,$url,$ext)=split(/\:/,$resources[$_]); |
my ($name,$url,$ext)=split(/\:/,$resources[$_]); |
if ($url=~/http\&colon\:\/\//) { $ext='true'; } |
if ($url=~/http\&colon\:\/\//) { $ext='true'; } |
$resources[$_]=$name.':'.$url.':'.$ext.':normal:res'; |
$resources[$_]=$name.':'.$url.':'.$ext.':normal:res'; |
} |
} |
|
# Garbage collection |
|
my $stillchange=1; |
|
while (($#order>1) && ($stillchange)) { |
|
$stillchange=0; |
|
for (my $i=0;$i<=$#order;$i++) { |
|
my ($name,$url,$ext)=split(/\:/,$resources[$order[$i]]); |
|
unless ($url) { |
|
# Take out empty resource |
|
for (my $j=$i+1;$j<=$#order;$j++) { |
|
$order[$j-1]=$order[$j]; |
|
} |
|
$#order--; |
|
$stillchange=1; |
|
last; |
|
} |
|
} |
|
} |
|
# Put in a start resource |
my ($name,$url,$ext)=split(/\:/,$resources[$order[0]]); |
my ($name,$url,$ext)=split(/\:/,$resources[$order[0]]); |
$resources[$order[0]]=$name.':'.$url.':'.$ext.':start:res'; |
$resources[$order[0]]=$name.':'.$url.':'.$ext.':start:res'; |
|
# Make sure this has at least start and finish |
if ($#order==0) { |
if ($#order==0) { |
$resources[$#resources+1]='::false'; |
$resources[$#resources+1]='::false'; |
$order[1]=$#resources; |
$order[1]=$#resources; |
} |
} |
my ($name,$url,$ext)=split(/\:/,$resources[$order[$#order]]); |
# Make the last one a finish resource |
|
($name,$url,$ext)=split(/\:/,$resources[$order[$#order]]); |
$resources[$order[$#order]]=$name.':'.$url.':'.$ext.':finish:res'; |
$resources[$order[$#order]]=$name.':'.$url.':'.$ext.':finish:res'; |
} |
} |
|
|
Line 892 sub viewmap {
|
Line 913 sub viewmap {
|
} |
} |
my $idx=0; |
my $idx=0; |
$r->print('<h1>'.$url.'</h1>'); |
$r->print('<h1>'.$url.'</h1>'); |
|
if ($adv) { |
|
$r->print('<p><b><font color="red">Map contents are not shown in order.</font></b></p><br />'); |
|
} |
foreach (&attemptread(&Apache::lonnet::filelocation('',$url))) { |
foreach (&attemptread(&Apache::lonnet::filelocation('',$url))) { |
if (defined($_)) { |
if (defined($_)) { |
$idx++; |
$idx++; |