Description:
[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
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r55:7137557e8134 - - 2 files changed: 14 inserted, 1 deleted
@@ -20,6 +20,7 | |||||
|
20 | @engine.grade(submission) |
|
20 | @engine.grade(submission) |
|
21 | task.status_complete! |
|
21 | task.status_complete! |
|
22 | end |
|
22 | end |
|
|
23 | + # @grader_process.report_inactive if @grader_process!=nil | ||
|
23 | return task |
|
24 | return task |
|
24 | end |
|
25 | end |
|
25 |
|
26 | ||
@@ -45,6 +46,8 | |||||
|
45 | @engine.grade(test_request) |
|
46 | @engine.grade(test_request) |
|
46 | test_request.status_complete! |
|
47 | test_request.status_complete! |
|
47 | end |
|
48 | end |
|
|
49 | + | ||
|
|
50 | + # @grader_process.report_inactive if @grader_process!=nil | ||
|
48 | return test_request |
|
51 | return test_request |
|
49 | end |
|
52 | end |
|
50 |
|
53 |
@@ -21,6 +21,15 | |||||
|
21 | def produce_grading_room(test_request) |
|
21 | def produce_grading_room(test_request) |
|
22 | grading_room = grading_room_dir(test_request) |
|
22 | grading_room = grading_room_dir(test_request) |
|
23 | FileUtils.mkdir_p(grading_room) |
|
23 | FileUtils.mkdir_p(grading_room) |
|
|
24 | + | ||
|
|
25 | + # | ||
|
|
26 | + # Also copy additional submitted file to this directory as well. | ||
|
|
27 | + # The program would see this file only if it is copied | ||
|
|
28 | + # to the sandbox directory later. The run script should do it. | ||
|
|
29 | + # | ||
|
|
30 | + cmd = "cp #{test_request.input_file_name}.files/* #{grading_room}" | ||
|
|
31 | + system(cmd) | ||
|
|
32 | + | ||
|
24 | grading_room |
|
33 | grading_room |
|
25 | end |
|
34 | end |
|
26 |
|
35 | ||
@@ -57,9 +66,10 | |||||
|
57 | def grading_room_dir(test_request) |
|
66 | def grading_room_dir(test_request) |
|
58 | problem_name = test_request.problem_name |
|
67 | problem_name = test_request.problem_name |
|
59 | user = test_request.user |
|
68 | user = test_request.user |
|
60 | - "#{@config.user_result_dir}" + |
|
69 | + grading_room = "#{@config.user_result_dir}" + |
|
61 | "/#{user.login}/test_request" + |
|
70 | "/#{user.login}/test_request" + |
|
62 | "/#{problem_name}/#{test_request.id}" |
|
71 | "/#{problem_name}/#{test_request.id}" |
|
|
72 | + grading_room | ||
|
63 | end |
|
73 | end |
|
64 |
|
74 | ||
|
65 | def problem_home_dir(test_request) |
|
75 | def problem_home_dir(test_request) |
You need to be logged in to leave comments.
Login now