]> iEval git - gruntmaster-data.git/blobdiff - lib/Gruntmaster/Data.pm
Add the solution to pb_entry when not in contest
[gruntmaster-data.git] / lib / Gruntmaster / Data.pm
index 694fc8e688eba12567f33bbe449b07888cf22a56..9cb313d67ca7073e6f92a69b7beb24a99b403894 100644 (file)
@@ -15,7 +15,7 @@ __PACKAGE__->load_namespaces;
 # Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-03-05 13:11:39
 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dAEmtAexvUaNXLgYz2rNEg
 
-our $VERSION = '5999.000_010';
+our $VERSION = '5999.000_011';
 
 use Lingua::EN::Inflect qw/PL_N/;
 use JSON::MaybeXS qw/decode_json/;
@@ -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.021612 seconds and 4 git commands to generate.