]> iEval git - gruntmaster-data.git/commitdiff
Add the solution to pb_entry when not in contest
authorMarius Gavrilescu <marius@ieval.ro>
Thu, 11 Dec 2014 21:50:15 +0000 (23:50 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Thu, 11 Dec 2014 21:50:15 +0000 (23:50 +0200)
lib/Gruntmaster/Data.pm

index ce87c254c9b85027fa1d1c7dbeceaa6bd030e8e7..9cb313d67ca7073e6f92a69b7beb24a99b403894 100644 (file)
@@ -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,
This page took 0.030578 seconds and 4 git commands to generate.