Get Hedhog updates in your inbox
New releases, fresh recipes, and breaking changes — no spam.
LMS Submodule
class-groups
Instructor-led classes with calendar sessions (including recurrence), student enrollment, attendance tracking, and class materials.
Source path: libraries/lms/src/class-group
Module file: class-group.module.ts
Introduction
The Class Groups submodule models instructor-led, scheduled offerings of a course — distinct from the on-demand course content managed by the Courses submodule. A class group binds a course to a delivery mode (presential, online, or hybrid), a date range, an optional instructor, and a capacity, and becomes the unit that students actually enroll into and attend.
Enrollment supports two paths: linking an existing person (`POST /lms/classes/:id/students`) or creating a brand-new person record and enrolling them in the same call (`POST /lms/classes/:id/students/create`), which is the common path for walk-in or phone registrations where the person has no prior CRM record. `GET /lms/classes/:id/people/search` powers the enrollment picker UI by searching the broader person directory for enrollment candidates.
Calendar sessions are the actual meeting occurrences of a class group. A session can be created standalone or generated as a recurring series via a `recurrence` block (daily/weekly/monthly/yearly frequency, interval, until-date, and day-of-week selection for weekly patterns) — both at class-group creation time (`sessionTemplate`) and when adding sessions directly. Updates and deletes accept a `scope` of `single` or `series`, letting an editor change just one occurrence or the entire recurring pattern; deletion validates this via a query parameter while update validates it as a body field, an inconsistency worth knowing about. Attendance is recorded per session as a full replace-style array of `{studentId, present, justification?}` entries rather than incremental toggles, simplifying the save logic for an attendance-taking UI.
Materials (files or external links) can be attached either to the class group as a whole or scoped to one specific session, letting an instructor share session-specific handouts alongside general course materials. Note that an `UpdateMaterialDto` exists in source but has no corresponding controller route — materials can be created and deleted but not edited in place today.
HTTP Endpoints
22 endpoints
Paginated, filterable class group list.
- Query
- page, pageSize, search, status, deliveryMode, courseId
Aggregate class group stats.
Full class group details.
- Params
- id (int)
Creates a class group, optionally generating a recurring session series from sessionTemplate.
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| code | string | yes | Unique, max 50 chars |
| courseId | number | yes | — |
| title | string | yes | Max 255 chars |
| deliveryMode | 'presential' | 'online' | 'hybrid' | yes | — |
| startDate | string (ISO8601) | yes | — |
| instructorId | number | no | — |
| description | string | no | — |
| status | 'open' | 'ongoing' | 'completed' | 'cancelled' | no | — |
| endDate | string (ISO8601) | no | — |
| startTime | string (HH:MM) | no | — |
| endTime | string (HH:MM) | no | — |
| weekDays | string | no | — |
| capacity | number | no | Min 1 |
| location | string | no | — |
| virtualRoomUrl | string | no | Max 500 chars |
| sessionTemplate | ClassGroupSessionTemplateDto | no | { title, description?, location?, meetingUrl?, color?, recurrence? } |
Updates class group fields (all optional).
- Params
- id (int)
Deletes a class group.
- Params
- id (int)
Searches people eligible to enroll as students.
- Params
- id (int)
- Query
- q
Lists enrolled students.
- Params
- id (int)
- Query
- search
Enrolls an existing person.
- Params
- id (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| personId | number | yes | — |
Creates a new person and enrolls them in one call.
- Params
- id (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| name | string | yes | Max 255 chars |
| string | no | Max 255 chars | |
| phone | string | no | Max 50 chars |
Student's enrollment profile/progress within the class group.
- Params
- id, personId (int)
Updates student name/email/phone.
- Params
- id, personId (int)
Removes the student's enrollment.
- Params
- id, personId (int)
Lists calendar sessions.
- Params
- id (int)
Adds a session, optionally expanding into a recurring series.
- Params
- id (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| title | string | yes | Max 255 chars |
| sessionDate | string (ISO8601) | yes | — |
| startTime | string (HH:MM) | yes | — |
| endTime | string (HH:MM) | yes | — |
| description | string | no | — |
| location | string | no | — |
| meetingUrl | string | no | Max 500 chars |
| color | string (#RRGGBB) | no | — |
| status | 'scheduled' | 'completed' | 'cancelled' | no | — |
| instructorId | number | no | — |
| recurrence | SessionRecurrenceDto | no | { frequency, interval?, until, daysOfWeek? } |
Updates a session.
- Params
- id, sessionId (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| applyScope | 'single' | 'series' | no | Whether the update applies to this occurrence or the whole recurring series |
Deletes a session; scope=series removes all recurrences.
- Params
- id, sessionId (int)
- Query
- scope (single | series)
Attendance records for a session.
- Params
- id, sessionId (int)
Saves/overwrites attendance for a session.
- Params
- id, sessionId (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| attendance | AttendanceEntryDto[] | yes | { studentId, present, justification? }[] |
Lists materials, optionally filtered to one session.
- Params
- id (int)
- Query
- sessionId?
Creates a material (file or external link).
- Params
- id (int)
Body
| Field | Type | Required | Notes |
|---|---|---|---|
| title | string | yes | Max 255 chars |
| materialType | 'file' | 'link' | yes | — |
| description | string | no | — |
| fileId | number | no | Required when materialType=file |
| url | string | no | Required when materialType=link, max 500 chars |
| sessionId | number | no | — |
| sortOrder | number | no | — |
Deletes a material.
- Params
- id, materialId (int)
MCP Tools
Named tools callable by AI models via the Model Context Protocol (MCP).
lms.classes.listLists class groups with optional pagination and filters
lms.classes.statsReturns summary statistics for class groups
lms.classes.getReturns a single class group by ID with full details
lms.classes.createCreates a new class group
lms.classes.updateUpdates an existing class group
lms.classes.deleteRemoves a class group by ID
lms.classes.people-searchSearches for people that can be added to a class group as students
lms.classes.students.listLists students enrolled in a class group
lms.classes.students.enrollEnrolls an existing person as a student in a class group
lms.classes.students.enroll-newCreates a new person and immediately enrolls them in a class group
lms.classes.students.getReturns the profile and progress of a specific student in a class group
lms.classes.students.updateUpdates a student's profile data within a class group
lms.classes.students.removeRemoves a student from a class group
lms.classes.sessions.listLists all sessions scheduled for a class group
lms.classes.sessions.createCreates a new session for a class group, with optional recurrence
lms.classes.sessions.updateUpdates a session in a class group
lms.classes.sessions.deleteDeletes a session; use scope=series to delete a whole recurring series
lms.classes.sessions.attendance.getReturns the attendance list for a specific session
lms.classes.sessions.attendance.saveSaves attendance records for a session
lms.classes.materials.listLists materials for a class group, optionally filtered by session
lms.classes.materials.createCreates a new material (file or link) for a class group
lms.classes.materials.deleteDeletes a material from a class group