# HG changeset patch # User jittat # Date 2008-05-04 15:04:16 # Node ID 7137557e8134b8ce0cee82a61f47af7b0c053c69 # Parent a67009b340d8f403b1733116f1ef5af03ceaa6ac [grader] change test_request_helper so that it copies additional submitted file git-svn-id: http://theory.cpe.ku.ac.th/grader/judge/trunk/scripts@231 6386c4cd-e34a-4fa8-8920-d93eb39b512e diff --git a/lib/runner.rb b/lib/runner.rb --- a/lib/runner.rb +++ b/lib/runner.rb @@ -20,6 +20,7 @@ @engine.grade(submission) task.status_complete! end +# @grader_process.report_inactive if @grader_process!=nil return task end @@ -45,6 +46,8 @@ @engine.grade(test_request) test_request.status_complete! end + +# @grader_process.report_inactive if @grader_process!=nil return test_request end diff --git a/lib/test_request_helper.rb b/lib/test_request_helper.rb --- a/lib/test_request_helper.rb +++ b/lib/test_request_helper.rb @@ -21,6 +21,15 @@ def produce_grading_room(test_request) grading_room = grading_room_dir(test_request) FileUtils.mkdir_p(grading_room) + + # + # Also copy additional submitted file to this directory as well. + # The program would see this file only if it is copied + # to the sandbox directory later. The run script should do it. + # + cmd = "cp #{test_request.input_file_name}.files/* #{grading_room}" + system(cmd) + grading_room end @@ -57,9 +66,10 @@ def grading_room_dir(test_request) problem_name = test_request.problem_name user = test_request.user - "#{@config.user_result_dir}" + + grading_room = "#{@config.user_result_dir}" + "/#{user.login}/test_request" + "/#{problem_name}/#{test_request.id}" + grading_room end def problem_home_dir(test_request)