]>
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 <tr><th>Username<tmpl_loop problems><th><tmpl_var _></tmpl_loop><th>Total
16 <tmpl_loop st><tr><td><tmpl_var user>
17 <tmpl_loop scores><td><tmpl_var _>
18 </tmpl_loop><td><tmpl_var score>
25 my ($self, $htc, $path, $lang) = @_;
27 local $Gruntmaster::Data
::contest
= ($path =~ m
,^ct
/([^/]+)/,)[0];
29 my @problems = sort problems
;
32 if (job_result_text
=~ m/^(\d+)/) {
33 $scores{job_user
()}{job_problem
()} = $1;
35 $scores{job_user
()}{job_problem
()} = job_result
() ?
0 : 100;
39 my @st = sort { $b->{score
} <=> $a->{score
} } map {
43 score
=> sum
(values $scores{$user}),
44 scores
=> [map { $scores{$user}{$_} // '-'} @problems],
47 $htc->param(problems
=> \
@problems);
48 $htc->param(st
=> \
@st);
This page took 0.045372 seconds and 4 git commands to generate.