Manually creating an exercise
To manually add a practical exercise to your lab:
- Go to the CODE interface.
- Click the exercises folder to open it.
- In the ribbon, click the New Folder icon.
- Name the folder as the exercise should be named.
- 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.
| Information | IMPORTANT: 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.
| Information | Before publishing the lab, make sure that tests you created are valid. |
- Repeat steps 3–5 to add folders for all exercises of the lab.
- Open the SUMMARY.md file.
- 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.
| Information | IMPORTANT: 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. |
- Click Save.
| Warning | IMPORTANT: All exercise folders and files must be stored in the exercises folder. If this order is violated, this results in the lab malfunction. |