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