Skip to content

Preparing a coding lab

Before you start adding a lab through the lab editor, you might want to prepare the lab content. Alternatively, you might start adding the content through the editor right on the lab creation without preparation. In any case, your lab must have the following structure:

  • content — this folder stores a set of .md files, each file relates to a lab section containing textual information without practice (introductory information, theoretical concepts, and other).
  • exercises — this folder stores a set of subfolders, each of which contains files of a particular exercise.
  • SUMMARY.md — this file contains a list of paths to all lab .md files ordered as they should go in the lab.

Creating text content

For each section of your lab intended solely for reading, create a separate .md file. These files must use the Markdown formatting.

When the files are prepared, you will need to list them in the SUMMARY.md file to enable displaying them to learners. See Creating a coding lab for the details.

Creating exercise content

For each exercise of your lab, create a separate folder named {exercise_name}. Refer to the leap and thermometer sample exercises that illustrate how to create exercises.

The {exercise_name}folder must have the following contents:

  • 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.

See Creating a coding lab for the details.

C++ specifics

Labs in C++ have more files as files are split up into two files:

  • a header file with the .h extension that contains class definitions and functions, for example, {exercise_name}.h.
  • a file with the .cpp extension that contains the implementation for classes, for example, {exercise_name}.cpp.