Our authors lock certain lines of code in some content resources to focus students on specific learning objectives, expose them to good program structure, promote code reading, and reduce cognitive load.
Instructors can now use linelock in their own zyLabs to guide students and provide a low barrier of entry for newer students to understand more complex concepts. This can also be useful to provide scaffolding for a uniform lab experience.
To test it out, first create a new section or edit an existing instructor created section.
Add a new lab to the section and select a language, or open an existing lab. Then, expand the file menu.
- Create
.linelock.json - Update
.linelock.json - Save the lab, or restart the instance to see the files update to display your line locked configuration.
This .linelock.json is configured to allow edits to lines 1-3 in linelocktest.txt and lines 4-6 in main.py:
{
"linelocktest.txt": [
1,
3
],
"main.py": [
4,
6
]
}
The read-only lines in the codepad are indicated by the grey background and gutters. Students can edit any white lines, including adding lines if needed, but the locked lines will remain read-only as they work.
Note: In the image above the linelock config file is exposed, but by default all students will not be able to see .files in their file tree. If you update the linelock file after a student has started, they will need to reset to template to receive the updated config.