Description:
fixed empty main/test bug
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@90 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
r41:25eaa3e37851 - - 1 file changed: 5 inserted, 3 deleted
@@ -1,30 +1,29 | |||||
|
1 | <h2>Test Interface</h2> |
|
1 | <h2>Test Interface</h2> |
|
2 |
|
2 | ||
|
3 | <% if @problems.length==0 %> |
|
3 | <% if @problems.length==0 %> |
|
4 |
- |
|
4 | + There is no submission |
|
5 | - <% return %> |
|
5 | + <% else %> |
|
6 | - <% end %> |
|
||
|
7 |
|
6 | ||
|
8 | <script type="text/javascript"> |
|
7 | <script type="text/javascript"> |
|
9 | var submissionCount = { |
|
8 | var submissionCount = { |
|
10 | <% @submissions.each do |submission| %> |
|
9 | <% @submissions.each do |submission| %> |
|
11 | <%= submission.problem_id %> : <%= submission.number %>, |
|
10 | <%= submission.problem_id %> : <%= submission.number %>, |
|
12 | <% end %> |
|
11 | <% end %> |
|
13 | }; |
|
12 | }; |
|
14 | function updateSubmissionList() { |
|
13 | function updateSubmissionList() { |
|
15 | currentProb = document.getElementById("test_request_problem_id").value; |
|
14 | currentProb = document.getElementById("test_request_problem_id").value; |
|
16 | count = submissionCount[currentProb]; |
|
15 | count = submissionCount[currentProb]; |
|
17 | submissionSelect = document.getElementById("test_request_submission_number"); |
|
16 | submissionSelect = document.getElementById("test_request_submission_number"); |
|
18 | submissionSelect.options.length = 0; |
|
17 | submissionSelect.options.length = 0; |
|
19 | for(i=0; i<count; i++) { |
|
18 | for(i=0; i<count; i++) { |
|
20 | submissionSelect.options[i] = new Option(""+(i+1),""+(i+1),false,false); |
|
19 | submissionSelect.options[i] = new Option(""+(i+1),""+(i+1),false,false); |
|
21 | } |
|
20 | } |
|
22 | } |
|
21 | } |
|
23 | </script> |
|
22 | </script> |
|
24 |
|
23 | ||
|
25 | <% form_for :test_request, nil, |
|
24 | <% form_for :test_request, nil, |
|
26 | :url => { :action => 'test_submit'}, |
|
25 | :url => { :action => 'test_submit'}, |
|
27 | :html => { :multipart => true } do |f| %> |
|
26 | :html => { :multipart => true } do |f| %> |
|
28 | <table> |
|
27 | <table> |
|
29 | <tr> |
|
28 | <tr> |
|
30 | <td>Task:</td> |
|
29 | <td>Task:</td> |
@@ -44,24 +43,27 | |||||
|
44 | </td> |
|
43 | </td> |
|
45 | </tr> |
|
44 | </tr> |
|
46 | <tr> |
|
45 | <tr> |
|
47 | <td>Input data:</td> |
|
46 | <td>Input data:</td> |
|
48 | <td><%= f.file_field :input_file %></td> |
|
47 | <td><%= f.file_field :input_file %></td> |
|
49 | <tr> |
|
48 | <tr> |
|
50 | <td colspan="2"> |
|
49 | <td colspan="2"> |
|
51 | <%= submit_tag 'submit' %> |
|
50 | <%= submit_tag 'submit' %> |
|
52 | </td> |
|
51 | </td> |
|
53 | </tr> |
|
52 | </tr> |
|
54 | </table> |
|
53 | </table> |
|
55 | <% end %> |
|
54 | <% end %> |
|
56 |
|
55 | ||
|
57 | <h3>Previous requests</h3> |
|
56 | <h3>Previous requests</h3> |
|
58 |
|
57 | ||
|
59 | <table border="1"> |
|
58 | <table border="1"> |
|
60 | <tr> |
|
59 | <tr> |
|
61 | <th></td> |
|
60 | <th></td> |
|
62 | <th>problem</th> |
|
61 | <th>problem</th> |
|
63 | <th>#</th> |
|
62 | <th>#</th> |
|
64 | <th>status</th> |
|
63 | <th>status</th> |
|
65 | </tr> |
|
64 | </tr> |
|
66 | <%= render :partial => 'test_request', :collection => @user.test_requests %> |
|
65 | <%= render :partial => 'test_request', :collection => @user.test_requests %> |
|
67 | </table> |
|
66 | </table> |
|
|
67 | + | ||
|
|
68 | + <% end %> | ||
|
|
69 | + |
You need to be logged in to leave comments.
Login now