@@ -61,7 +61,7 @@ def get_official_solution() -> Optional[str]:
6161 return None
6262
6363
64- def gen_testcases (copy_compiled : bool ) -> Dict [int , Subtask ]:
64+ def gen_testcases (copy_compiled : bool , task : Task ) -> Dict [int , Subtask ]:
6565 subtasks = {} # type: Dict[int, Subtask]
6666
6767 def create_subtask (subtask_num : int , testcases : Dict [int , TestCase ],
@@ -77,15 +77,15 @@ def create_subtask(subtask_num: int, testcases: Dict[int, TestCase],
7777 else :
7878 generator = Generator (
7979 "default" ,
80- SourceFile .from_file (generator , copy_compiled and "bin/generator" ),
81- None )
80+ SourceFile .from_file (generator , task . name , copy_compiled
81+ and "bin/generator" ), None )
8282 validator = get_validator ()
8383 if not validator :
8484 raise RuntimeError ("No validator found" )
8585 validator = Validator (
8686 "default" ,
87- SourceFile .from_file (validator , copy_compiled and "bin/validator" ),
88- None )
87+ SourceFile .from_file (validator , task . name , copy_compiled
88+ and "bin/validator" ), None )
8989
9090 current_testcases = {} # type: Dict[int, TestCase]
9191 subtask_num = - 1 # the first #ST line will skip a subtask!
@@ -227,22 +227,23 @@ def create_task(config: Config):
227227 if official_solution :
228228 task .official_solution = SourceFile .from_file (
229229 official_solution ,
230+ task .name ,
230231 copy_compiled and "bin/official_solution" ,
231232 grader_map = grader_map )
232233
233234 if checker is not None :
234- task .checker = SourceFile .from_file (checker , copy_compiled
235+ task .checker = SourceFile .from_file (checker , task . name , copy_compiled
235236 and "bin/checker" )
236237 if manager is not None :
237- task .checker = SourceFile .from_file (manager , copy_compiled
238+ task .checker = SourceFile .from_file (manager , task . name , copy_compiled
238239 and "bin/manager" )
239240
240241 sols = [] # type: List[Solution]
241242 for solution in solutions :
242243 path , ext = os .path .splitext (os .path .basename (solution ))
243244 bin_file = copy_compiled and "bin/" + path + "_" + ext [1 :]
244245 source = SourceFile .from_file (
245- solution , bin_file , grader_map = grader_map )
246+ solution , task . name , bin_file , grader_map = grader_map )
246247 if task .task_type == TaskType .Batch :
247248 sols .append (BatchSolution (source , task , config , task .checker ))
248249 else :
@@ -255,7 +256,7 @@ def create_task(config: Config):
255256
256257def get_request (config : Config ) -> (Task , List [Solution ]):
257258 task , sols = create_task (config )
258- subtasks = gen_testcases (config .copy_exe )
259+ subtasks = gen_testcases (config .copy_exe , task )
259260 for subtask_num , subtask in subtasks .items ():
260261 task .subtasks [subtask_num ] = subtask
261262 return task , sols
@@ -272,8 +273,8 @@ def evaluate_task(frontend: Frontend, task: Task, solutions: List[Solution],
272273 curses_ui .start ()
273274
274275 ins , outs , vals = generate_inputs (frontend , task , ui_interface , config )
275- evaluate_solutions (frontend , ins , outs , vals , solutions ,
276- ui_interface , config )
276+ evaluate_solutions (frontend , ins , outs , vals , solutions , ui_interface ,
277+ config )
277278
278279 frontend .evaluate ()
279280 if config .ui == UIS .CURSES :
@@ -386,11 +387,11 @@ def add_non_solution(source: SourceFile):
386387 return inputs , outputs , validations
387388
388389
389- def evaluate_solutions (
390- frontend , inputs : Dict [Tuple [int , int ], File ],
391- outputs : Dict [Tuple [int , int ], File ],
392- validations : Dict [ Tuple [ int , int ], File ], solutions : List [Solution ],
393- interface : IOIUIInterface , config : Config ):
390+ def evaluate_solutions (frontend , inputs : Dict [ Tuple [ int , int ], File ],
391+ outputs : Dict [Tuple [int , int ], File ],
392+ validations : Dict [Tuple [int , int ], File ],
393+ solutions : List [Solution ], interface : IOIUIInterface ,
394+ config : Config ):
394395 for solution in solutions :
395396 solution .solution .prepare (frontend , config )
396397 interface .add_solution (solution .solution )
0 commit comments