@@ -297,24 +297,44 @@ def Pack(self, ui, testset):
297
297
ui .errors .Exception (testset )
298
298
yield False
299
299
300
- if len (testset .judges ) > 1 :
300
+ has_reactive = False
301
+ has_custom_judge = False
302
+
303
+ if testset .reactives :
304
+ if len (testset .reactives ) != 1 :
305
+ ui .errors .Error (
306
+ testset ,
307
+ 'Multiple reactive runners is not supported in DOMJudge.' )
308
+ yield False
309
+ if not isinstance (testset .reactives [0 ].variant ,
310
+ DOMJudgeReactiveRunner ):
311
+ ui .errors .Error (
312
+ testset , 'Only domjudge_reactive_runner is supported.' )
313
+ yield False
314
+ has_reactive = True
315
+ elif len (testset .judges ) > 1 :
301
316
ui .errors .Error (
302
317
testset , 'Multiple varidators is not supported in DOMJudge.' )
303
318
yield False
304
319
elif (len (testset .judges ) == 1 and
305
320
not isinstance (testset .judges [0 ], basic_codes .InternalDiffCode
306
321
)):
307
- judge = testset .judges [0 ]
308
-
309
- # TODO(tossy310): support DOMJudgeReactiveRunner
310
- if not isinstance (judge .variant , DOMJudgeJudgeRunner ):
322
+ if not isinstance (testset .judges [0 ].variant , DOMJudgeJudgeRunner ):
311
323
ui .errors .Error (
312
324
testset ,
313
325
'Only domjudge_judge_runner is supported.' )
314
326
yield False
327
+ has_custom_judge = True
328
+
329
+ if has_reactive or has_custom_judge :
330
+ if has_reactive :
331
+ judge = testset .reactives [0 ]
332
+ elif has_custom_judge :
333
+ judge = testset .judges [0 ]
315
334
316
335
validator_dir = os .path .join (
317
336
pack_files_dir , 'output_validators' ,
337
+ testset .problem .name + '_' +
318
338
os .path .splitext (judge .src_name )[0 ])
319
339
files .MakeDir (validator_dir )
320
340
ui .console .PrintAction (
@@ -334,7 +354,10 @@ def Pack(self, ui, testset):
334
354
# TODO: add more data to problem.yaml?
335
355
yaml_file = os .path .join (pack_files_dir , 'problem.yaml' )
336
356
with open (yaml_file , 'w' ) as f :
337
- f .write ('validation: custom\n ' )
357
+ if has_custom_judge :
358
+ f .write ('validation: custom\n ' )
359
+ elif has_reactive :
360
+ f .write ('validation: custom interactive\n ' )
338
361
339
362
if (testset .problem .domjudge_config_defined and
340
363
testset .problem .domjudge_problem_file ):
0 commit comments