Show More
Commit Description:
MERGED 308:HEAD from http://theory.cpe.ku.ac.th/grader/web/branches/ytopc08-2/, removed some registration info...
Commit Description:
MERGED 308:HEAD from http://theory.cpe.ku.ac.th/grader/web/branches/ytopc08-2/, removed some registration info git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@359 6386c4cd-e34a-4fa8-8920-d93eb39b512e
File last commit:
Show/Diff file:
Action:
app/views/test/index.html.erb | 99 lines | 2.5 KiB | text/plain | TextLexer |
<%= user_title_bar(@user) %>
<h2><%=t 'test.title' %></h2>
<div class="test-desc">
<%=t 'test.intro' %><br/>
<% if Configuration['contest.test_request.early_timeout'] %>
<%=t 'test.disabled_at_end_announcement' %>
<% end %>
</div>
<% if @problems.length==0 %>
There is no submission
<% else %>
<script type="text/javascript">
var submissionCount = new Array();
<% @submissions.each do |submission| %>
submissionCount[<%= submission.problem_id %>]=<%= submission.number %>;
<% end %>
function updateSubmissionList() {
currentProb = document.getElementById("test_request_problem_id").value;
count = submissionCount[currentProb];
submissionSelect = document.getElementById("test_request_submission_number");
old_len = submissionSelect.length;
// clear the box
for(i=0; i<old_len; i++)
submissionSelect.remove(0);
for(i=count; i>=1; i--) {
try {
submissionSelect.add(new Option(""+i,""+i,false,false),null);
} catch(ex) {
submissionSelect.add(new Option(""+i,""+i,false,false));
}
}
}
</script>
<% if Configuration.show_submitbox_to?(@user) and Configuration.allow_test_request(@user) %>
<div class="submitbox">
<%= error_messages_for 'submitted_test_request' %>
<% form_for :test_request, nil,
:url => { :action => 'submit'},
:html => { :multipart => true } do |f| %>
<table>
<tr>
<td>Task:</td>
<td>
<%= select(:test_request,
:problem_id,
@problems.collect {|p| [p.name, p.id]}, {},
{ :onclick => "updateSubmissionList();" }) %>
</td>
</tr>
<tr>
<td>Submission:</td>
<td>
<%= select(:test_request,
:submission_number,
((1..@submissions[0].number).collect {|n| [n,n]}).reverse) %>
</td>
</tr>
<tr>
<td>Input data:</td>
<td>
<%= f.file_field :input_file %>
</td>
<td>
(combined size should not exceed 2MB)
</td>
</tr>
<tr>
<td colspan="2">
<%= submit_tag 'submit' %>
</td>
</tr>
</table>
<% end %>
</div>
<% end %>
<h3>Previous requests</h3>
<table class="info">
<tr class="info-head">
<th>at</th>
<th>problem</th>
<th>sub #</th>
<th>status</th>
<th>output (first 2kb)</th>
<th>compiler message</th>
<th>detail</th>
</tr>
<%= render :partial => 'test_request', :collection => @test_requests %>
</table>
<% end %>