% selected_problem_id = @current_problem ? @current_problem.id : -1 %>
Problem: <%= select 'submission', 'problem_id',
[['กรุณาเลือกข้อที่ต้องการส่งหรือทดสอบ','-1']] +
@problems.collect {|p| [p.full_name, p.id]},
{ :selected => selected_problem_id },
{ :onchange => 'TOIContest.problemSelectClick()' } %>
<% @problems.each do |problem| %>
<%= problem.full_name %>: ข้อมูลสำหรับตรวจสอบ (สามารถดาวน์โหลดและส่งกี่ครั้งก็ได้,ไม่มีคะแนน):
<%= link_to 'ดาวน์โหลด input', :action => 'verifying_testcase', :id => problem.id %>
<% if @current_problem and @current_problem.id == problem.id %>
<% if @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 %>
ส่งคำตอบของข้อมูลสำหรับตรวจสอบ:
<%= file_field_tag 'output_file' %>
<%= submit_tag 'Submit' %>
<% end %>
<%= problem.full_name %>: ข้อมูลทดสอบจริง (ส่งกี่ครั้งก็ได้ภายในเวลา 5 นาทีหลังดาวน์โหลด):
<%= link_to 'ดาวน์โหลด input และเริ่มจับเวลา', { :action => 'testcase', :id => problem.id}, { :onclick => "return TOIContest.confirmDownload(#{problem.id})" } %>
<%= form_tag({:controller => 'main', :action => 'submit'}, {:method => 'post', :multipart => true, :id => "submission_form_#{problem.id}_id" }) do %>
<%= hidden_field_tag 'submission[problem_id]', problem.id %>
ข้อมูลส่งออก: <%= file_field_tag 'output_file' %>
โปรแกรมคำตอบ: <%= file_field_tag 'file' %>
<%= submit_tag 'Submit' %>
<% end %>
<% end %>