Skip to main content

Configure LearnPack for delivering the package as a project

Delivery options: configure no delivery, file uploads (by MIME type), or URL submissions (via regex). You can also accept flags for CTF-style validations. ✅
One of LearnPack’s most popular features is the ability to ask students to deliver the package as homework. Here, you can configure a package to allow or not allow delivery.

Projects with no delivery

{
  "delivery": {
    "formats": ["no_delivery"]
  }
}

Deliver a file

Before setting up your learn.json, you must know which MIME types learners will be able to upload to deliver the project successfully. If you have a sample file, you can upload it to a MIME checker (e.g., mimetype.io) to retrieve the exact string. how to get mime types Once you get the MIME type, specify it under the delivery.formats array:
{
  "delivery": {
    "formats": ["application/pdf"]
  }
}
Examples:

PDF file

{
  "delivery": {
    "instructions": {
      "us": "Please drag your finished resume as a PDF file and upload it here",
      "es": "Porfavor adjunta tu resume/CV listo y como archivo PDF"
    },
    "formats": ["application/pdf"]
  }
}

Flag coming from Capture the Flag

{
  "delivery": {
    "instructions": {
      "us": "Paste the flag you found with format FLAG{hash}",
      "es": "Agrega el la bandera que encontraste con el formato FLAG{hash}"
    },
    "formats": ["flags"],
    "quantity": 2
  }
}

Text file with multiple MIME possibilities

Sometimes, we want to allow multiple file types. In this case, the learner can upload a file from MS Word or PDF.
{
  "delivery": {
    "instructions": {
      "us": "Create a text document with the answers to the questions in the instructions",
      "es": "Adjunta un documento con las respuestas a las preguntas"
    },
    "formats": ["application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf"]
  }
}

Files with unknown MIME type

Some rare files like Packet Tracer .pka do not have a recognized MIME type. In that case, use application/octet-stream followed by the file extension:
Heads up: this is a last resort. Prefer explicit MIME types whenever possible.
{
  "delivery": {
    "instructions": {
      "en": "Please attach your finished pka file and upload it here",
      "es": "Por favor adjunta tu archivo pka listo y cárgalo aquí"
    },
    "formats": ["application/octet-stream,.pka"]
  }
}

The default format to deliver a project is by specifying a GitHub repository URL with the following structure:
https://github.com/<github_username>/<github_repository>
You can override that behavior by specifying a regex:
{
  "delivery": {
    "formats": ["url"],
    "regex": "https://github.com/"
  }
}
More URL examples:

URL from docs.google.com

{
  "delivery": {
    "instructions": {
      "us": "Pase the URL of the Google Sheets template with the different strategies discussed during the game",
      "es": "Agrega el URL al document de Google Sheets con las diferentes strategies discutidas"
    },
    "formats": ["url"],
    "regex": "https://docs.google.com/"
  }
}

URL from anywhere (generic)

Leave the regex key with https:// only. The system will ensure a valid URL is provided.
{
  "delivery": {
    "instructions": {
      "us": "Pase the URL of the Google Sheets template with the different strategies discussed during the game",
      "es": "Agrega el URL al document de Google Sheets con las diferentes strategies discutidas"
    },
    "formats": ["url"],
    "regex": "https://"
  }
}

Quick rubric

Delivery typeKey(s)Example
No deliveryformats: ["no_delivery"]No submission required
File uploadformats: ["application/pdf"]PDF resume
Multiple file typesformats: ["application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf"]DOC, DOCX, or PDF
Unknown typeformats: ["application/octet-stream,.pka"]Packet Tracer .pka
URL linkformats: ["url"], regex: "https://github.com/"GitHub repo
URL (generic)formats: ["url"], regex: "https://"Any https URL
Flags (CTF)formats: ["flags"], quantityOne or more flags
Tip: pair delivery settings with your grading mode to align submissions with tests and review workflows.

Next up

See also