X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FSt.pm;h=9ed2a31c67c6c05d6b911de09c9af400dcd02bbf;hb=7731fbead8b6008222433a55467f986b434fb470;hp=39d7b84358f1320f4a39af8184b1cfb18dd59250;hpb=17080e2d464cf6c131c34e6e87bcf5970de815cc;p=plack-app-gruntmaster.git diff --git a/lib/Gruntmaster/Page/St.pm b/lib/Gruntmaster/Page/St.pm index 39d7b84..9ed2a31 100644 --- a/lib/Gruntmaster/Page/St.pm +++ b/lib/Gruntmaster/Page/St.pm @@ -36,8 +36,8 @@ 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+)/; - $scores{$job->owner->id}{$job->problem->id} = int ($factor * calc_score ($value, $time, $tries{$job->owner}{$job->problem}, $ct->stop - $ct->start)); + $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 { no warnings 'numeric';