From: Marius Gavrilescu Date: Fri, 28 Mar 2014 20:24:09 +0000 (+0200) Subject: Use opens when computing standings X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=e8cc4fa43dad618ac488e70e9448831bfb5bc7da;p=plack-app-gruntmaster.git Use opens when computing standings --- diff --git a/lib/Gruntmaster/Page/St.pm b/lib/Gruntmaster/Page/St.pm index f1a42c1..f5c4049 100644 --- a/lib/Gruntmaster/Page/St.pm +++ b/lib/Gruntmaster/Page/St.pm @@ -31,7 +31,8 @@ sub _generate{ for my $job (db($env)->jobs->search({contest => $ct && $ct->id}, {order_by => 'id'})) { if ($ct) { - my $time = $job->date - $ct->start; + my $open = db($env)->open($ct->id, $job->problem->id, $job->owner->id); + my $time = $job->date - ($open || $ct->start); next if $time < 0; my $value = $job->problem->value // LEVEL_VALUES->{$job->problem->level}; $scores{$job->owner->id}{$job->problem->id} = $job->result ? 0 : calc_score ($value, $time, $tries{$job->owner}{$job->problem}, $ct->stop - $ct->start);