Skip to content

Lessons

A lesson is a single class within a unit, sorted by ordinal. Its activities are the actual learner-facing steps.

List the lessons of a unit, ordered by ordinal. RLS-scoped.

Inputs:

ArgTypeNotes
unit_iduuidrequired

Result: { "lessons": [ { "id", "unit_id", "ordinal", "title_i18n" }, … ] }

Add a lesson to a unit. Author-role only.

Inputs:

ArgTypeNotes
unit_iduuidParent unit.
ordinal?int ≥ 0Sort position (default 0).
title_i18n?string | mapi18n map or bare string.

Result: { "success": true, "lesson": { "id", "unit_id", "ordinal", "title_i18n" } }

Update a lesson’s ordinal and/or title_i18n. Author-role only. Only provided fields change.

Inputs:

ArgTypeNotes
lesson_iduuidrequired
ordinal?int ≥ 0
title_i18n?string | map

Result: { "success": true, "lesson": {…} }

Delete a lesson. Cascades to its activities. Author-role only.

Inputs:

ArgTypeNotes
lesson_iduuidrequired

Result: { "success": true, "deleted": "<lesson_id>" }