Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion problemtools/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class Metadata2023_07(BaseModel):

problem_format_version: str
name: dict[str, str] | str
uuid: UUID
uuid: UUID | None = None # UUID *is* mandatory, but we deal with that in verifyproblem for better UX
type: list[ProblemType] | ProblemType = ProblemType.PASS_FAIL
version: str | None = None
credits: dict | str | None = None
Expand Down
11 changes: 9 additions & 2 deletions problemtools/verifyproblem.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
from __future__ import annotations

import argparse
import concurrent.futures
from concurrent.futures import ThreadPoolExecutor
import threading
Expand All @@ -20,8 +21,7 @@
import copy
import random
import traceback

import argparse
import uuid

import yaml

Expand Down Expand Up @@ -875,6 +875,13 @@ def check(self, context: Context) -> bool:
if self._metadata.license == metadata.License.UNKNOWN:
self.warning("License is 'unknown'")

if self._metadata.uuid is None:
uuid_msg = f'Missing uuid from problem.yaml. Add "uuid: {uuid.uuid4()}" to problem.yaml.'
if self.problem.format.name == formatversion.VERSION_LEGACY:
self.warning(uuid_msg)
else:
self.error(uuid_msg)

if self._metadata.legacy_grading.show_test_data_groups and self._metadata.is_pass_fail():
self.error('Showing test data groups is only supported for scoring problems, this is a pass-fail problem')
if (
Expand Down