Skip to content

Commit

Permalink
schema: fledling submissions.cue
Browse files Browse the repository at this point in the history
  • Loading branch information
thorehusfeldt committed Dec 12, 2024
1 parent cd8988d commit e6ac5f0
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions support/schemas/submissions.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package problemformat

import "list"

#person: =~"^[^<]+(<[^>]+>)?$" // "Alice" or "Bob <bob@com>"

#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

0 comments on commit e6ac5f0

Please sign in to comment.