|
|
<% selected_problem_id = @current_problem ? @current_problem.id : -1 %>
|
|
|
<div class="submitbox">
|
|
|
<b>Problem:</b> <%= select 'submission', 'problem_id',
|
|
|
[['กรุณาเลือกข้อที่ต้องการส่งหรือทดสอบ','-1']] +
|
|
|
@problems.collect {|p| [p.full_name, p.id]},
|
|
|
{ :selected => selected_problem_id },
|
|
|
{ :onchange => 'TOIContest.problemSelectClick()' } %>
|
|
|
</div>
|
|
|
|
|
|
<% @problems.each do |problem| %>
|
|
|
<div class="submission-submit-divs" id="submission_submit_div_<%= problem.id %>_id" style="display: none;">
|
|
|
<div style="border: 1px solid #c0c0c0; padding: 5px; margin: 5px 0 5px 0;">
|
|
|
<b><%= problem.full_name %>: ข้อมูลสำหรับตรวจสอบ</b> (สามารถดาวน์โหลดและส่งกี่ครั้งก็ได้,ไม่มีคะแนน):
|
|
|
<%= link_to 'ดาวน์โหลด input', :action => 'verifying_testcase', :id => problem.id %>
|
|
|
<% if @current_problem and @current_problem.id == problem.id %>
|
|
|
<% if @grading_result %>
|
|
|
| <b>ผลการตรวจ:</b> <%= "#{@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 %>
|
|
|
</div>
|
|
|
<div style="border: 1px solid #c0c0c0; padding: 5px; margin: 5px 0 5px 0;">
|
|
|
<b><%= problem.full_name %>: ข้อมูลทดสอบจริง</b> (ส่งกี่ครั้งก็ได้ภายในเวลา 5 นาทีหลังดาวน์โหลด):
|
|
|
<%= link_to 'ดาวน์โหลด input และเริ่มจับเวลา', { :action => 'testcase', :id => problem.id}, { :onclick => "return TOIContest.confirmDownload(#{problem.id})" } %>
|
|
|
<span id="submission_time_left_<%= problem.id %>_id"></span>
|
|
|
<%= 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 %>
|
|
|
</div>
|
|
|
</div>
|
|
|
<% end %>
|
|
|
|