From: Marius Gavrilescu Date: Thu, 11 Dec 2014 21:50:15 +0000 (+0200) Subject: Add the solution to pb_entry when not in contest X-Git-Tag: 5999.000_012~11 X-Git-Url: http://git.ieval.ro/?p=gruntmaster-data.git;a=commitdiff_plain;h=8bd66733a4d66baf38f69ea36154d1873ad5edba Add the solution to pb_entry when not in contest --- diff --git a/lib/Gruntmaster/Data.pm b/lib/Gruntmaster/Data.pm index ce87c25..9cb313d 100644 --- a/lib/Gruntmaster/Data.pm +++ b/lib/Gruntmaster/Data.pm @@ -116,8 +116,10 @@ sub problem_list { sub problem_entry { my ($self, $id, $contest, $user) = @_; - my $pb = $self->problems->find($id, {columns => PROBLEM_PUBLIC_COLUMNS, prefetch => 'owner'}); my $running = $contest && $self->contest($contest)->is_running; + my $columns = PROBLEM_PUBLIC_COLUMNS; + push @$columns, 'solution' unless $running; + my $pb = $self->problems->find($id, {columns => $columns, prefetch => 'owner'}); eval { ## no critic (RequireCheckingReturnValueOfEval) $self->opens->create({ contest => $contest,