Description:
let testdata importer set the full score
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r345:d3662f88d75c - - 1 file changed: 11 inserted, 0 deleted
@@ -34,6 +34,7 | |||
|
34 | 34 | |
|
35 | 35 | @log_msg << import_problem_description(dirname) |
|
36 | 36 | @log_msg << import_problem_pdf(dirname) |
|
37 | + @log_msg << import_full_score(dirname) | |
|
37 | 38 | |
|
38 | 39 | return true |
|
39 | 40 | end |
@@ -169,4 +170,14 | |||
|
169 | 170 | end |
|
170 | 171 | end |
|
171 | 172 | |
|
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 | |
|
175 | + def import_full_score(dirname) | |
|
176 | + in_file = Dir["#{dirname}/*.in"] | |
|
177 | + full_score =in_file.length * 10 | |
|
178 | + @problem.full_score = full_score | |
|
179 | + @problem.save | |
|
180 | + return "\nFull score is set to #{full_score}." | |
|
172 | 181 | end |
|
182 | + | |
|
183 | + end |
You need to be logged in to leave comments.
Login now