]> iEval git - plack-app-gruntmaster.git/commitdiff
Do not detach solution twice
authorMarius Gavrilescu <marius@ieval.ro>
Fri, 23 Jan 2015 14:43:25 +0000 (16:43 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Fri, 23 Jan 2015 14:43:25 +0000 (16:43 +0200)
lib/Plack/App/Gruntmaster/HTML.pm

index 40d46affa440dd7ebc5653ab4cd26670b91739a6..91699e6e7e96f3bb64698403750750ebfee0d992 100644 (file)
@@ -156,10 +156,10 @@ sub process_pb_entry {
                $tree->fid('score')->attr('data-value' => $args{value});
                $tree->fid('score')->replace_content(Gruntmaster::Data::Result::Contest::calc_score($args{value}, $args{time} - $args{open_time}, 0, $args{contest_stop} - $args{contest_start}));
        } else {
+               $tree->fid('solution')->detach unless $args{solution};
                $_->detach for $tree->fclass('rc'); # requires contest
                $tree->fid('solution_modal')->fclass('modal-body')->replace_content(literal $args{solution});
        }
-       $tree->fid('solution')->detach unless $args{solution};
        if ($args{cansubmit}) {
                $tree->look_down(name => 'problem')->attr(value => $args{id});
                my $contest = $tree->look_down(name => 'contest');
This page took 0.025128 seconds and 4 git commands to generate.