Interactive training exercises¶
These guided labs walk learners through the ddi-l CRUD API. Each lab is
designed for live facilitation or self-paced study.
Lab 1: Build a survey from scratch¶
Objectives
- Create a study, add questions and variables, and save to XML.
- Practice using the CRUD API in a Python session.
Steps¶
-
Install
ddi-land open a Python session: -
Create a study:
-
Add at least three questions and three variables. Link each variable to its question:
-
Add a concept and a universe:
-
Save and validate:
Checkpoint
Your file lab1.xml should contain at least 3 questions, 3 variables,
1 concept, and 1 universe.
Lab 2: Open, modify, and re-validate¶
Objectives
- Open an existing DDI file.
- Add new content and remove existing items.
- Validate and save.
Steps¶
-
Open the file from Lab 1:
-
Add a code list and two categories:
-
Find a variable by identifier and remove it:
-
Validate and save:
Checkpoint
lab2.xml should have one fewer variable than lab1.xml and include
a code list with categories.
Lab 3: CLI validation¶
Objectives
- Use the
ddicommand-line tool to validate and inspect documents.
Steps¶
-
Validate a file:
-
Convert to JSON:
-
Run lint checks:
-
Round-trip a file:
Checkpoint
All commands should complete without errors.