From 12dd93409640fb5d6af1a64ec9e3c492188de7cb Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Wed, 21 Jan 2015 21:12:19 +0200 Subject: [PATCH] Use open_time instead of contest_start in problem timer --- lib/Plack/App/Gruntmaster/HTML.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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}); -- 2.39.2