From d94d2f367224fc9c6e2a9576bc3163c4fbce6f41 Mon Sep 17 00:00:00 2001 From: Thore Husfeldt Date: Thu, 12 Dec 2024 16:51:37 +0100 Subject: [PATCH] schema: fledling submissions.cue --- support/schemas/submissions.cue | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 support/schemas/submissions.cue diff --git a/support/schemas/submissions.cue b/support/schemas/submissions.cue new file mode 100644 index 00000000..f00748e0 --- /dev/null +++ b/support/schemas/submissions.cue @@ -0,0 +1,25 @@ +package problemformat + +import "list" + +#person: =~"^[^<]+(<[^>]+>)?$" // "Alice" or "Bob " + +#verdict: "AC" | "WA" | "RTE" | "TLE" + +#testnode_pattern: =~"[a-zA-Z0-9_/\\*]+" // TODO +#Submissions: { + language?: string + entrypoint?: string + author?: #person | [...#person] + #expectation + [=~"^(sample|secret|\\*)" & #testnode_pattern]: #expectation +} + +#expectation: { + permitted?: [#verdict, ...#verdict] // only these verdicts may appear + required?: [#verdict, ...#verdict] // at least one of these verdicts must appear + score?: int | [int, int] & list.IsSorted(list.Ascending) + use_for_timelmit?: false | "lower" | "upper" +} + +// Play with me at https://cuelang.org/play/?id=3oy3DL9Hx5X#w=function&i=cue&f=eval&o=cue