@@ -867,6 +867,10 @@ def check(self, context: Context) -> bool:
867867 if self ._metadata .uuid is None :
868868 self .error_in_2023_07 (f'Missing uuid from problem.yaml. Add "uuid: { uuid .uuid4 ()} " to problem.yaml.' )
869869
870+ names_with_no_statement = [lang for lang in self ._metadata .name if lang not in self .problem .statement .statements ]
871+ if names_with_no_statement :
872+ self .error (f'Names exist for languages without problem statements: { ", " .join (names_with_no_statement )} ' )
873+
870874 if self ._metadata .legacy_grading .show_test_data_groups and self .problem .is_pass_fail ():
871875 self .error ('Showing test data groups is only supported for scoring problems, this is a pass-fail problem' )
872876 if (
@@ -1210,6 +1214,11 @@ def setup(self):
12101214 )
12111215 self ._has_precompiled = False
12121216
1217+ def uses_default_validator (self ) -> bool :
1218+ if self .problem .format is FormatVersion .LEGACY :
1219+ return self .problem .metadata .legacy_validation == 'default'
1220+ return not self ._validators
1221+
12131222 def __str__ (self ) -> str :
12141223 return 'output validators'
12151224
@@ -1234,12 +1243,15 @@ def check(self, context: Context) -> bool:
12341243 f'Output validator in { v .language .name } . Only { safe_output_validator_languages } are standardized. Check carefully if your CCS supports more (Kattis does not).'
12351244 )
12361245
1237- if self .problem .metadata .legacy_validation == 'default' and self ._validators :
1246+ if len (self ._validators ) > 1 :
1247+ self .error_in_2023_07 ('Found more than one output validator. This was allowed in legacy (but not on Kattis)' )
1248+
1249+ if self .uses_default_validator () and self ._validators :
12381250 self .error ('There are validator programs but problem.yaml has validation = "default"' )
1239- elif self .problem . metadata . legacy_validation . startswith ( 'custom' ) and not self ._validators :
1251+ elif not self .uses_default_validator ( ) and not self ._validators :
12401252 self .fatal ('problem.yaml specifies custom validator but no validator programs found' )
12411253
1242- if self .problem . metadata . legacy_validation == 'default' and self ._default_validator is None :
1254+ if self .uses_default_validator () and self ._default_validator is None :
12431255 self .fatal ('Unable to locate default validator' )
12441256
12451257 for val in self ._validators [:]:
@@ -1332,10 +1344,9 @@ def _parse_validator_results(self, val, status: int, feedbackdir, testcase: Test
13321344 return SubmissionResult ('AC' , score = score )
13331345
13341346 def _actual_validators (self ) -> list :
1335- vals = self ._validators
1336- if self .problem .metadata .legacy_validation == 'default' or (self .problem .format is FormatVersion .V_2023_07 and not vals ):
1337- vals = [self ._default_validator ]
1338- return [val for val in vals if val is not None ]
1347+ if self .uses_default_validator ():
1348+ return [self ._default_validator ]
1349+ return self ._validators
13391350
13401351 def validate_interactive (self , testcase : TestCase , submission , timelim : int , errorhandler : Submissions ) -> SubmissionResult :
13411352 # This may be called off-main thread.
@@ -1401,7 +1412,6 @@ def validate_interactive(self, testcase: TestCase, submission, timelim: int, err
14011412 shutil .rmtree (feedbackdir )
14021413 if res .verdict != 'AC' :
14031414 return res
1404- # TODO: check that all output validators give same result
14051415 return res
14061416
14071417 def validate (self , testcase : TestCase , submission_output : str ) -> SubmissionResult :
@@ -1800,6 +1810,7 @@ def load(self) -> None:
18001810 self .graders = Graders (self )
18011811 self .testdata = TestCaseGroup (self , os .path .join (self .probdir , 'data' ))
18021812 self .submissions = Submissions (self )
1813+ self .loaded = True
18031814
18041815 def __enter__ (self ) -> Problem :
18051816 self .tmpdir = tempfile .mkdtemp (prefix = f'verify-{ self .shortname } -' )
0 commit comments