File Organization
- files
- template
- Appointment.java
- solution
- Appointment.java
- test
- AppointmentTest.java
- acceptanceTest
- AppointmentAbnahmeTest.java
- include
- Date.java
- DateTime.java
- Time.java
- misc
- Anhang.pdf
The files directory follows a fixed structure, where subdirectories must be named after the
FileTypes, and each subdirectory holds only files of that type. For example,
the template file Appointment.java would be referenced in meta.xml as follows:
<file public="true" type="template" path="Appointment.java"/>
Then, the file must be placed under files/template/Appointment.java. This split exists due to
filename collisions, as the example above demonstrates.
Apart from referencing files to be picked up by Subato, you can create additional directories and store other resources in them, such as Makefiles. These are stored in Subato during import, but they are not accessible to anyone.
Handling Namespaces and Packages
Source files need to be structured in the way the evaluator's compiler or
runtime expects. For Java tasks, classes without a package need to be placed according to the
filesystem layout shown above. Classes with a package need to be placed in matching
directories. For example, a class with the FQCN de.panitz.name.Date needs to be stored as follows:
- files
- template
- de
- panitz
- name
- Date.java
Then, the file element in meta.xml needs to be set up as follows for the file to be picked up by Subato:
<file public="true" type="template" path="de/panitz/name/Date.java"/>
Mapping of Submitted Files to Templates
How a submitted file maps to a template depends on the task's SubmissionMode.
SubmissionMode.TEXT
The editor is pre-filled with the content of the task's template file. This
mode only works if the task has at most one template file configured. On
submission, the template file's name is used (or unnamed.txt if there
is no template file).
SubmissionMode.FILE
If an evaluator has been configured for the task, the submitted files must include the template
files. If no evaluator was configured, any file can be submitted.
Example 1: A single source file is submitted as the solution. Then, the template file's name
is used regardless of the submitted file's name.
Example 2: An archive (e.g. zip) is submitted. The Java task was configured with a template
file Date.java, and its class has no package (default package). Then, the archive must contain
this file at its top level.
Example 3: Same as above, but the template's class belongs to the
package de.panitz.name. Then, the solution file must be accessible in the archive using one of the following paths:
/de/panitz/name/Date.java*/de/panitz/name/Date.java,src/de/panitz/name/Date.java*/src/de/panitz/name/Date.java
where * is a placeholder for any directory name.
The supported archive formats are listed here.