Skip to content

Commit 1a2f717

Browse files
committed
[schemas] Update schemas for test_group.yaml
1 parent df13a98 commit 1a2f717

File tree

2 files changed

+64
-22
lines changed

2 files changed

+64
-22
lines changed

support/schemas/generators_yaml_schema.json

Lines changed: 55 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,39 @@
5151
"title": "Test data settings",
5252
"description": "The settings that apply to the test data for this test group. Will be copied to this test group's `test_group.yaml`.",
5353
"properties": {
54-
"on_reject": {
55-
"enum": ["break", "continue"],
56-
"default": "break"
57-
},
58-
"grading": {
59-
"enum": ["default", "custom"]
60-
},
61-
"grader_flags": {
62-
"type": "string",
63-
"examples": ["min", "sum"]
54+
"scoring": {
55+
"type": "object",
56+
"title": "Scoring settings",
57+
"description": "For scoring problems, submissions are given a non-negative score instead of a verdict. The goal of each submission is to maximize this score. The scoring behavior is configured for `secret` and each test data group using the `scoring` object.",
58+
"properties": {
59+
"score": {
60+
"oneOf": [
61+
{
62+
"type": "integer",
63+
"minimum": 1
64+
},
65+
{
66+
"enum": ["unbounded"]
67+
}
68+
]
69+
},
70+
"aggregation": {
71+
"enum": ["pass-fail", "sum", "min"]
72+
},
73+
"require_pass": {
74+
"oneOf": [
75+
{
76+
"type": "string"
77+
},
78+
{
79+
"type": "array",
80+
"items": {
81+
"type": "string"
82+
}
83+
}
84+
]
85+
}
86+
}
6487
},
6588
"input_validator_args": {
6689
"oneOf": [
@@ -115,14 +138,29 @@
115138
"deprecated": true,
116139
"description": "With 'problem_format_version: 2023-07-draft' in problem.yaml, use output_validator_args instead."
117140
},
118-
"accept_score": {
119-
"type": "string"
120-
},
121-
"reject_score": {
122-
"type": "string"
141+
"static_validation": {
142+
"oneOf": [
143+
{
144+
"type": "boolean"
145+
},
146+
{
147+
"type": "object",
148+
"properties": {
149+
"args": {
150+
"type": "string",
151+
"description": "Represents the additional arguments passed to the static validator in this group's static validation test case."
152+
},
153+
"score": {
154+
"type": "integer",
155+
"description": "The maximum score of the static validation test case."
156+
}
157+
}
158+
}
159+
]
123160
},
124-
"range": {
125-
"type": "string"
161+
"full_feedback": {
162+
"description": "Defaults to `false` in `secret` and `true` in `sample`.\nWhen `full_feedback` is `true`, somebody whose submission didn't pass case should be shown:\n- the given input,\n- the produced output (stdout),\n- any error messages (stderr),\n- the illustration created by the output visualizer (if applicable),\n- the expected output.",
163+
"type": "boolean"
126164
}
127165
}
128166
},

support/schemas/problemformat.cue

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,18 @@ let filename = "[A-Za-z0-9][A-Za-z0-9_.-]{0,253}[A-Za-z0-9]"
2323
// Test data settings
2424

2525
#test_group_settings: {
26+
scoring?: {
27+
score?: >0 | "unbounded"
28+
aggregation?: "sum" | "min"
29+
require_pass: string | [string]
30+
}
2631
input_validator_args?: *[] | [string] | {[string]: [string]}
2732
output_validator_args?: *[] | [string]
2833
test_case_visualizer_args?: *[] | [string]
2934
output_visualizer_args?: *[] | [string]
30-
grading?: {
31-
score?: >0
32-
max_score?: >0
33-
aggregation?: "sum" | "min"
34-
// run_samples?: bool
35+
static_validation?: *false | true | {
36+
args?: string
37+
score?: int
3538
}
39+
full_feedback?: bool
3640
}

0 commit comments

Comments
 (0)