Show More
Commit Description:
fix bug on calculating best of each lanuage
Commit Description:
fix bug on calculating best of each lanuage
References:
File last commit:
Show/Diff file:
Action:
app/views/test/index.html.erb
| 99 lines
| 2.5 KiB
| text/plain
| TextLexer
|
|
r78 | <%= user_title_bar(@user) %> | ||
|
r162 | <h2><%=t 'test.title' %></h2> | ||
|
r44 | |||
|
r162 | <div class="test-desc"> | ||
<%=t 'test.intro' %><br/> | ||||
|
r320 | <% if GraderConfiguration['contest.test_request.early_timeout'] %> | ||
|
r162 | <%=t 'test.disabled_at_end_announcement' %> | ||
<% end %> | ||||
</div> | ||||
|
r125 | |||
|
r44 | <% if @problems.length==0 %> | ||
There is no submission | ||||
<% else %> | ||||
<script type="text/javascript"> | ||||
|
r69 | var submissionCount = new Array(); | ||
|
r44 | <% @submissions.each do |submission| %> | ||
|
r69 | submissionCount[<%= submission.problem_id %>]=<%= submission.number %>; | ||
|
r44 | <% end %> | ||
|
r69 | |||
|
r44 | function updateSubmissionList() { | ||
currentProb = document.getElementById("test_request_problem_id").value; | ||||
count = submissionCount[currentProb]; | ||||
submissionSelect = document.getElementById("test_request_submission_number"); | ||||
|
r69 | 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)); | ||||
} | ||||
|
r44 | } | ||
} | ||||
</script> | ||||
|
r320 | <% if GraderConfiguration.show_submitbox_to?(@user) and GraderConfiguration.allow_test_request(@user) %> | ||
|
r122 | <div class="submitbox"> | ||
<%= error_messages_for 'submitted_test_request' %> | ||||
|
r322 | <%= form_for :test_request, | ||
|
r122 | :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> | ||||
|
r44 | <% end %> | ||
<h3>Previous requests</h3> | ||||
|
r51 | <table class="info"> | ||
<tr class="info-head"> | ||||
|
r65 | <th>at</th> | ||
|
r57 | <th>problem</th> | ||
|
r65 | <th>sub #</th> | ||
|
r57 | <th>status</th> | ||
<th>output (first 2kb)</th> | ||||
<th>compiler message</th> | ||||
|
r84 | <th>detail</th> | ||
|
r44 | </tr> | ||
|
r64 | <%= render :partial => 'test_request', :collection => @test_requests %> | ||
|
r44 | </table> | ||
<% end %> | ||||