Description:
fixed judge craching when some test case is not present git-svn-id: http://theory.cpe.ku.ac.th/grader/judge/trunk/scripts@367 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r67:b65f81409564 - - 1 file changed: 2 inserted, 0 deleted

@@ -104,33 +104,35
104 puts "run #{i} is not present"
104 puts "run #{i} is not present"
105 return false
105 return false
106 end
106 end
107 end
107 end
108
108
109 # Check if all tests are in one and only one run.
109 # Check if all tests are in one and only one run.
110 test_present = []
110 test_present = []
111 (1..(@num_tests)).each do |i|
111 (1..(@num_tests)).each do |i|
112 test_present[i] = false
112 test_present[i] = false
113 end
113 end
114 (1..(@runs.length-1)).each do |j|
114 (1..(@runs.length-1)).each do |j|
115 run = @runs[j]
115 run = @runs[j]
116 + if run.tests!=nil
116 run.tests.each do |t|
117 run.tests.each do |t|
117 if test_present[t] == false
118 if test_present[t] == false
118 test_present[t] = true
119 test_present[t] = true
119 else
120 else
120 puts "test #{t} is present in more than one run"
121 puts "test #{t} is present in more than one run"
121 return false
122 return false
122 end
123 end
123 end
124 end
124 end
125 end
126 + end
125 (1..(@num_tests)).each do |i|
127 (1..(@num_tests)).each do |i|
126 if test_present[i] == false
128 if test_present[i] == false
127 puts "test #{i} is not present"
129 puts "test #{i} is not present"
128 return false
130 return false
129 end
131 end
130 end
132 end
131
133
132 # Check if we can find the score, mem limit, and time limit for all tests.
134 # Check if we can find the score, mem limit, and time limit for all tests.
133 (1..(@num_tests)).each do |i|
135 (1..(@num_tests)).each do |i|
134 begin
136 begin
135 get_score i
137 get_score i
136 rescue
138 rescue
You need to be logged in to leave comments. Login now