]> iEval git - gruntmaster-page.git/blame - lib/Gruntmaster/Page/Pb/Entry.pm
iesi acasa
[gruntmaster-page.git] / lib / Gruntmaster / Page / Pb / Entry.pm
CommitLineData
42546e6c
MG
1package Gruntmaster::Page::Pb::Entry;
2
3use 5.014000;
4use strict;
5use warnings;
bb95f538
MG
6use Gruntmaster::Page::Base pb_entry => '<tmpl_var name>';
7our @ISA = qw/Gruntmaster::Page::Base/;
42546e6c
MG
8our $VERSION = '0.001';
9
312ffd85 10use constant FORMATS => [qw/C CPP JAVA PASCAL PERL PYTHON/];
8d29b3b1 11
bb95f538 12sub _generate{
191f4979
MG
13 my ($self, $htc, $lang, $env, $contest, $id) = @_;
14 debug $env => "language is '$lang', contest is '$contest', id is '$id'";
acef92e8
MG
15 my $user = $env->{REMOTE_USER};
16 if ($contest && $user) {
277f05a7 17 local $Gruntmaster::Data::contest = $contest;
acef92e8
MG
18 mark_open $id, $user;
19 debug $env => "Marking problem $id of contest $contest open by $user";
20 }
79bd8e7a 21
cd9af27e 22 $htc->param(cansubmit => 1);
a94f8453 23 if ($contest) {
d3933028 24 $htc->param(cansubmit => (time <= contest_end $contest));
cd9af27e
MG
25 $htc->param(contest => $contest);
26 }
8d29b3b1 27 $htc->param(formats => FORMATS);
cd9af27e 28 $htc->param(id => $id);
3da9c3c2 29 local $Gruntmaster::Data::contest = $contest if $contest;
cd9af27e 30 $htc->param(name => problem_name $id);
2ee6edcf
MG
31 $htc->param(author => problem_author $id);
32 $htc->param(owner => problem_owner $id);
3da9c3c2 33 $htc->param(statement => problem_statement $id);
d3933028 34 $htc->param(timelimit => problem_timeout $id);
42546e6c
MG
35}
36
c86e504e
MG
37sub vary { 'Authorization' }
38sub max_age { 600 }
39
42546e6c 401
This page took 0.038194 seconds and 4 git commands to generate.