X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FPb%2FEntry.pm;h=8b770efe3a24bcc5f193675171a685e364480227;hb=277f05a743e67e24327bded2a851a8cb998a55d0;hp=6df5e5e236805f7404fc81b0973b4b44d0bcffae;hpb=a94f84535623ae0de44b63290aa4c8b1bf3e5eaa;p=gruntmaster-page.git diff --git a/lib/Gruntmaster/Page/Pb/Entry.pm b/lib/Gruntmaster/Page/Pb/Entry.pm index 6df5e5e..8b770ef 100644 --- a/lib/Gruntmaster/Page/Pb/Entry.pm +++ b/lib/Gruntmaster/Page/Pb/Entry.pm @@ -7,43 +7,24 @@ use Gruntmaster::Page::Base pb_entry => ''; our @ISA = qw/Gruntmaster::Page::Base/; our $VERSION = '0.001'; -use constant TEMPLATES => { - en => <<'HTML', -
-
- -
- -
- -

Submit solution

-
- - - -
-
-
- - -
-
-
-HTML -}; +use constant FORMATS => [qw/C CPP JAVA PERL PYTHON/]; sub _generate{ - my ($self, $htc, $lang, $logger, $contest, $id) = @_; - debug $logger => "language is '$lang', contest is '$contest', id is '$id'"; + my ($self, $htc, $lang, $env, $contest, $id) = @_; + debug $env => "language is '$lang', contest is '$contest', id is '$id'"; + my $user = $env->{REMOTE_USER}; + if ($contest && $user) { + local $Gruntmaster::Data::contest = $contest; + mark_open $id, $user; + debug $env => "Marking problem $id of contest $contest open by $user"; + } $htc->param(cansubmit => 1); if ($contest) { $htc->param(cansubmit => time <= contest_end $contest); $htc->param(contest => $contest); } - $htc->param(formats => Gruntmaster::Page::Submit::FORMATS); + $htc->param(formats => FORMATS); $htc->param(id => $id); local $Gruntmaster::Data::contest = $contest if $contest; $htc->param(name => problem_name $id); @@ -52,4 +33,7 @@ sub _generate{ $htc->param(statement => problem_statement $id); } +sub vary { 'Authorization' } +sub max_age { 600 } + 1