Make problem value NOT NULL
[gruntmaster-data.git] / lib / Gruntmaster / Data.pm
index 9b383895cde207e9a335da9a56e401eaaf8667cc..949e1a41910b7bb3be44c8a8edd7e6a64f1f8f07 100644 (file)
@@ -42,13 +42,6 @@ BEGIN {
        }
 }
 
-use constant LEVEL_VALUES => {
-       beginner => 100,
-       easy => 250,
-       medium => 500,
-       hard => 1000,
-};
-
 sub calc_score{
        my ($mxscore, $time, $tries, $totaltime) = @_;
        my $score = $mxscore;
@@ -71,7 +64,7 @@ sub standings {
                        my $open = $self->opens->find($ct->id, $job->problem->id, $job->owner->id);
                        my $time = $job->date - ($open ? $open->time : $ct->start);
                        next if $time < 0;
-                       my $value = $job->problem->value // LEVEL_VALUES->{$job->problem->level};
+                       my $value = $job->problem->value;
                        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->id}{$job->problem->id}++, $ct->stop - $ct->start));
This page took 0.009785 seconds and 4 git commands to generate.