Description:
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@230 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r111:9164a14d3d40 - - 1 file changed: 4 inserted, 1 deleted

@@ -10,75 +10,78
10 10 var submissionCount = new Array();
11 11 <% @submissions.each do |submission| %>
12 12 submissionCount[<%= submission.problem_id %>]=<%= submission.number %>;
13 13 <% end %>
14 14
15 15 function updateSubmissionList() {
16 16 currentProb = document.getElementById("test_request_problem_id").value;
17 17 count = submissionCount[currentProb];
18 18 submissionSelect = document.getElementById("test_request_submission_number");
19 19 old_len = submissionSelect.length;
20 20 // clear the box
21 21 for(i=0; i<old_len; i++)
22 22 submissionSelect.remove(0);
23 23 for(i=count; i>=1; i--) {
24 24 try {
25 25 submissionSelect.add(new Option(""+i,""+i,false,false),null);
26 26 } catch(ex) {
27 27 submissionSelect.add(new Option(""+i,""+i,false,false));
28 28 }
29 29 }
30 30 }
31 31 </script>
32 32
33 33 <div class="submitbox">
34 34 <%= error_messages_for 'submitted_test_request' %>
35 35 <% form_for :test_request, nil,
36 36 :url => { :action => 'submit'},
37 37 :html => { :multipart => true } do |f| %>
38 38 <table>
39 39 <tr>
40 40 <td>Task:</td>
41 41 <td>
42 42 <%= select(:test_request,
43 43 :problem_id,
44 44 @problems.collect {|p| [p.name, p.id]}, {},
45 45 { :onclick => "updateSubmissionList();" }) %>
46 46 </td>
47 47 </tr>
48 48 <tr>
49 49 <td>Submission:</td>
50 50 <td>
51 51 <%= select(:test_request,
52 52 :submission_number,
53 53 ((1..@submissions[0].number).collect {|n| [n,n]}).reverse) %>
54 54 </td>
55 55 </tr>
56 56 <tr>
57 57 <td>Input data:</td>
58 - <td><%= f.file_field :input_file %></td>
58 + <td>
59 + <%= f.file_field :input_file %>
60 + (should be smaller than 2MB)
61 + </td>
59 62 <tr>
60 63 <td colspan="2">
61 64 <%= submit_tag 'submit' %>
62 65 </td>
63 66 </tr>
64 67 </table>
65 68 <% end %>
66 69 </div>
67 70
68 71 <h3>Previous requests</h3>
69 72
70 73 <table class="info">
71 74 <tr class="info-head">
72 75 <th>at</th>
73 76 <th>problem</th>
74 77 <th>sub #</th>
75 78 <th>status</th>
76 79 <th>output (first 2kb)</th>
77 80 <th>compiler message</th>
78 81 <th>detail</th>
79 82 </tr>
80 83 <%= render :partial => 'test_request', :collection => @test_requests %>
81 84 </table>
82 85
83 86 <% end %>
84 87
You need to be logged in to leave comments. Login now