]> iEval git - gruntmaster-page.git/blame_incremental - lib/Gruntmaster/Page/Pb.pm
Add ranks to standings and reduce warnings
[gruntmaster-page.git] / lib / Gruntmaster / Page / Pb.pm
... / ...
CommitLineData
1package Gruntmaster::Page::Pb;
2
3use 5.014000;
4use strict;
5use warnings;
6use Gruntmaster::Page::Base pb => 'Problems';
7our @ISA = qw/Gruntmaster::Page::Base/;
8our $VERSION = '0.001';
9
10sub _generate{
11 my ($self, $htc, $lang, $env, $ct) = @_;
12 debug $env => "language is '$lang' and contest is '$ct'";
13 local $Gruntmaster::Data::contest = $ct if $ct;
14
15 my @problems = sort { $b->{name} cmp $a->{name} } map +{
16 id => $_,
17 name => problem_name,
18 level => problem_level}, problems;
19
20 for my $d (qw/beginner easy medium advanced hard/) {
21 $htc->param($d => [grep {$_->{level} and $_->{level} eq $d} @problems]);
22 }
23 $htc->param(levels => grep { $_->{level} } @problems);
24 $htc->param(problems => \@problems);
25}
26
271
This page took 0.017015 seconds and 4 git commands to generate.