contest => $env->{'gruntmaster.contest'},
problem => $_->{id},
owner => $env->{REMOTE_USER},
+ time => time,
})
} if $env->{'gruntmaster.contest'} && time >= db($env)->contest($env->{'gruntmaster.contest'})->start;
say "Error when creating open: $@";
if ($ct) {
my $open = db($env)->opens->find($ct->id, $job->problem->id, $job->owner->id);
- my $time = $job->date - ($open || $ct->start);
+ my $time = $job->date - ($open ? $open->time : $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);