From: Marius Gavrilescu Date: Fri, 23 Jan 2015 14:43:25 +0000 (+0200) Subject: Do not detach solution twice X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=c016b64482812bf81dc02402ddc3aa80cfc25cf9;p=plack-app-gruntmaster.git Do not detach solution twice --- diff --git a/lib/Plack/App/Gruntmaster/HTML.pm b/lib/Plack/App/Gruntmaster/HTML.pm index 40d46af..91699e6 100644 --- a/lib/Plack/App/Gruntmaster/HTML.pm +++ b/lib/Plack/App/Gruntmaster/HTML.pm @@ -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');