", join('',map {
if ($hdr) { $_ = "$_"; }
else { $_ = " | 14 ? " width=150" : "") . ">$_"; }
} @_), "\n";
}
sub printHtmlHeader {
my ($perm) = @_;
my $colspec = "";
my $hdr1;
my $hdr2;
@$perm = (0, 1, 2);
my $p = 3;
if ($detail) {
$hdr1 = "Rank | User | Name";
$extras and $p++ and push @$perm, 3 and $hdr1.=" | Extra" and $colspec.=""; ##Extra hack
for my $task (@tasks) {
my $nSub = scalar(keys %{$known_tests{$task}});
$p++;
map { push @$perm, $p++ } (1..$nSub);
push @$perm, $p - $nSub - 1;
$colspec .= "\n";
$colspec .= "\n";
$hdr1 .= "$task";
$hdr2 .= join("", map { " | $_" } sort {$a <=> $b} keys %{$known_tests{$task}});
$hdr2 .= " | Total";
}
$hdr1 .= " | Total";
} else { ## no detail
$hdr1 = " | Rank | User | Name";
$extras and $p++ and push @$perm, 3 and $hdr1.=" | Extra" and $colspec.=""; ##Extra hack
for my $task (@tasks) {
push @$perm, $p++;
$hdr1 .= "$task";
}
$hdr1 .= " | Total";
$colspec .= "";
}
push @$perm, $p++;
print "\n";
print "$colspec\n";
print "$hdr1 \n";
print "$hdr2 \n" if $detail;
}
| | | |