File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ class Metadata2023_07(BaseModel):
113113
114114 problem_format_version : str
115115 name : dict [str , str ] | str
116- uuid : UUID
116+ uuid : UUID | None = None # UUID *is* mandatory, but we deal with that in verifyproblem for better UX
117117 type : list [ProblemType ] | ProblemType = ProblemType .PASS_FAIL
118118 version : str | None = None
119119 credits : dict | str | None = None
Original file line number Diff line number Diff line change 22# -*- coding: utf-8 -*-
33from __future__ import annotations
44
5+ import argparse
56import concurrent .futures
67from concurrent .futures import ThreadPoolExecutor
78import threading
2021import copy
2122import random
2223import traceback
23-
24- import argparse
24+ import uuid
2525
2626import yaml
2727
@@ -875,6 +875,13 @@ def check(self, context: Context) -> bool:
875875 if self ._metadata .license == metadata .License .UNKNOWN :
876876 self .warning ("License is 'unknown'" )
877877
878+ if self ._metadata .uuid is None :
879+ uuid_msg = f'Missing uuid from problem.yaml. Add "uuid: { uuid .uuid4 ()} " to problem.yaml.'
880+ if self .problem .format .name == formatversion .VERSION_LEGACY :
881+ self .warning (uuid_msg )
882+ else :
883+ self .error (uuid_msg )
884+
878885 if self ._metadata .legacy_grading .show_test_data_groups and self ._metadata .is_pass_fail ():
879886 self .error ('Showing test data groups is only supported for scoring problems, this is a pass-fail problem' )
880887 if (
You can’t perform that action at this time.
0 commit comments