Skip to main content

Module exercise_task_spec_files

Module exercise_task_spec_files 

Source
Expand description

The files an exercise task’s specs reference.

An exercise service declares them, the same way an answer names its files: the host stores specs as opaque blobs, so a declaration is the only way it can know that a stored file is still in use. The private spec’s files are declared in the editor’s current-state message, and each derived spec’s in the response of the endpoint that produced it.

The kinds are tracked apart because a derived spec can name a file the private spec never did: a service may upload while deriving, through SpecRequest.upload_url, which is how tmc stores the template students download.

Used only to keep crate::exercise_spec_uploads’ reaper off files that are still referenced.

Enums§

SpecKind
Which of a task’s three specs a reference belongs to.

Functions§

comma_separated 🔒
get_by_exercise_task_ids
What each task’s spec of the given kind declares, keyed by task. Tasks that declare nothing are absent from the map rather than present with an empty list.
get_for_exercise_task
What one of a task’s specs declares, in no particular order: the order of a spec’s files is the exercise service’s business and lives inside the spec.
replace_for_exercise_task
Replaces what one of a task’s specs declares with file_upload_ids.