From 17080e2d464cf6c131c34e6e87bcf5970de815cc Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sat, 12 Apr 2014 01:29:45 +0300 Subject: [PATCH] Handle points problems when computing standings --- lib/Gruntmaster/Page/St.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Gruntmaster/Page/St.pm b/lib/Gruntmaster/Page/St.pm index 0e3c316..39d7b84 100644 --- a/lib/Gruntmaster/Page/St.pm +++ b/lib/Gruntmaster/Page/St.pm @@ -35,7 +35,9 @@ sub _generate{ 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); + 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)); $tries{$job->owner->id}{$job->problem->id}++; } else { no warnings 'numeric'; -- 2.39.2