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