Seeding
Subato provides a YAML-based interface for the initial import of courses,
terms, exercises, languages, task pools, and other entities. Run the import
with SeedRunner:
gradle bootRun --args='seed:seed ./seed'
The second argument is a directory containing the YAML files, see
demo/seed for a working
example. For what can be imported, check the code in
de.hsrm.sls.subato.seed.model. YAML attributes map to fields using snake_case, and references to other entities can be made by using YAML slugs. For example, a term with the
slug ws2324 can be referenced as follows when defining a course:
ws2324:
name: WS2324
lectures_start_at: 2023-10-16
lectures_end_at: 2024-02-02
oose:
name: Objektorientierte Softwareentwicklung
short_name: OOSE
term: ws2324
Subato generates a unique ID for most entities at seed time, and re-running a seed does not check whether an entity with the same name already exists. Seeding is meant to run once against an empty database, running it again against the same database will create duplicates.
When linking tasks from a task-pool to an exercise in exercises.yaml (through the task_instances
attribute), the attribute tracking_id has to refer to the trackingId field in the meta.xml of the target task. See the STEF specification for more information on how tasks can be defined.