diff --git a/app/models/test_request.rb b/app/models/test_request.rb --- a/app/models/test_request.rb +++ b/app/models/test_request.rb @@ -41,8 +41,9 @@ protected def self.input_file_name(user,problem) + problem_name = (problem!=nil) ? problem.name : "" begin - tmpname = UPLOADED_INPUT_FILE_DIR + "/#{user.login}/#{problem.name}/#{rand(10000)}" + tmpname = TEST_REQUEST_INPUT_FILE_DIR + "/#{user.login}/#{problem_name}/#{rand(10000)}" end while File.exists?(tmpname) tmpname end diff --git a/config/environment.rb b/config/environment.rb --- a/config/environment.rb +++ b/config/environment.rb @@ -59,4 +59,5 @@ # Include your application configuration below -UPLOADED_INPUT_FILE_DIR = RAILS_ROOT + '/upload' +TEST_REQUEST_INPUT_FILE_DIR = RAILS_ROOT + '/data/test_request/input' +TEST_REQUEST_OUTPUT_FILE_DIR = RAILS_ROOT + '/data/test_request/output'