Skip to main content

Module answer_uploads

Module answer_uploads 

Source
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.