Lessons
Intro
Lessons are the core building block of courses, via the relationship of units.
The structure of a lesson is as follows:
- A title
- A description
- An image
- A type (prework or coursework)
- A published status (1 = published, 0 = draft)
- Multiple attachments via the attachments relationship
Lessons are soft-deletable, so they can be restored if they are deleted by mistake. It is important to note this when querying lessons to be displayed in the app.
Managing Lessons
Lessons are managed within the filament creator panel of the app. A lessons menu item is there.
In the lessons menu item, you can:
- Create a new lesson
- Edit an existing lesson
- Delete an existing lesson
- Add attachments to lessons
- See which units a lesson is linked to
Creating a new lesson
The filament TinyMCE package is used to create the content of a lesson. This allows the admin to create rich content for the lesson, including embedding videos, images, and other media and formatting how they wish.
Due to the use of this, the 'vue-dompurify-html' package is used before rendering the content in the app, to ensure that the content is safe.
Attaching lessons to units
Lessons are attached to units via the units relationship.
The units relationship is a many to many relationship, so a lesson can be attached to multiple units, and a unit can have multiple lessons attached to it.
The act of attaching a lesson to a unit is done in the units menu item of the filament creator panel.
A lesson cannot be added to unit from the lessons menu item, because the lessons must be ordered correctly within the unit and this is best done in the units menu item.