Description:
merge to java
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r404:e5811929f1d4 - - 1 file changed: 7 inserted, 2 deleted
@@ -166,20 +166,25 | |||
|
166 | 166 | File.rename(filename, out_filename) |
|
167 | 167 | @problem.description_filename = "#{@problem.name}.pdf" |
|
168 | 168 | @problem.save |
|
169 | 169 | return "\nProblem pdf imported from #{filename}." |
|
170 | 170 | else |
|
171 | 171 | return "" |
|
172 | 172 | end |
|
173 | 173 | end |
|
174 | 174 | |
|
175 | 175 | #just set the full score to the total number of test case |
|
176 | 176 | #it is not perfect but works on most normal use case |
|
177 | 177 | def import_full_score(dirname) |
|
178 | - in_file = Dir["#{dirname}/*.in"] | |
|
179 | - full_score =in_file.length * 10 | |
|
178 | + num = 0 | |
|
179 | + loop do | |
|
180 | + num += 1 | |
|
181 | + in_file = Dir["#{dirname}/#{num}*.in"] | |
|
182 | + break if in_file.length == 0 | |
|
183 | + end | |
|
184 | + full_score = (num - 1) * 10 | |
|
180 | 185 | @problem.full_score = full_score |
|
181 | 186 | @problem.save |
|
182 | 187 | return "\nFull score is set to #{full_score}." |
|
183 | 188 | end |
|
184 | 189 | |
|
185 | 190 | end |
You need to be logged in to leave comments.
Login now