diff --git a/lib/grader_script.rb b/lib/grader_script.rb --- a/lib/grader_script.rb +++ b/lib/grader_script.rb @@ -33,6 +33,7 @@ GraderScript.call_grader "#{env} test_request -err-log &" end + #call the import problem script def self.call_import_problem(problem_name, problem_dir, time_limit=1, @@ -49,10 +50,25 @@ output = `#{cmd}` Dir.chdir(cur_dir) - + return "import CMD: #{cmd}\n" + output end return '' end + def self.call_import_testcase(problem_name) + if GraderScript.grader_control_enabled? + cur_dir = `pwd`.chomp + Dir.chdir(GRADER_ROOT_DIR) + + script_name = File.join(GRADER_ROOT_DIR, "scripts/load_testcase") + cmd = "#{script_name} #{problem_name}" + + output = `#{cmd}` + + Dir.chdir(cur_dir) + return "Testcase import result:\n" + output + end + end + end