From 2c5e513090408391cd8b979e37c6653bb48e8aae Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sun, 13 Apr 2014 00:35:09 +0300 Subject: [PATCH] Anchor a regex in St.pm --- lib/Gruntmaster/Page/St.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Gruntmaster/Page/St.pm b/lib/Gruntmaster/Page/St.pm index fad8f47..9ed2a31 100644 --- a/lib/Gruntmaster/Page/St.pm +++ b/lib/Gruntmaster/Page/St.pm @@ -36,7 +36,7 @@ sub _generate{ next if $time < 0; my $value = $job->problem->value // LEVEL_VALUES->{$job->problem->level}; my $factor = $job->result ? 0 : 1; - $factor = $1 / 100 if $job->result_text =~ /(\d+)/; + $factor = $1 / 100 if $job->result_text =~ /^(\d+ )/; $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 { -- 2.39.2