]> iEval git - gruntmaster-page.git/commitdiff
Handle points problems when computing standings
authorMarius Gavrilescu <marius@ieval.ro>
Fri, 11 Apr 2014 22:29:45 +0000 (01:29 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Fri, 11 Apr 2014 22:29:45 +0000 (01:29 +0300)
lib/Gruntmaster/Page/St.pm

index 0e3c316dd254775c0d895bd09c29ec1fb595c5b5..39d7b84358f1320f4a39af8184b1cfb18dd59250 100644 (file)
@@ -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';
This page took 0.023573 seconds and 4 git commands to generate.