Show More
Commit Description:
fixed bug: increament of number on old records in submission...
Commit Description:
fixed bug: increament of number on old records in submission git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@98 6386c4cd-e34a-4fa8-8920-d93eb39b512e
File last commit:
Show/Diff file:
Action:
app/views/test/index.html.erb | 73 lines | 1.7 KiB | text/plain | TextLexer |
<h2>Test Interface</h2>
<% if @problems.length==0 %>
There is no submission
<% else %>
<script type="text/javascript">
var submissionCount = {
<% @submissions.each do |submission| %>
<%= 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");
submissionSelect.options.length = 0;
for(i=0; i<count; i++) {
submissionSelect.options[i] = new Option(""+(i+1),""+(i+1),false,false);
}
}
</script>
<% 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]}) %>
</td>
</tr>
<tr>
<td>Input data:</td>
<td><%= f.file_field :input_file %></td>
<tr>
<td colspan="2">
<%= submit_tag 'submit' %>
</td>
</tr>
</table>
<% end %>
<h3>Previous requests</h3>
<table border="1">
<tr>
<th></td>
<th>problem</th>
<th>#</th>
<th>status</th>
<th>running stat</th>
<th>output</th>
<th>grading comment</th>
<th>compiler message</th>
</tr>
<%= render :partial => 'test_request', :collection => @user.test_requests %>
</table>
<% end %>