# HG changeset patch # User Jittat Fakcharoenphol # Date 2012-10-13 01:05:08 # Node ID 358ad0e58c64bb1f89d0f2533a40cabe8c29edee # Parent f512a445945b742d0712c1986afe6531f389a8c6 fixed errors on test request: Rails.root is not a string, no errors.length diff --git a/app/controllers/test_controller.rb b/app/controllers/test_controller.rb --- a/app/controllers/test_controller.rb +++ b/app/controllers/test_controller.rb @@ -19,7 +19,7 @@ @submitted_test_request = TestRequest.new_from_form_params(@user,params[:test_request]) - if @submitted_test_request.errors.length != 0 + if ! @submitted_test_request.errors.empty? prepare_index_information render :action => 'index' and return end diff --git a/config/initializers/cafe_grader_config.rb.SAMPLE b/config/initializers/cafe_grader_config.rb.SAMPLE --- a/config/initializers/cafe_grader_config.rb.SAMPLE +++ b/config/initializers/cafe_grader_config.rb.SAMPLE @@ -5,12 +5,12 @@ GRADER_ROOT_DIR = '' # These are where inputs and outputs of test requests are stored -TEST_REQUEST_INPUT_FILE_DIR = Rails.root + '/data/test_request/input' -TEST_REQUEST_OUTPUT_FILE_DIR = Rails.root + '/data/test_request/output' +TEST_REQUEST_INPUT_FILE_DIR = (Rails.root + 'data/test_request/input').to_s +TEST_REQUEST_OUTPUT_FILE_DIR = (Rails.root + 'data/test_request/output').to_s # To use ANALYSIS MODE, provide the testcases/testruns breakdown, # and the directory of the grading result (usually in judge's dir). -TASK_GRADING_INFO_FILENAME = Rails.root + '/config/tasks.yml' +TASK_GRADING_INFO_FILENAME = Rails.root + 'config/tasks.yml' # TODO: change this to where results are kept. GRADING_RESULT_DIR = 'RESULT-DIR'