Self-paced

Explore our extensive collection of courses designed to help you master various subjects and skills. Whether you're a beginner or an advanced learner, there's something here for everyone.

Bootcamp

Learn live

Join us for our free workshops, webinars, and other events to learn more about our programs and get started on your journey to becoming a developer.

Upcoming live events

Learning library

For all the self-taught geeks out there, here is our content library with most of the learning materials we have produced throughout the years.

It makes sense to start learning by reading and watching videos about fundamentals and how things work.

Search from all Lessons


LoginGet Started
← Back to Lessons
Edit on Github

Configure a LearnPack package to ask for delivery

Projects with no delivery
Deliver a file

Projects with no delivery

1{ 2 "delivery": { 3 "formats": ["no_delivery"] 4 } 5}

Deliver a file

Before setting up your learn.json, you must know which mime types the learners will be able to upload to deliver the project successfully. If you have a sample file, I recommend you upload it to mimetyp.io. To retrieve the particular string, you need to use a mime type.

how to get mime types

Once you get the mime type, you have to specify it under the delivery.formats array like this:

1{ 2 "delivery": { 3 "formats": ["application/pdf"] 4 } 5}

The following are a few examples of different mime types:

PDF file

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

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.

1{ 2 "delivery": { 3 "instructions": { 4 "us": "Create a text document with the answers to the questions in the instructions", 5 "es": "Adjunta un documento con las respuestas a las preguntas" 6 }, 7 "formats": ["application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf"] 8 } 9}

Files with unknown mime type

Some rate files like Packet Tracer .pka files don't have a recognized mime type, in that case, you have to use application/octet-stream followed by the file extension like this:

⚠️ Please note this is a last resort; we strongly recommend always using the mime-type when possible.

1{ 2 "delivery": { 3 "instructions": { 4 "en": "Please attach your finished pka file and upload it here", 5 "es": "Por favor adjunta tu archivo pka listo y cárgalo aquí" 6 }, 7 "formats": ["application/octet-stream,.pka"] 8 } 9}

The default format to deliver a project using LearnPack is by specifying a github repository URL link with the following structure:

1https://github.com/<githun_username>/<github_repository>

But you can override that behavior by specifying a regex string like this:

1{ 2 "delivery": { 3 "formats": ["url"], 4 "regex": "https://github.com/" 5 } 6}

The following is a list of examples of different regex for different URL formats.

URL from docs.google.com

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

URL from anywhere

Leave the regex key with https:// only, and 4Geeks.com will ensure that the student specifies a URL from anywhere online.

1{ 2 "delivery": { 3 "instructions": { 4 "us": "Pase the URL of the Google Sheets template with the different strategies discussed during the game", 5 "es": "Agrega el URL al document de Google Sheets con las diferentes strategies discutidas" 6 }, 7 "formats": ["url"], 8 "regex": "https://" 9 } 10}