]> iEval git - gruntmaster-page.git/blobdiff - lib/Gruntmaster/Page/St.pm
Fix and update standings
[gruntmaster-page.git] / lib / Gruntmaster / Page / St.pm
index dafd5df249e21b1604441d1ba0033e12b4a3080c..b91137e883f2f45cfea0933b3ed58db83970994a 100644 (file)
@@ -7,7 +7,7 @@ use Gruntmaster::Page::Base st => 'Standings';
 our @ISA = qw/Gruntmaster::Page::Base/;
 our $VERSION = '0.001';
 
-use constant => TEMPLATES => {
+use constant TEMPLATES => {
        en => <<'HTML',
 <table border>
 <thead>
@@ -24,9 +24,11 @@ HTML
 sub _generate{
        my ($self, $htc, $path, $lang) = @_;
 
-       local $Gruntmaster::Data::contest = ($path =~ m,^ct/([^/]+)/,)[0];
+       $path =~ m,^(?:ct/([^/]+)/)?,;
+       local $Gruntmaster::Data::contest = $1;
 
-       my @problems = sort problems;
+       my @problems = problems;
+       @problems = sort @problems;
        my %scores;
        for (1 .. jobcard) {
                if (job_result_text =~ m/^(\d+)/) {
@@ -44,7 +46,7 @@ sub _generate{
                        scores => [map { $scores{$user}{$_} // '-'} @problems],
                }
        } keys %scores;
-       $htc->param(problems => \@problems);
+       $htc->param(problems => [map { problem_name } @problems ]);
        $htc->param(st => \@st);
 }
 
This page took 0.024844 seconds and 4 git commands to generate.