Expand description
Deciding whether a submit may name the host-stored uploads it names.
Two submit paths reach here: a native client names its uploads in the request body, and a
course-material IFrame answer names them inside its current-state. Both are equally
student-controlled, so the checks live here rather than in either caller — a second copy would
be a second thing to keep in step.
Functions§
- lock_
and_ verify_ uploads_ are_ usable - Re-checks the named uploads under a row lock the reaper honours.
- verify_
answer_ names_ uploads - Rejects a file-typed answer that names no files at all.
- verify_
uploads_ are_ distinct - Rejects a submit naming the same upload twice.
- verify_
uploads_ are_ usable - Rejects a submit naming a file the host has no usable upload record of.
- verify_
uploads_ belong_ to_ exercise - Checks every id a submit names against the uploads recorded for this exercise and user.