Skip to content

Manually creating an exercise

To manually add a practical exercise to your lab:

  1. Go to the CODE interface.
  2. Click the exercises folder to open it.
  3. In the ribbon, click the New Folder icon.
  4. Name the folder as the exercise should be named.
  5. Click the New File icon and subsequently add the following files:
  • exercise-config.json that sets up the exercise structure and gathers the files listed below.
  • {exercise_name}_initial.py or {exercise_name}_initial.js that contains the default code that a learner will see in their IDE after starting the exercise.
  • {exercise_name}_instructions.md that contains the explanation for the learner telling them what to do in this exercise.
  • {exercise_name}_soluton.py.txt or {exercise_name}_ soluton.js.txt that contains the correct input to successfuly pass the exercise.
InformationIMPORTANT: The double extension .py.txt is required to avoid parsing the file by the Visual Studio Code Server as a part of the project .
  • {exercise_name}_tests.py or {exercise_name}_tests.js that contains criteria to check if a learner has successfully passed a test. If a test fails, the step is not passed. There can be several test files, one for each learner's action. See Using tests in an exercise for more detail.
InformationBefore publishing the lab, make sure that tests you created are valid.
  1. Repeat steps 3–5 to add folders for all exercises of the lab.
  2. Open the SUMMARY.md file.
  3. In the lab .md files list, specify the paths to the added {exercise_name}_instructions.md files for each exercise. The order must correspond to the order in which the exercise should be displayed to learners when they pass the lab.
InformationIMPORTANT: For multi-step labs, use the third-level header Markdown formatting (###) only to designate steps of the exercise. Each line with ###1, ###2, and so on will be converted into the subsequent exercise step.
  1. Click Save.
WarningIMPORTANT: All exercise folders and files must be stored in the exercises folder. If this order is violated, this results in the lab malfunction.