Description:
fixed errors on test request: Rails.root is not a string, no errors.length
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r341:358ad0e58c64 - - 2 files changed: 4 inserted, 4 deleted
@@ -1,46 +1,46 | |||
|
1 | 1 | class TestController < ApplicationController |
|
2 | 2 | |
|
3 | 3 | before_filter :authenticate, :check_viewability |
|
4 | 4 | |
|
5 | 5 | # |
|
6 | 6 | # COMMENT OUT: filter in each action instead |
|
7 | 7 | # |
|
8 | 8 | # before_filter :verify_time_limit, :only => [:submit] |
|
9 | 9 | |
|
10 | 10 | verify :method => :post, :only => [:submit], |
|
11 | 11 | :redirect_to => { :action => :index } |
|
12 | 12 | |
|
13 | 13 | def index |
|
14 | 14 | prepare_index_information |
|
15 | 15 | end |
|
16 | 16 | |
|
17 | 17 | def submit |
|
18 | 18 | @user = User.find(session[:user_id]) |
|
19 | 19 | |
|
20 | 20 | @submitted_test_request = TestRequest.new_from_form_params(@user,params[:test_request]) |
|
21 | 21 | |
|
22 |
- if @submitted_test_request.errors. |
|
|
22 | + if ! @submitted_test_request.errors.empty? | |
|
23 | 23 | prepare_index_information |
|
24 | 24 | render :action => 'index' and return |
|
25 | 25 | end |
|
26 | 26 | |
|
27 | 27 | if GraderConfiguration.time_limit_mode? |
|
28 | 28 | if @user.contest_finished? |
|
29 | 29 | @submitted_test_request.errors.add_to_base('Contest is over.') |
|
30 | 30 | prepare_index_information |
|
31 | 31 | render :action => 'index' and return |
|
32 | 32 | end |
|
33 | 33 | |
|
34 | 34 | if !GraderConfiguration.allow_test_request(@user) |
|
35 | 35 | prepare_index_information |
|
36 | 36 | flash[:notice] = 'Test request is not allowed during the last 30 minutes' |
|
37 | 37 | redirect_to :action => 'index' and return |
|
38 | 38 | end |
|
39 | 39 | end |
|
40 | 40 | |
|
41 | 41 | if @submitted_test_request.save |
|
42 | 42 | redirect_to :action => 'index' |
|
43 | 43 | else |
|
44 | 44 | prepare_index_information |
|
45 | 45 | render :action => 'index' |
|
46 | 46 | end |
@@ -1,30 +1,30 | |||
|
1 | 1 | # If you want to manage graders through web interface, set the path to |
|
2 | 2 | # the grader directory below. This dir is where raw, ev, ev-exam, |
|
3 | 3 | # scripts reside. All grader scripts will be in |
|
4 | 4 | # #{GRADER_ROOT_DIR}/scripts. |
|
5 | 5 | GRADER_ROOT_DIR = '' |
|
6 | 6 | |
|
7 | 7 | # These are where inputs and outputs of test requests are stored |
|
8 |
- TEST_REQUEST_INPUT_FILE_DIR = Rails.root + ' |
|
|
9 |
- TEST_REQUEST_OUTPUT_FILE_DIR = Rails.root + ' |
|
|
8 | + TEST_REQUEST_INPUT_FILE_DIR = (Rails.root + 'data/test_request/input').to_s | |
|
9 | + TEST_REQUEST_OUTPUT_FILE_DIR = (Rails.root + 'data/test_request/output').to_s | |
|
10 | 10 | |
|
11 | 11 | # To use ANALYSIS MODE, provide the testcases/testruns breakdown, |
|
12 | 12 | # and the directory of the grading result (usually in judge's dir). |
|
13 |
- TASK_GRADING_INFO_FILENAME = Rails.root + ' |
|
|
13 | + TASK_GRADING_INFO_FILENAME = Rails.root + 'config/tasks.yml' | |
|
14 | 14 | |
|
15 | 15 | # TODO: change this to where results are kept. |
|
16 | 16 | GRADING_RESULT_DIR = 'RESULT-DIR' |
|
17 | 17 | |
|
18 | 18 | # Change this to allow importing testdata into database as test-pairs. |
|
19 | 19 | # This is mainly for Code Jom contest. |
|
20 | 20 | ALLOW_TEST_PAIR_IMPORT = false |
|
21 | 21 | |
|
22 | 22 | # Uncomment so that the system validates user e-mails |
|
23 | 23 | # VALIDATE_USER_EMAILS = true |
|
24 | 24 | |
|
25 | 25 | # Uncomment so that Apache X-Sendfile is used when delivering files |
|
26 | 26 | # (e.g., in /tasks/view). |
|
27 | 27 | # USE_APACHE_XSENDFILE = true |
|
28 | 28 | |
|
29 | 29 | # Uncomment so that configuration is read only once when the server is loaded |
|
30 | 30 | # CONFIGURATION_CACHE_ENABLED = true |
You need to be logged in to leave comments.
Login now