Skip to content

Assignment Archives

This pages describes the archives generated by the assignment activity archiving driver.

Archive contents

Generated assignment archives can contain the following files:

Filetype Example Description
Submission report (PDF) submission-17-jdoe.pdf PDF report of the assignment submission.
Submission report (HTML) submission-17-jdoe.html Raw HTML that was used to generate the PDF report of the assignment submission.
Intro files template.zip Files supplied to the students at assignment start.
Submission files solution.zip Solution files submitted by the student.
Feedback files unit_test_log.txt Feedback files uploaded by the grader.
Grader annotation (PDF) John Doe_17_0.pdf Interactively annotetad PDFs by the grader.
File checksum submission-17-jdoe.pdf.sha256 SHA256 checksum of each file in the archive.
Archive metadata (CSV) submissions_metadata.csv Tabular file containing metadata about the submissions inside the archive.

Naming patterns

When creating a new assignment archive, the Advanced settings section contains three options for naming the files inside an archive and the archive itself:

  • Archive name controls the name of the final archive file.
  • Submission folder name controls the names of the folders created for each submission when using the hierarchical file structure.
  • Submission name controls the names of the PDF reports generated for individual assignment submissions. If HTML source files are enabled, they use the same base name.

Patterns can be composed of plain text and variables. Variables must use the ${variablename} syntax. The file extension is added automatically, so do not add an extension yourself.

Info

Submission folder name has no effect when Flatten export archive is enabled because all files are placed in the root of the resulting archive. See File structure for details.

The variables are available for use within the respective name patterns:

Variable Description Archive name Submission folder name Submission name
${courseid} Course ID ✅ ✅ ✅
${coursename} Course name ✅ ✅ ✅
${courseshortname} Course short name ✅ ✅ ✅
${cmid} Course module ID ✅ ✅ ✅
${assignmentid} Assignment ID ✅ ✅ ✅
${assignmentname} Assignment name ✅ ✅ ✅
${opendatetime} Allow submissions from (YYYY-MM-DD_HH-MM-SS) ❌ ✅ ✅
${duedatetime} Due date (YYYY-MM-DD_HH-MM-SS) ❌ ✅ ✅
${submissionid} Submission ID ❌ ✅ ✅
${username} Student username ❌ ✅ ✅
${firstname} Student first name ❌ ✅ ✅
${lastname} Student last name ❌ ✅ ✅
${email} Student email address ❌ ✅ ✅
${idnumber} Student ID number ❌ ✅ ✅
${groupids} IDs of the student's groups ❌ ✅ ✅
${groupidnumbers} ID numbers of the student's groups ❌ ✅ ✅
${groupnames} Names of the student's groups ❌ ✅ ✅
${timestart} Submission start Unix timestamp ❌ ✅ ✅
${startdatetime} Submission start (YYYY-MM-DD_HH-MM-SS) ❌ ✅ ✅
${timecreated} Submission creation Unix timestamp ❌ ✅ ✅
${createddatetime} Submission creation (YYYY-MM-DD_HH-MM-SS) ❌ ✅ ✅
${timemodified} Submission modification Unix timestamp ❌ ✅ ✅
${modifieddatetime} Submission modification (YYYY-MM-DD_HH-MM-SS) ❌ ✅ ✅
${date} Current date (YYYY-MM-DD) ✅ ✅ ✅
${time} Current time (HH-MM-SS) ✅ ✅ ✅
${timestamp} Current Unix timestamp ✅ ✅ ✅

Info

This list may not be exhaustive. Please check the help text of the respective option in Moodle itself. It will always contain an up-to-date list of all variables that your current plugin version supports.

File structure

Archives can be created either hierarchical or flat. By default, hierarchical archives with sub-folders are created. The Flatten export archive checkbox determines how files are placed inside the archive:

  • When it is not selected, the archive uses a hierarchical structure with separate directories. The Attempt folder name setting determines the directory used for each submission.
  • When it is selected, the archive uses a flat structure. All files are placed directly in the root of the archive. Prefixes are added to file names to distinguish reports belonging to different submissions and to prevent name collisions. The Attempt folder name setting is ignored.

Example: Hierarchical

For example, with an submission folder pattern of ${username}/${submissionid} and an submission name pattern of submission-${submissionid}-${username}, a hierarchical archive may contain entries like:

/
├── submissions/
│   └── jdoe/
│       └── 17/
│           ├── annotation/
│           │   ├── John Doe_17_0.pdf
│           │   └── John Doe_17_0.pdf.sha256
│           ├── assignment/
│           │   ├── template.zip
│           │   └── template.zip.sha256
│           ├── feedback/
│           │   ├── unit_test_log.txt
│           │   └── unit_test_log.txt.sha256
│           ├── submission/
│           │   ├── solution.zip
│           │   └── solution.zip.sha256
│           ├── submission-17-jdoe.pdf
│           └── submission-17-jdoe.pdf.sha256
├── submissions_metadata.csv
└── submissions_metadata.csv.sha256

Example: Flat

The equivalent flat archive to the example above keeps the same files at its top level and uses prefixes to retain their association with the submission:

/
├── submission_17.submission-17-jdoe.annotation.John Doe_17_0.pdf
├── submission_17.submission-17-jdoe.annotation.John Doe_17_0.pdf.sha256
├── submission_17.submission-17-jdoe.assignment.template.zip
├── submission_17.submission-17-jdoe.assignment.template.zip.sha256
├── submission_17.submission-17-jdoe.feedback.unit_test_log.txt
├── submission_17.submission-17-jdoe.feedback.unit_test_log.txt.sha256
├── submission_17.submission-17-jdoe.submission.solution.zip
├── submission_17.submission-17-jdoe.submission.solution.zip.sha256
├── submission_17.submission-17-jdoe.pdf
├── submission_17.submission-17-jdoe.pdf.sha256
├── submissions_metadata.csv
└── submissions_metadata.csv.sha256