The clock belongs to the server
expires_at is written once when an attempt starts. Refreshing, reopening in another browser or clearing storage changes nothing, and a sweeper closes and grades attempts whose time has run out.
Per-candidate flags
A practical answer is an HMAC of the attempt and question, so two candidates solving the same task submit different strings. A leaked flag scores nothing and shows whose attempt it came from. The flag is never stored and never sent to the browser.
Candidate code never runs on the application server
The API has no Docker access at all. It writes a job row; a separate worker owns the Docker socket and runs the code in a throwaway container with no network, a read-only root filesystem, an unprivileged user, every capability dropped, and memory, CPU, PID and wall-clock limits.
Terminals are proxied, not exposed
A lab container publishes no host port. The only way in is an authenticated WebSocket through the API, which checks that the attempt belongs to the person asking and is still running.
Leaving the exam blanks it
Switching tab, losing focus or leaving fullscreen covers the paper with a lockout, while the clock keeps running underneath. One alt-tab fires two browser events milliseconds apart, so they are de-duplicated, and developer-tool shortcuts are swallowed with a quiet note.