The CodeGrade Exercise Format mirrors the on-disk shape produced by CodeGrade's own course/assignment export. Unlike the Kattis format, it isn't an official/versioned spec — the importer just reads the folder layout CodeGrade produces.
Two archive shapes are recognized:
| Detected as | Root contains | Result |
|---|---|---|
codegrade-exercise | exercise.yml | A single problem |
codegrade-collection | collection.yml, plus one or more subfolders each with their own exercise.yml | A wizard lets you pick which exercises to import |
| Path | Purpose |
|---|---|
exercise.yml | Metadata: Name and description (required), cpuTimeLimit, memoryLimit |
<testgroup>/<caseId>.in / .ans | Numbered testgroup folders, e.g. 01-SmallTests/, each holding one or more test cases |
solution/ | Reference solution program(s), stored the same way as a Kattis submissions/accepted/<program>/ folder |
test_samples/ | monkeycode-specific extension folder (see below) |
description is used directly as the problem statement — it's expected to already be Markdown, so (unlike the Kattis format) no LaTeX parsing or validation runs on it. cpuTimeLimit is in milliseconds and defaults to 1000; memoryLimit is in kilobytes and is converted to the megabytes the platform stores, rounded up (defaulting to 2048MB if absent).
CodeGrade testgroups don't distinguish public sample data from secret grading data — the importer resolves that ambiguity one of two ways:
test_samples/ folder (sibling to the testgroup folders) containing its own .in/.ans pairs. If present, it's authoritative: those cases become the samples, and every testgroup case is imported as secret.test_samples/ folder exists. Whichever testgroups you check become samples; everything else is imported secret.test_samples/ folder and you skip the selection step, every test case is imported as secret and a warning is recorded on the import — contestants will see no sample input at all.For a collection.yml archive, the import dialog lists one row per exercise (its Name, a generated problem slug you can edit, and — if it has no test_samples/ folder — a checklist of its testgroups to mark as samples). You choose which exercises to import and can retry failed rows individually; each imported exercise becomes its own problem.
problems row is created with time_limit/memory_limit from the exercise metadata and languages: ['en'].type (pass-fail/scoring/interactive) — every imported exercise gets the platform's default problem type(s).description is uploaded as problem.en.md — no statement validators run against it..in/.ans pair in every testgroup (and test_samples/, if present) is uploaded as sample or secret test data.solution/ are uploaded as an accepted reference submission.| Error | Cause |
|---|---|
exercise_path is required to import from a CodeGrade collection archive. | Importing a collection without specifying which exercise |
No <path>exercise.yml file found! | Missing exercise.yml at the expected location |
exercise.yml is missing a required 'Name'/'description' field. | exercise.yml doesn't set one of the two required fields |
No test cases found for this exercise. | No .in/.ans pairs found in any testgroup or test_samples/ |
sample_test_groups must be a JSON array of testgroup names. / Unknown sample test group(s) | An invalid or unrecognized testgroup selection was submitted |