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
@@ -31,12 +31,13 | |||
|
31 | 31 | @log_msg = "Importing test pair failed. (0 test pairs imported)" |
|
32 | 32 | end |
|
33 | 33 | end |
|
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 |
|
40 | 41 | |
|
41 | 42 | protected |
|
42 | 43 | |
@@ -166,7 +167,17 | |||
|
166 | 167 | return "\nProblem pdf imported from #{filename}." |
|
167 | 168 | else |
|
168 | 169 | return "" |
|
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}." | |
|
181 | + end | |
|
182 | + | |
|
172 | 183 | end |
You need to be logged in to leave comments.
Login now