]>
iEval git - plack-app-gruntmaster.git/blob - Page/Pb/Entry.pm
1 package Gruntmaster
::Page
::Pb
::Entry
;
6 use Gruntmaster
::Page
::Base pb_entry
=> '<tmpl_var name>';
7 our @ISA = qw
/Gruntmaster::Page::Base/;
8 our $VERSION = '0.001';
10 use constant FORMATS
=> [qw
/CPP/];
12 use constant TEMPLATES
=> {
14 <tmpl_var ESCAPE=0 statement>
17 <h1>Submit solution</h1>
18 <form action="https://gm.ieval.ro/action/submit" method="POST" enctype="multipart/form-data">
19 <input type="hidden" name="problem" value="<tmpl_var id>">
20 <tmpl_if_defined contest><input type="hidden" name="contest" value="<tmpl_var contest>"></tmpl_if_defined>
21 <label>File: <input name="prog" required type="file"></label>
23 <label>File format: <select name="prog_format" required>
24 <tmpl_loop formats><option value="<tmpl_var _>"><tmpl_var _></option>
25 </tmpl_loop></select></label>
27 <input type="submit" value="Submit job">
34 my ($self, $htc, $path, $lang) = @_;
36 $path =~ m
,(?
:ct
/([^/])+/)?pb/(\w
+)\
.html
$,;
38 my ($contest, $id) = ($1, $2);
40 $htc->param(cansubmit
=> 1);
41 if (defined $contest) {
42 $htc->param(cansubmit
=> time >= contest_start
$contest && time <= contest_end
$contest);
43 $htc->param(contest
=> $contest);
45 $htc->param(formats
=> FORMATS
);
46 $htc->param(id
=> $id);
47 local $Gruntmaster::Data
::contest
= $contest if $contest;
48 $htc->param(name
=> problem_name
$id);
49 $htc->param(statement
=> problem_statement
$id);
This page took 0.047547 seconds and 4 git commands to generate.