Lesson Notes & Resources
Tables: lesson_notes, lesson_resources
lesson_notes
What was said about a lesson. Notes belong to a lesson, not a person: each note is its own row, kept for good, and shown with who wrote it and when — a conversation about the lesson rather than one editable box.
Anyone who may see a lesson may add a note to it: its teacher, an admin, the student, or a parent. That is deliberate — “she has a cold, can we make this up?” from a parent and the teacher’s account of the lesson sit in the same short thread. In the UI, notes are saved with a button, never auto-saved, so the writer knows it was written down.
Columns: lesson_id → lessons (ON DELETE CASCADE),
created_by_user_id → users, body, timestamps. Indexed on
(lesson_id, created_at) for reading a lesson’s thread in order.
lesson_resources
Materials attached to a lesson: an uploaded file (a recording, sheet music) or
an external link, each with a title.
resource_typeENUM(file,link) discriminates the two shapes:private_file_id→private_filesis required when the type isfile;urlis required when the type islink. The requiredness is enforced inResourceManagement, not by the database.- Uploaded files live in
private_filesand are served only throughresource_download.php, which authorizes the requester by checking their relationship to the lesson (student, parent, teacher, or admin) via the lesson’s reservation.
Adding materials works on the same terms as notes: anyone who may see the lesson — teacher, student, parent, admin — may attach to it; removing a material is limited to whoever added it, or an admin. Notes and materials render as one conversation thread of chat bubbles, interleaved by time — a voice memo sits in the flow exactly where it was sent, like an attachment in a text thread. The materials editor (on teacher cards and in the family’s lesson modal) accepts drag-and-drop, built for dragging voice memos straight in; materials are also collected on the student’s My Materials page in lesson-date order.
