# HG changeset patch # User Nattee Niparnan # Date 2014-08-14 11:00:18 # Node ID d3662f88d75cbe33474c182cca91046c6ac6baa5 # Parent 32806d01febdb15706834a253e9a648066465b02 let testdata importer set the full score diff --git a/lib/testdata_importer.rb b/lib/testdata_importer.rb --- a/lib/testdata_importer.rb +++ b/lib/testdata_importer.rb @@ -34,6 +34,7 @@ @log_msg << import_problem_description(dirname) @log_msg << import_problem_pdf(dirname) + @log_msg << import_full_score(dirname) return true end @@ -169,4 +170,14 @@ end end + #just set the full score to the total number of test case + #it is not perfect but works on most normal use case + def import_full_score(dirname) + in_file = Dir["#{dirname}/*.in"] + full_score =in_file.length * 10 + @problem.full_score = full_score + @problem.save + return "\nFull score is set to #{full_score}." + end + end