From: Marius Gavrilescu Date: Wed, 21 Jan 2015 19:12:19 +0000 (+0200) Subject: Use open_time instead of contest_start in problem timer X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=12dd93409640fb5d6af1a64ec9e3c492188de7cb;p=gruntmaster-page.git Use open_time instead of contest_start in problem timer --- diff --git a/lib/Plack/App/Gruntmaster/HTML.pm b/lib/Plack/App/Gruntmaster/HTML.pm index 5ea0626..a4c6da1 100644 --- a/lib/Plack/App/Gruntmaster/HTML.pm +++ b/lib/Plack/App/Gruntmaster/HTML.pm @@ -148,13 +148,13 @@ sub process_pb_entry { $tree->fid('solution')->detach; $tree->fid('solution_modal')->detach; my $countdown = $tree->fid('countdown'); - $countdown->attr('data-start' => $args{contest_start}); + $countdown->attr('data-start' => $args{open_time}); $countdown->attr('data-stop' => $args{contest_stop}); $countdown->attr('data-time' => $args{time}); my $left = $args{contest_stop} - $args{time}; $countdown->replace_content(sprintf '%02d:%02d:%02d', $left/60/60, $left/60%60, $left%60); $tree->fid('score')->attr('data-value' => $args{value}); - $tree->fid('score')->replace_content(Gruntmaster::Data::calc_score($args{value}, $args{time} - $args{contest_start}, 0, $args{contest_stop} - $args{contest_start})); + $tree->fid('score')->replace_content(Gruntmaster::Data::calc_score($args{value}, $args{time} - $args{open_time}, 0, $args{contest_stop} - $args{contest_start})); } else { $_->detach for $tree->fclass('rc'); # requires contest $tree->fid('solution_modal')->fclass('modal-body')->replace_content(literal $args{solution});