]> iEval git - gruntmaster-data.git/commitdiff
Sort on problem.value not problem.level in contest standings
authorMarius Gavrilescu <marius@ieval.ro>
Thu, 12 Feb 2015 17:56:38 +0000 (19:56 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Thu, 12 Feb 2015 17:56:38 +0000 (19:56 +0200)
lib/Gruntmaster/Data/Result/Contest.pm

index 02a50caeb819c86c5891ed7c0ee4b4e72dfeb0fa..2a57c95f4a4247d5e145db5e7f135e693a60ab26 100644 (file)
@@ -210,7 +210,7 @@ sub standings {
        my ($self) = @_;
        my $ct = $self->id;
 
-       my @problems = map { $_->rawproblem } $self->contest_problems->search({contest => $ct}, {qw/join problem order_by problem.level/});
+       my @problems = map { $_->rawproblem } $self->contest_problems->search({contest => $ct}, {qw/join problem order_by problem.value/});
        my (%scores, %tries, %opens);
        $opens{$_->rawproblem, $_->rawowner} = $_ for $self->opens->search({contest => $ct});
        for my $job ($self->jobs->search({contest => $ct, result => {'!=', undef}}, {qw/order_by me.id prefetch/ => [qw/problem/]})) {
@@ -225,6 +225,7 @@ sub standings {
 
        my %user_to_name = map { $_->id => $_->name } $self->result_source->schema->users->all;
 
+       say STDERR join "\n\n", @problems;
        my @st = sort { $b->{score} <=> $a->{score} or $a->{user} cmp $b->{user} } map { ## no critic (ProhibitReverseSortBlock)
                my $user = $_;
                +{
This page took 0.029227 seconds and 4 git commands to generate.