version 1.128.2.7, 2006/04/10 07:21:14
|
version 1.136, 2006/03/31 20:30:30
|
Line 455 sub start_Task {
|
Line 455 sub start_Task {
|
my $files = '<ul>'; |
my $files = '<ul>'; |
foreach my $file (@files) { |
foreach my $file (@files) { |
my $url="/uploaded/$domain/$user/portfolio$file"; |
my $url="/uploaded/$domain/$user/portfolio$file"; |
$file = '<tt>'.$file.'</tt>'; |
if (! &Apache::lonnet::stat_file($url)) { |
|
$file = &mt('<font color="red"> Nonexistant file:</font> <tt>[_1]</tt>',$file); |
|
} else { |
|
$file = '<tt>'.$file.'</tt>'; |
|
} |
$files .= '<li>'.$file.'</li>'; |
$files .= '<li>'.$file.'</li>'; |
} |
} |
$files.='</ul>'; |
$files.='</ul>'; |
Line 1315 sub pick_from_queue_data {
|
Line 1319 sub pick_from_queue_data {
|
if (@possible) { |
if (@possible) { |
# sort entries in order by slot end time |
# sort entries in order by slot end time |
@possible = sort { $a->[1] <=> $b->[1] } @possible; |
@possible = sort { $a->[1] <=> $b->[1] } @possible; |
# pick one of the entries in the top 10% in small queues and one |
# pick one of the first ten entries |
# of the first ten entries in large queues |
my $max=($#possible < 10) ? $#possible : 10; |
my $ten_percent = int($#possible * 0.1); |
|
if ($ten_percent < 1 ) { $ten_percent = 1; } |
|
if ($ten_percent > 10) { $ten_percent = 10; } |
|
my $max=($#possible < $ten_percent) ? $#possible : $ten_percent; |
|
|
|
return $possible[int(rand($max))][0]; |
return $possible[int(rand($max))][0]; |
} |
} |
return undef; |
return undef; |