]>
iEval git - gruntmaster-page.git/blob - lib/Gruntmaster/Page/St.pm
1 package Gruntmaster
::Page
::St
;
6 use Gruntmaster
::Page
::Base st
=> 'Standings';
7 our @ISA = qw
/Gruntmaster::Page::Base/;
8 our $VERSION = '0.001';
10 use constant TEMPLATES
=> {
14 <tmpl_if problems><tr><th>Username<tmpl_loop problems><th><tmpl_var _></tmpl_loop><th>Total
15 <tmpl_else><tr><th>Username<th>Score
19 <tmpl_loop st><tr><td><tmpl_var user>
20 <tmpl_if problems><tmpl_loop scores><td><tmpl_var _>
21 </tmpl_loop></tmpl_if><td><tmpl_var score>
28 my ($self, $htc, $path, $lang) = @_;
30 $path =~ m
,^(?
:ct
/([^/]+)/)?
,;
31 local $Gruntmaster::Data
::contest
= $1;
33 my @problems = problems
;
34 @problems = sort @problems;
37 if (job_result_text
=~ m/^(\d+)/) {
38 $scores{job_user
()}{job_problem
()} = $1;
40 $scores{job_user
()}{job_problem
()} = job_result
() ?
0 : 100;
44 my @st = sort { $b->{score
} <=> $a->{score
} } map {
48 score
=> sum
(values $scores{$user}),
49 scores
=> [map { $scores{$user}{$_} // '-'} @problems],
52 $htc->param(problems
=> [map { problem_name
} @problems ]) if $Gruntmaster::Data
::contest
;
53 $htc->param(st
=> \
@st);
This page took 0.051191 seconds and 4 git commands to generate.