Description:
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@230 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r111:9164a14d3d40 - - 1 file changed: 4 inserted, 1 deleted
@@ -10,75 +10,78 | |||||
|
10 | var submissionCount = new Array(); |
|
10 | var submissionCount = new Array(); |
|
11 | <% @submissions.each do |submission| %> |
|
11 | <% @submissions.each do |submission| %> |
|
12 | submissionCount[<%= submission.problem_id %>]=<%= submission.number %>; |
|
12 | submissionCount[<%= submission.problem_id %>]=<%= submission.number %>; |
|
13 | <% end %> |
|
13 | <% end %> |
|
14 |
|
14 | ||
|
15 | function updateSubmissionList() { |
|
15 | function updateSubmissionList() { |
|
16 | currentProb = document.getElementById("test_request_problem_id").value; |
|
16 | currentProb = document.getElementById("test_request_problem_id").value; |
|
17 | count = submissionCount[currentProb]; |
|
17 | count = submissionCount[currentProb]; |
|
18 | submissionSelect = document.getElementById("test_request_submission_number"); |
|
18 | submissionSelect = document.getElementById("test_request_submission_number"); |
|
19 | old_len = submissionSelect.length; |
|
19 | old_len = submissionSelect.length; |
|
20 | // clear the box |
|
20 | // clear the box |
|
21 | for(i=0; i<old_len; i++) |
|
21 | for(i=0; i<old_len; i++) |
|
22 | submissionSelect.remove(0); |
|
22 | submissionSelect.remove(0); |
|
23 | for(i=count; i>=1; i--) { |
|
23 | for(i=count; i>=1; i--) { |
|
24 | try { |
|
24 | try { |
|
25 | submissionSelect.add(new Option(""+i,""+i,false,false),null); |
|
25 | submissionSelect.add(new Option(""+i,""+i,false,false),null); |
|
26 | } catch(ex) { |
|
26 | } catch(ex) { |
|
27 | submissionSelect.add(new Option(""+i,""+i,false,false)); |
|
27 | submissionSelect.add(new Option(""+i,""+i,false,false)); |
|
28 | } |
|
28 | } |
|
29 | } |
|
29 | } |
|
30 | } |
|
30 | } |
|
31 | </script> |
|
31 | </script> |
|
32 |
|
32 | ||
|
33 | <div class="submitbox"> |
|
33 | <div class="submitbox"> |
|
34 | <%= error_messages_for 'submitted_test_request' %> |
|
34 | <%= error_messages_for 'submitted_test_request' %> |
|
35 | <% form_for :test_request, nil, |
|
35 | <% form_for :test_request, nil, |
|
36 | :url => { :action => 'submit'}, |
|
36 | :url => { :action => 'submit'}, |
|
37 | :html => { :multipart => true } do |f| %> |
|
37 | :html => { :multipart => true } do |f| %> |
|
38 | <table> |
|
38 | <table> |
|
39 | <tr> |
|
39 | <tr> |
|
40 | <td>Task:</td> |
|
40 | <td>Task:</td> |
|
41 | <td> |
|
41 | <td> |
|
42 | <%= select(:test_request, |
|
42 | <%= select(:test_request, |
|
43 | :problem_id, |
|
43 | :problem_id, |
|
44 | @problems.collect {|p| [p.name, p.id]}, {}, |
|
44 | @problems.collect {|p| [p.name, p.id]}, {}, |
|
45 | { :onclick => "updateSubmissionList();" }) %> |
|
45 | { :onclick => "updateSubmissionList();" }) %> |
|
46 | </td> |
|
46 | </td> |
|
47 | </tr> |
|
47 | </tr> |
|
48 | <tr> |
|
48 | <tr> |
|
49 | <td>Submission:</td> |
|
49 | <td>Submission:</td> |
|
50 | <td> |
|
50 | <td> |
|
51 | <%= select(:test_request, |
|
51 | <%= select(:test_request, |
|
52 | :submission_number, |
|
52 | :submission_number, |
|
53 | ((1..@submissions[0].number).collect {|n| [n,n]}).reverse) %> |
|
53 | ((1..@submissions[0].number).collect {|n| [n,n]}).reverse) %> |
|
54 | </td> |
|
54 | </td> |
|
55 | </tr> |
|
55 | </tr> |
|
56 | <tr> |
|
56 | <tr> |
|
57 | <td>Input data:</td> |
|
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 | <tr> |
|
62 | <tr> |
|
60 | <td colspan="2"> |
|
63 | <td colspan="2"> |
|
61 | <%= submit_tag 'submit' %> |
|
64 | <%= submit_tag 'submit' %> |
|
62 | </td> |
|
65 | </td> |
|
63 | </tr> |
|
66 | </tr> |
|
64 | </table> |
|
67 | </table> |
|
65 | <% end %> |
|
68 | <% end %> |
|
66 | </div> |
|
69 | </div> |
|
67 |
|
70 | ||
|
68 | <h3>Previous requests</h3> |
|
71 | <h3>Previous requests</h3> |
|
69 |
|
72 | ||
|
70 | <table class="info"> |
|
73 | <table class="info"> |
|
71 | <tr class="info-head"> |
|
74 | <tr class="info-head"> |
|
72 | <th>at</th> |
|
75 | <th>at</th> |
|
73 | <th>problem</th> |
|
76 | <th>problem</th> |
|
74 | <th>sub #</th> |
|
77 | <th>sub #</th> |
|
75 | <th>status</th> |
|
78 | <th>status</th> |
|
76 | <th>output (first 2kb)</th> |
|
79 | <th>output (first 2kb)</th> |
|
77 | <th>compiler message</th> |
|
80 | <th>compiler message</th> |
|
78 | <th>detail</th> |
|
81 | <th>detail</th> |
|
79 | </tr> |
|
82 | </tr> |
|
80 | <%= render :partial => 'test_request', :collection => @test_requests %> |
|
83 | <%= render :partial => 'test_request', :collection => @test_requests %> |
|
81 | </table> |
|
84 | </table> |
|
82 |
|
85 | ||
|
83 | <% end %> |
|
86 | <% end %> |
|
84 |
|
87 |
You need to be logged in to leave comments.
Login now