X-Git-Url: http://git.ieval.ro/?p=gruntmaster-data.git;a=blobdiff_plain;f=lib%2FGruntmaster%2FData.pm;h=949e1a41910b7bb3be44c8a8edd7e6a64f1f8f07;hp=9b383895cde207e9a335da9a56e401eaaf8667cc;hb=aaa9eb7d81598848183239016890f3a851082154;hpb=df95d5784d9a039442cc02c21f9459127b1aa8bb diff --git a/lib/Gruntmaster/Data.pm b/lib/Gruntmaster/Data.pm index 9b38389..949e1a4 100644 --- a/lib/Gruntmaster/Data.pm +++ b/lib/Gruntmaster/Data.pm @@ -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));