From: Marius Gavrilescu Date: Sat, 12 Apr 2014 21:35:09 +0000 (+0300) Subject: Anchor a regex in St.pm X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=2c5e513090408391cd8b979e37c6653bb48e8aae;p=plack-app-gruntmaster.git Anchor a regex in St.pm --- 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 {