# HG changeset patch # User Nattee Niparnan # Date 2014-08-14 17:27:24 # Node ID d02b70f6c47455d79c681c1929af5300c56c18aa # Parent d3662f88d75cbe33474c182cca91046c6ac6baa5 my fault, fixing auto full score to properly handle subtask case diff --git a/lib/testdata_importer.rb b/lib/testdata_importer.rb --- a/lib/testdata_importer.rb +++ b/lib/testdata_importer.rb @@ -173,8 +173,13 @@ #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 + num = 0 + loop do + num += 1 + in_file = Dir["#{dirname}/#{num}*.in"] + break if in_file.length == 0 + end + full_score = (num - 1) * 10 @problem.full_score = full_score @problem.save return "\nFull score is set to #{full_score}."