- <%= problem.full_name %>: ข้อมูลสำหรับตรวจสอบ (สามารถดาวน์โหลดและส่งกี่ครั้งก็ได้):
+ <%= problem.full_name %>: ข้อมูลสำหรับตรวจสอบ (สามารถดาวน์โหลดและส่งกี่ครั้งก็ได้,ไม่มีคะแนน):
<%= link_to 'ดาวน์โหลด input', :action => 'verifying_testcase', :id => problem.id %>
- <% if @current_problem.id == problem.id %>
+ <% if @current_problem and @current_problem.id == problem.id %>
<% if @grading_result %>
- | ผลการตรวจ: <%= @grading_result %>
+ | ผลการตรวจ: <%= "#{@grading_result[:score]}/#{@grading_result[:full_score]} [#{@grading_result[:msg]}]" %>
<% end %>
<% end %>
- <%= form_tag({:controller => 'main', :action => 'verifying_submit', :id => problem.id}, {:method => 'post', :multipart => true}) do %>
+ <%= form_tag({:controller => 'main', :action => 'verifying_submit', :id => problem.id}, {:method => 'post', :multipart => true }) do %>
ส่งคำตอบของข้อมูลสำหรับตรวจสอบ:
<%= file_field_tag 'output_file' %>
<%= submit_tag 'Submit' %>
@@ -24,9 +24,9 @@
<%= problem.full_name %>: ข้อมูลทดสอบจริง (ส่งกี่ครั้งก็ได้ภายในเวลา 5 นาทีหลังดาวน์โหลด):
- <%= link_to 'ดาวน์โหลด input และเริ่มจับเวลา', { :action => 'testcase', :id => problem.id}, { :onclick => 'return confirm_download()' } %>
+ <%= link_to 'ดาวน์โหลด input และเริ่มจับเวลา', { :action => 'testcase', :id => problem.id}, { :onclick => 'return TOIContest.confirmDownload()' } %>
- <%= form_tag do %>
+ <%= form_tag({:controller => 'main', :action => 'submit', :id => problem.id}, {:method => 'post', :multipart => true, :id => "submission_form_#{problem.id}_id" }) do %>
ข้อมูลส่งออก: <%= file_field_tag 'output_file' %>
โปรแกรมคำตอบ: <%= file_field_tag 'source_file' %>
<%= submit_tag 'Submit' %>
@@ -34,18 +34,3 @@
<% end %>
-
diff --git a/app/views/main/list.html.haml b/app/views/main/list.html.haml
--- a/app/views/main/list.html.haml
+++ b/app/views/main/list.html.haml
@@ -1,5 +1,6 @@
- content_for :head do
= javascript_include_tag "announcement_refresh"
+ = javascript_include_tag "toicontest"
= user_title_bar(@user)
@@ -48,3 +49,11 @@
= "Announcement.refreshUrl = '#{url_for :controller => 'main', :action => 'announcements'}';"
Announcement.registerRefreshEventTimer();
+ TOIContest.timeOuts = {};
+ - @problems.each do |p|
+ - if (@submission_timeouts.has_key? p.id) and (@submission_timeouts[p.id] != nil)
+ = "TOIContest.timeOuts[#{p.id}] = #{@submission_timeouts[p.id]};"
+ - else
+ = "TOIContest.timeOuts[#{p.id}] = TOIContest.NO_TIMEOUT;"
+
+ TOIContest.refreshTimeOutMessages();