]> iEval git - gruntmaster-page.git/commitdiff
Merge branch 'master' into mindcoding
authorMarius Gavrilescu <marius@ieval.ro>
Fri, 14 Feb 2014 17:45:00 +0000 (19:45 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Fri, 14 Feb 2014 17:45:00 +0000 (19:45 +0200)
1  2 
lib/Gruntmaster/Page/Pb/Entry.pm
lib/Gruntmaster/Page/St.pm

index efcba375f3bc926138a93a99ed00c9d5725aac5c,4cf007edcd1760d3eaf7dea49298ad942d52265f..5dbeb92c2a0d37a20f6a598c95107e102ead8a7a
@@@ -7,13 -7,13 +7,13 @@@ use Gruntmaster::Page::Base pb_entry =
  our @ISA = qw/Gruntmaster::Page::Base/;
  our $VERSION = '0.001';
  
 -use constant FORMATS => [qw/C CPP JAVA PERL PYTHON/];
 +use constant FORMATS => [qw/C CPP JAVA PASCAL PERL PYTHON/];
  
  sub _generate{
        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) {
+       if ($contest && $user && time >= contest_start $contest) {
                local $Gruntmaster::Data::contest = $contest;
                mark_open $id, $user;
                debug $env => "Marking problem $id of contest $contest open by $user";
@@@ -21,7 -21,7 +21,7 @@@
  
        $htc->param(cansubmit => 1);
        if ($contest) {
 -              $htc->param(cansubmit => time <= contest_end $contest);
 +              $htc->param(cansubmit => (time <= contest_end $contest));
                $htc->param(contest => $contest);
        }
        $htc->param(formats => FORMATS);
@@@ -31,7 -31,6 +31,7 @@@
        $htc->param(author => problem_author $id);
        $htc->param(owner => problem_owner $id);
        $htc->param(statement => problem_statement $id);
 +      $htc->param(timelimit => problem_timeout $id);
  }
  
  sub vary { 'Authorization' }
index 316a92b46f5c1f5ea555e0fbf43cf64fdf0b7c3c,6486136cb09d362b6c0cd2f14294ba748c18217d..901dc9a9620fe9949b1fd13c82519e9726c354dd
@@@ -10,7 -10,7 +10,7 @@@ our $VERSION = '0.001'
  use constant LEVEL_VALUES => {
        beginner => 100,
        easy => 250,
 -      medium => 500,
 +      medium => 600,
        hard => 1000,
  };
  
@@@ -44,8 -44,7 +44,7 @@@ sub _generate
        my (%scores, %tries);
        for (1 .. jobcard) {
                if ($Gruntmaster::Data::contest) {
-                       $tries{job_user()}{job_problem()}++;
-                       $scores{job_user()}{job_problem()} = job_result() ? 0 : calc_score (job_user(), job_problem(), job_date(), $tries{job_user()}{job_problem()}, $totaltime) if job_date() > $start;
+                       $scores{job_user()}{job_problem()} = job_result() ? 0 : calc_score (job_user(), job_problem(), job_date(), $tries{job_user()}{job_problem()}++, $totaltime) if job_date() > $start;
                } elsif (defined job_user && defined job_problem && defined job_result) {
                        if (defined job_result_text && job_result_text =~ m/^(\scores+)/) {
                                $scores{job_user()}{job_problem()} = $ct;
This page took 0.020316 seconds and 4 git commands to generate.