Problem schema#
problem.rbx.yml#
Checker
#
Bases: CodeItem
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fallback_to
|
Checker | None
|
Checker to fall back to if the mainly specified checker does not exist. |
None
|
mode
|
Literal['testlib', 'boca']
|
In which compatibility mode the checker should be run. |
'testlib'
|
Source code in rbx/box/schema.py
CheckerTest
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
glob
|
str | None
|
A glob pattern for the files to be used as unit test input for the checker. |
None
|
testplan
|
Path | None
|
A testplan to be used as unit test input for the checker. |
None
|
outcome
|
ExpectedOutcome | None
|
The expected outcome of the checker. |
None
|
Source code in rbx/box/schema.py
CodeItem
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
The path to the code file, relative to the package directory. |
required |
language
|
str | None
|
The language of the code file. |
None
|
compilationFiles
|
List[str] | None
|
Extra files that should be available during the compilation of the code file, such as testlib.h, jngen.h, tgen.h, etc. The paths should be given relative to the package directory, and are placed at the
same package-relative path inside the sandbox (the package directory structure is
mirrored). This means a code file in a subdirectory can include a file from
elsewhere in the package via a relative path (e.g. Third-party libraries such as testlib.h, jngen.h and tgen.h are provided by the
preset's |
[]
|
executionFiles
|
List[str] | None
|
Extra files that should be available at execution time, the runtime equivalent of
The paths should be given relative to the package directory, and are placed at the same package-relative path inside the sandbox (the package directory structure is mirrored). Use this for runtime companion files a compiled binary or interpreted script needs at run time (data files, sibling modules, etc.). Sibling Python imports and quoted C++ includes are auto-discovered; this field is the escape hatch for files that cannot be discovered automatically. |
[]
|
Source code in rbx/box/schema.py
CodeItemWithDigest
#
Bases: CodeItem
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
digest
|
str
|
The digest of the code file. |
required |
Source code in rbx/box/schema.py
ExpectedOutcome
#
Bases: AutoEnum
Source code in rbx/box/schema.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | |
ACCEPTED = alias('accepted', 'ac', 'correct')
#
Expected outcome for correct solutions (AC).
ACCEPTED_OR_TLE = alias('accepted or time limit exceeded', 'accepted or tle', 'ac or tle', 'ac/tle', 'ac+tle')
#
Expected outcome for solutions that finish with either AC or TLE.
Especially useful when you do not care about the running time of this solution, and want it to not be considered when calculating the timelimit for the problem.
ANY = alias('any')
#
Expected outcome for any outcome.
COMPILATION_ERROR = alias('compilation error', 'ce')
#
Expected outcome for solutions that finish with a compilation error verdict.
Only useful for checker tests.
INCORRECT = alias('fail', 'incorrect')
#
Expected outcome for solutions that finish with any non-AC verdict.
JUDGE_FAILED = alias('judge failed', 'jf')
#
Expected outcome for solutions that finish with a judge failed verdict.
Only useful for checker tests.
MEMORY_LIMIT_EXCEEDED = alias('memory limit exceeded', 'mle', 'ml')
#
Expected outcome for solutions that use more memory than allowed.
OUTPUT_LIMIT_EXCEEDED = alias('output limit exceeded', 'ole', 'ol')
#
Expected outcome for solutions that use more output than allowed.
RUNTIME_ERROR = alias('runtime error', 'rte', 're')
#
Expected outcome solutions that finish with non-zero code (RTE).
TIME_LIMIT_EXCEEDED = alias('time limit exceeded', 'timeout', 'tle', 'tl')
#
Expected outcome for solutions that do not finish in time.
TLE_OR_RTE = alias('tle or rte', 'tle/rte', 'tle+rte', 'tle or re', 'tle+re')
#
Expected outcome for solutions that finish with either TLE or RTE.
Especially useful for environments where TLE and RTE are indistinguishable.
WRONG_ANSWER = alias('wrong answer', 'wa')
#
Expected outcome for solutions that finish successfully, but the produced output are incorrect (WA).
Generator
#
GeneratorCall
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the generator to call. |
required |
args
|
str | None
|
The arguments to pass to the generator. |
None
|
Source code in rbx/box/schema.py
GeneratorScript
#
Bases: CodeItem
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
Path
|
The root directory where the generators should be fetched from. |
<dynamic>
|
format
|
Literal['rbx', 'box']
|
The format of the generator script. |
'rbx'
|
Source code in rbx/box/schema.py
InferenceRole
#
Bases: AutoEnum
Source code in rbx/box/schema.py
LOWER = alias('lower')
#
The solution bounds the inferred time limit from below.
The limit will be large enough for this solution to comfortably pass.
UPPER = alias('upper')
#
The solution bounds the inferred time limit from above.
The limit will be small enough for this solution to comfortably time out.
Interactor
#
Bases: CodeItem
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
legacy
|
bool
|
Whether this interactor is a legacy interactor and needs a checker to be specified. |
False
|
capture
|
bool
|
Whether the interactor should capture the pipes. |
True
|
Source code in rbx/box/schema.py
LimitModifiers
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeMultiplier
|
float | None
|
Multiplier for time limit. |
None
|
time
|
int | None
|
Value to override time limit with, in milliseconds. |
None
|
memory
|
int | None
|
Value to override memory limit with, in MB. |
None
|
Source code in rbx/box/schema.py
LimitsProfile
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inheritFromPackage
|
bool
|
Whether to inherit limits from the package. |
False
|
timeLimit
|
int | None
|
Time limit of the problem, in milliseconds. |
None
|
memoryLimit
|
int | None
|
Memory limit of the problem, in MB. |
None
|
outputLimit
|
int | None
|
Output limit of the problem, in KB. |
None
|
modifiers
|
Dict[str, LimitModifiers]
|
Limit modifiers that can be specified per language. |
{}
|
formula
|
str | None
|
A formula to estimate the time limit for the problem. |
None
|
multipliers
|
TimingMultipliers | None
|
The multipliers this profile was estimated from, when it was estimated from ratios instead of a formula. Presentation-only; never used for limit resolution. |
None
|
groups
|
List[TimingGroupReport] | None
|
Metadata describing the language grouping used when this profile was estimated. Presentation-only; never used for limit resolution. |
None
|
baseEstimate
|
TimingGroupReport | None
|
Metadata describing how the base (fallback) time limit was estimated, pooled across every solution. Presentation-only; never used for limit resolution. |
None
|
Source code in rbx/box/schema.py
1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 | |
OutputFromItem
#
Bases: CodeItem
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stderr
|
bool
|
Whether the output should be taken from stderr instead of the stdout. |
False
|
Source code in rbx/box/schema.py
OutputFromItemWithDigest
#
Bases: OutputFromItem, CodeItemWithDigest
Source code in rbx/box/schema.py
Package
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the problem. |
required |
titles
|
Dict[str, str]
|
Titles for the problem in each language. Languages should be specified as lowercase ISO 639-1 codes. |
{}
|
type
|
TaskType
|
The type of the problem. |
BATCH
|
scoring
|
ScoreType
|
The scoring type of the problem. |
BINARY
|
timeLimit
|
int
|
Time limit of the problem, in milliseconds. |
required |
memoryLimit
|
int
|
Memory limit of the problem, in MB. |
required |
outputLimit
|
int
|
Output limit of the problem, in KB. |
4096
|
timing
|
PackageTiming | None
|
Problem-level overrides for time limit inference. |
None
|
modifiers
|
Dict[str, LimitModifiers]
|
Limit modifiers that can be specified per language. |
{}
|
checker
|
Checker | None
|
The checker for this problem. |
None
|
interactor
|
Interactor | None
|
The interactor for this problem. |
None
|
validator
|
CodeItem | None
|
The validator for this problem. |
None
|
extraValidators
|
List[CodeItem]
|
Extra validators for this problem. |
[]
|
outputValidators
|
List[CodeItem]
|
A list of output validators to use to validate the output of the testcases of this problem. |
[]
|
visualizer
|
Visualizer | None
|
The visualizer for this problem. Used to produced visualizations for the testcases. |
None
|
solutionVisualizer
|
Visualizer | None
|
The solution visualizer for this problem. Used to produced visualizations for the outputs of the testcases. |
None
|
generators
|
List[Generator]
|
Generators for this problem. |
[]
|
generatorScript
|
GeneratorScript | None
|
A generator script used as the default for any test group or subgroup that does not specify its own test parameters (testcases, testcaseGlob, generators, generatorScript) and has no subgroups of its own. Useful when a single script -- usually partitioned with |
None
|
solutions
|
List[Solution]
|
All tested solutions for this problem. The first solution in this list should be the main solution -- the one
that is correct and used as reference -- and should have the |
[]
|
testcases
|
List[TestcaseGroup]
|
Testcases for the problem. |
[]
|
stresses
|
List[Stress]
|
Stress tests for the problem. |
[]
|
statements
|
List[Statement]
|
Statements for the problem. |
[]
|
tutorials
|
List[Statement]
|
Tutorials (editorials) for the problem. |
[]
|
vars
|
RecVars
|
Variables to be re-used across the package. |
{}
|
unitTests
|
UnitTests
|
Unit tests for components of this problem. |
<dynamic>
|
Source code in rbx/box/schema.py
1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 | |
expanded_vars_for_group(group_name)
#
Package vars with the named group's overrides applied.
The merge happens before expansion, so an override can feed the interpolation of any var derived from it.
Falls back to the package vars when group_name is None or names no
declared group (interactive validation, unit tests, samples).
Source code in rbx/box/schema.py
PackageTiming
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inferenceTimeout
|
int | None
|
Overrides the environment |
None
|
multipliers
|
TimingMultipliersOverride | None
|
Per-problem overrides of the environment's timing multipliers. Only the declared fields are overridden. |
None
|
Source code in rbx/box/schema.py
ScoreType
#
Bases: AutoEnum
Source code in rbx/box/schema.py
Solution
#
Bases: CodeItem
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
outcome
|
ExpectedOutcome
|
The expected outcome of this solution. |
ANY
|
outcomePerGroup
|
Dict[str, ExpectedOutcome]
|
The expected outcome of this solution for each testcase group, keyed by group name. Only available for problems with Keys must be top-level group names declared in The reserved key This is an extra layer of expectations, checked in addition to |
{}
|
inference
|
Literal[False] | InferenceRole | None
|
The role this solution plays when inferring the time limit. When unset, the role follows the expected outcomes of this solution: a solution
expected to be Set it explicitly to override that:
|
None
|
tags
|
List[str]
|
Tags to be associated with this solution. |
[]
|
score
|
int | Tuple[int | None, int | None] | None
|
The score of this solution in the final score. Should either be an integer, which means the solution should have this exact score, or a tuple of two integers, which means the solution should have a score between the two integers (inclusive). If one of the integers is set to be null, it means that the solution should have a score between the other integer and negative/positive infinity. |
None
|
Source code in rbx/box/schema.py
686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 | |
all_expected_outcomes()
#
Every expectation this solution declares, pooled and per-group.
Source code in rbx/box/schema.py
expected_outcome_for_group(group_name)
#
The expectation for a single group, or None if the group has none.
Source code in rbx/box/schema.py
Stress
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the stress test. |
required |
generator
|
GeneratorCall
|
Generator pattern to call during stress-test. |
required |
finder
|
str
|
Finder expression to be used to match against generated tests. |
required |
Source code in rbx/box/schema.py
TaskType
#
Bases: AutoEnum
Source code in rbx/box/schema.py
Testcase
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputPath
|
Path
|
The path of the input file. |
required |
outputPath
|
Path | None
|
The path of the output file. |
None
|
Source code in rbx/box/schema.py
TestcaseGroup
#
Bases: TestcaseSubgroup
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
subgroups
|
List[TestcaseSubgroup]
|
A list of test subgroups to define for this group. |
[]
|
validator
|
CodeItem | None
|
A validator to use to validate the testcases of this group. If specified, will use this validator instead of the package-level validator. Useful in cases where the constraints vary across test groups. |
None
|
vars
|
RecVars
|
Variables that override the package-level Merged leaf-by-leaf onto the package |
{}
|
score
|
int
|
The score of this group in the final score. Useful for problems that have points. |
0
|
deps
|
List[str]
|
A list of other groups this group depends on to run and be considered accepted. The |
[]
|
model_solution
|
ForwardRef
|
The solution to be used to generate outputs for this testgroup. Can only be set for the "samples" testgroup. |
None
|
Source code in rbx/box/schema.py
TestcaseSubgroup
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the test group. |
required |
testcases
|
List[Testcase]
|
The path of testcases to add to this group, in the order they're defined. |
[]
|
testcaseGlob
|
str | None
|
A Python glob that matches input file paths relative to the package directory. The globbed files should end with the extension ".in", and their corresponding outputs, if defined, should have the same file name, but ending with ".ans". |
None
|
generators
|
List[GeneratorCall]
|
A list of generators to call to generate testcases for this group. |
[]
|
generatorScript
|
GeneratorScript | None
|
A generator script to call to generate testcases for this group. |
None
|
extraValidators
|
List[CodeItem]
|
A list of extra validators to use to validate the testcases of this subgroup. |
[]
|
outputValidators
|
List[CodeItem]
|
A list of output validators to use to validate the output of the testcases of this subgroup. |
[]
|
visualizer
|
Visualizer | None
|
The visualizer for this problem. Used to produced visualizations for the testcases. Has priority over the visualizer specified in the package. |
None
|
solutionVisualizer
|
Visualizer | None
|
The solution visualizer for this problem. Used to produced visualizations for the outputs of the testcases. Has priority over the solution visualizer specified in the package. |
None
|
Source code in rbx/box/schema.py
TimingBound
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
int
|
The bound, in milliseconds. A lower bound is the smallest
time limit it allows, before it is rounded up to |
required |
solution
|
str | None
|
The solution that set this bound, when it came from a measured solution of the group. Absent when the bound was derived from another group's limit. |
None
|
Source code in rbx/box/schema.py
TimingGroupReport
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
languages
|
List[str]
|
|
required |
timeLimit
|
int
|
|
required |
origin
|
TimingGroupOrigin
|
|
required |
solutionCount
|
int
|
|
0
|
fastest
|
int | None
|
|
None
|
slowest
|
int | None
|
|
None
|
relativeToLanguage
|
str | None
|
|
None
|
multiplier
|
float | None
|
|
None
|
increment
|
int | None
|
|
None
|
isLeftover
|
bool
|
|
False
|
lowerBound
|
TimingBound | None
|
The lower bound this group's time limit had to respect, when it was estimated from multipliers. Presentation-only. |
None
|
upperBound
|
TimingBound | None
|
The upper bound this group's time limit had to respect, when it was estimated from multipliers and some slow solution of the group bounded it. Presentation-only. |
None
|
upperValidation
|
TimingGroupUpperValidation | None
|
What checking this group's slow solutions against its estimated time limit found. Absent when the group has no slow solutions. Presentation-only. |
None
|
droppedUpper
|
List[str]
|
Deprecated: replaced by |
[]
|
Source code in rbx/box/schema.py
TimingGroupUpperValidation
#
Bases: BaseModel
What checking a group's slow solutions against its time limit found.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
confirmed
|
List[str]
|
Solutions of this group expected to be too slow that were
confirmed to be so: they were still running once the estimated time limit times
|
[]
|
violating
|
List[TimingBound]
|
Solutions of this group expected to be too slow that finished
within the estimated time limit times |
[]
|
skipped
|
List[str]
|
Solutions of this group expected to be too slow that were not
run, either because |
[]
|
Source code in rbx/box/schema.py
TimingMultipliers
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
acToTimeLimit
|
float
|
Minimum ratio between the time limit and the slowest accepted
solution, used to estimate the time limit from below: the slowest accepted solution
times |
required |
timeLimitToTle
|
float | None
|
Minimum ratio between the fastest solution expected to be too
slow and the time limit: the time limit times |
None
|
inferenceTimeout
|
int | None
|
Deprecated: use |
None
|
timeResolution
|
int
|
Granularity (in milliseconds) of the estimated time limit. The estimate is the smallest multiple of this value that is valid. |
100
|
Source code in rbx/box/schema.py
TimingMultipliersOverride
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
acToTimeLimit
|
float | None
|
Overrides the environment |
None
|
timeLimitToTle
|
float | None
|
Overrides the environment |
None
|
inferenceTimeout
|
int | None
|
Deprecated: use |
None
|
timeResolution
|
int | None
|
Overrides the environment |
None
|
Source code in rbx/box/schema.py
UnitTests
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
validator
|
List[ValidatorTest]
|
Unit tests for the validator. |
[]
|
checker
|
List[CheckerTest]
|
Unit tests for the checker. |
[]
|
Source code in rbx/box/schema.py
ValidatorOutcome
#
Bases: AutoEnum
Source code in rbx/box/schema.py
ValidatorTest
#
Bases: BaseModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
glob
|
str | None
|
A glob pattern for the input files to be used as unit test input for the validator. |
None
|
testplan
|
Path | None
|
A testplan to be used as unit test input for the validator. |
None
|
outcome
|
ValidatorOutcome | None
|
The expected outcome of the validator. |
None
|
validator
|
CodeItem | None
|
The validator to use for this test. If not specified, will use the package-level validator. |
None
|
Source code in rbx/box/schema.py
Visualizer
#
Bases: CodeItem
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extension
|
str
|
The extension of the visualization file generated by the visualizer. |
required |
answer_from
|
Literal['stderr'] | OutputFromItem | None
|
Program to generate additional answer file to pass to the visualizer. If not specified, the reference answer file will be used. |
None
|
Source code in rbx/box/schema.py
check_reserved_var_names(vars)
#
Reject top-level var names that collide with a testlib/rbx flag.
Only top-level primitive keys are checked: a nested var is emitted as
--<parent>.<key>=<value>, which no flag parser matches.
Source code in rbx/box/schema.py
Statements#
Statement
#
Bases: BaseStatement
A problem-level statement. Identified by (language, variant) — it has no
name (design §3.1).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
extends
|
str | StatementVariantRef | None
|
Another problem statement to inherit the build recipe from, referenced by language ( |
None
|
Source code in rbx/box/statements/schema.py
StatementType
#
Bases: AutoEnum
Source code in rbx/box/statements/schema.py
rbxTeX = alias('rbx-tex')
#
Statement written in rbxTeX format.
rbxMarkdown = alias('rbxMd', 'rbx-markdown', 'rbx-md')
#
Statement written in rbxMarkdown format.
TeX = alias('tex')
#
Statement written in pure LaTeX format.
Markdown = alias('md', 'markdown')
#
Statement written in pure Markdown format.
JinjaTeX = alias('jinja-tex')
#
Statement written in LaTeX format with Jinja2 expressions.
JinjaMarkdown = alias('jinja-md', 'jinja-markdown')
#
Statement written in Markdown format with Jinja2 expressions.
PDF = alias('pdf')
#
Statement is a PDF.
Conversion nodes#
BaseStatement
#
Bases: BaseModel
Fields shared by problem statements, contest statements and documents (design §2.5, "one shared schema").
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
language
|
str
|
Language code of this statement (ISO 639-1). |
'en'
|
variant
|
str
|
Optional discriminator between formats of the same language. Together with |
'default'
|
title
|
str | None
|
Title as it appears in the statement. Can be left unset to fall back to the package/contest title. |
None
|
file
|
Path | None
|
Path to the input statement file. Required unless this statement |
None
|
type
|
StatementType
|
Type of the input statement file. |
rbxTeX
|
params
|
RecVars
|
This statement's own parameters, exposed to the template as the |
{}
|
samples
|
bool
|
Whether to build the statement with samples. |
True
|
assets
|
List[str]
|
Globs (relative to the package root) selecting files to ship as statement resources (e.g. images/PDFs). Inherited via |
<dynamic>
|
Source code in rbx/box/statements/schema.py
ConversionType
#
Bases: str, Enum
Source code in rbx/box/statements/schema.py
JinjaTeX = 'jinja-tex'
class-attribute
instance-attribute
#
Conversion from LaTeX with Jinja2 expressions to LaTeX.
TexToPDF = 'tex2pdf'
class-attribute
instance-attribute
#
Conversion from LaTeX to PDF using pdfLaTeX.
rbxMarkdownToTeX = 'rbx-md-tex'
class-attribute
instance-attribute
#
Conversion from rbxMarkdown to LaTeX.
rbxToTex = 'rbx-tex'
class-attribute
instance-attribute
#
Conversion from rbxTeX to LaTeX.
StatementKind
#
Bases: str, Enum
Which parallel section a statement build operates on (design §3): the
primary statements or the tutorials (editorials). Both share the
same models, engine and build paths — the kind only selects which list to
read on the problem and the contest, and the output filename prefix.
Source code in rbx/box/statements/schema.py
singular
property
#
Noun used in messages and output filenames (statement / tutorial).
StatementVariantRef
#
Bases: BaseModel
A problem-statement extends target referenced by (language, variant).
A bare string extends: en is shorthand for {language: en} with the
default variant (design §5).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
language
|
str
|
|
required |
variant
|
str
|
|
'default'
|
Source code in rbx/box/statements/schema.py
TexToPDF
#
Bases: BaseModel
Configures the conversion between LaTeX and PDF using pdfLaTeX.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type
|
Literal['tex2pdf']
|
|
required |
externalize
|
bool
|
Whether to externalize TikZ graphics. |
False
|
demacro
|
bool
|
Whether to save macro definitions to a JSON file. |
False
|
Source code in rbx/box/statements/schema.py
rbxToTeX
#
Bases: BaseModel
Configures the conversion between rbxTeX and LaTeX.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type
|
Literal['rbx-tex']
|
|
required |
template
|
Path
|
Path to the template that should be used to render the rbx-tex blocks. |
PosixPath('template.rbx.tex')
|
externalize
|
bool
|
Whether to externalize TikZ graphics. |
False
|