From: Marius Gavrilescu Date: Sat, 12 Apr 2014 06:21:56 +0000 (+0300) Subject: Use number of tries when computing scores X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=d58bf008b29af2176e1474e9e0f0cc4096fe047e;p=gruntmaster-page.git Use number of tries when computing scores --- diff --git a/lib/Gruntmaster/Page/St.pm b/lib/Gruntmaster/Page/St.pm index 39d7b84..fad8f47 100644 --- a/lib/Gruntmaster/Page/St.pm +++ b/lib/Gruntmaster/Page/St.pm @@ -37,7 +37,7 @@ sub _generate{ my $value = $job->problem->value // LEVEL_VALUES->{$job->problem->level}; my $factor = $job->result ? 0 : 1; $factor = $1 / 100 if $job->result_text =~ /(\d+)/; - $scores{$job->owner->id}{$job->problem->id} = int ($factor * calc_score ($value, $time, $tries{$job->owner}{$job->problem}, $ct->stop - $ct->start)); + $scores{$job->owner->id}{$job->problem->id} = int ($factor * calc_score ($value, $time, $tries{$job->owner->id}{$job->problem->id}, $ct->stop - $ct->start)); $tries{$job->owner->id}{$job->problem->id}++; } else { no warnings 'numeric';