Exam Reference¶
exam.json — single source of truth¶
Lives at /var/lib/sre/exam.json (params.sre_pub_dir + "/" + params.exam_json_name). The same file must exist on every student PC — distribute via NFS, rsync, or any deployment mechanism. All field names are exposed as params.exam_* constants; never hard-code them.
Field |
Constant |
Type |
Meaning |
|---|---|---|---|
|
|
|
Authorised labs + optional flavor preset (required) |
|
|
ISO datetime |
Exam opens after this moment |
|
|
ISO datetime |
Exam closes before this moment |
|
|
int (min) |
Max duration; default |
|
|
int (s) |
Auto-eval period; default |
|
|
bool |
Record terminal sessions; default |
|
|
list[ISO] |
Written by |
|
|
ISO datetime |
Written by |
|
|
ISO datetime |
Written by |
The first six are set by the instructor (via sre set-exam); the last three are runtime state markers.
labs format: each entry is a two-element list [lab_cli_arg, flavor_or_null], where lab_cli_arg is what sre start would receive (e.g. s4/tp_ssh) and the second element is the name of a Flavor preset or null:
"labs": [["s4/tp_ssh", null], ["s4/tp_dhcp", "hard"]]
Legacy plain-string entries are still accepted on read; always unpack via params.parse_lab_entry(entry).
GUI exam logic¶
Each student GUI reads exam.json every second (_update_exam_state) and runs the same logic — there is no coordinator. The phase is computed from exam.json content alone (_compute_exam_phase):
Waiting —
start_afterset,now < start_after,started_atnot set.Ended —
end_beforeset andnow ≥ end_before, orstarted_atset andnow ≥ started_at + duration(duration defaults toparams.default_exam_duration = 90). The duration check fires only whenstarted_atis set — without it, the exam was never formally started.Otherwise: Active.
real_starting_time (drives the countdown) = started_at if set, else start_after if set, else GUI process start time.
Phase |
Preconditions |
Actions |
|---|---|---|
Waiting |
— |
Show SRE logo + countdown to |
Active |
Exam containers up — one running project per lab in |
Fire |
Ended |
— |
Fire |
Commands¶
See CLI Reference for set-exam, del-exam, pre-start-exam, start-exam, eval-exam, end-exam, save-records, watch, cat, check-eval, re-eval, sheet, outline.