my $user = $_;
+{
user => $self->user($user),
- score => sum (values $scores{$user}),
+ score => sum (values %{$scores{$user}}),
scores => [map { $scores{$user}{$_->id} // '-'} @problems],
problems => $ct,
}
$params{contest} = $args{contest} if $args{contest};
for ($rs->all) {
$params{$_->level} //= [];
- push $params{$_->level}, {$_->get_columns, owner_name => $_->owner->name} ;
+ push @{$params{$_->level}}, {$_->get_columns, owner_name => $_->owner->name} ;
}
\%params
}
for ($rs->all) {
my $state = $_->is_pending ? 'pending' : $_->is_running ? 'running' : 'finished';
$params{$state} //= [];
- push $params{$state}, { $_->get_columns, started => !$_->is_pending, owner_name => $_->owner->name };
+ push @{$params{$state}}, { $_->get_columns, started => !$_->is_pending, owner_name => $_->owner->name };
}
\%params
}