Sections & Teacher Assignment
A school's structure is Class → Section → Students. Sections are created on the Sections page; each section belongs to one class (e.g. "Class 8 / Section A"). Teachers can be attached to a section in two distinct roles: a single class teacher for the whole section (think homeroom — owns attendance and section-wide broadcasts), and any number of subject teachers (one per subject within the section). The two roles are managed in different UIs, on purpose.
At a glance
| Who can do this | Admins assigned to the school. Super admin via the school-scoped routes. |
| Where it lives | Admin panel → /dashboard/school/:id/sections (sections + class teacher) and /dashboard/school/:id/teachers row dropdown → Manage Sections (subject-teacher assignments) |
| Class teacher | One per section. Removed before assigning a new one. Surfaces in the teacher's app with a "Class Teacher" badge and unlocks section-wide tools. |
| Subject teacher | Many per section (one per subject). Authored lessons/homework/diary entries are scoped to a (section, subject) tuple. |
| Related features | Teacher Creation · Student Creation · Yearly Plans |
How it flows
Step-by-step — creating a section
1. Open the Sections page
- Route:
/dashboard/school/:id/sections - Page title Sections, description "Manage class sections for your school".
- Click Create Section (top-right).
2. Fill the create modal
| Field | Required | Notes |
|---|---|---|
| Class | Yes | Single-select from the classes already assigned to this school. If empty: "No classes available. Please assign classes to this school first." |
| Section Name | Yes | 1–50 chars (e.g. "A", "B", "1", "Beta") |
| Roll Number Assignment | Yes (default Alphabetical) | One of Alphabetical, Reverse Alphabetical, Manual/Existing — controls how roll numbers are generated/preserved when students are added. |
Submit → toast "Section created successfully". The section appears in the table with 0 students and no class teacher.
3. Edit / view / delete a section
Each row in the Sections table has a kebab menu:
- Edit Details — change the section name, class link, or roll-number rule.
- Assign Class Teacher — see flow below.
- View Students — opens a side modal listing the section's roster (and lets you reassign students between sections).
- Remove Section — confirms with the warning "Sections with students or assigned teachers cannot be deleted." (The system blocks deletion if either is true; clear the section first.)
Clicking a row (away from the kebab) opens View Students — useful for fast roster checks.
Step-by-step — assigning a Class Teacher
Where
- Sections page → row kebab menu → Assign Class Teacher.
What you see
- Modal title: Assign Class Teacher —
<section name>(with a crown icon). - If a class teacher is already assigned, the modal shows their card with a "CLASS TEACHER" gold tag and a red ✕ to remove them. While someone is assigned, the Assign button is disabled and there's a hint "Remove the current class teacher to assign a new one."
- If no class teacher is assigned:
- A single-select dropdown shows available teachers (i.e. teachers in this school who are NOT already class teacher of another section).
- If no teachers are available: "All teachers are already assigned as class teachers."
Submit
- Pick a teacher → click Assign → toast "Class teacher assigned successfully".
- The Sections table row updates to show the teacher's name + a gold "CT" tag.
- The Teachers list also reflects this — that teacher's row gains a "CLASS TEACHER" pill showing the section name.
Remove a class teacher
- Click the red ✕ on the existing teacher card → confirm "Are you sure you want to remove the current class teacher from
<section>?" → confirm. - The teacher returns to the available-teachers pool and can be re-assigned (to this section or a different one).
Step-by-step — assigning Subject Teachers
This is where most of the assignment work happens.
Where
- Teachers page (
/dashboard/school/:id/teachers) → row kebab menu → Manage Sections.
What you see
- Modal title: Assign Sections & Subjects —
<teacher name>. - A two-step flow inside one modal:
Step 1 — Select Sections
- Multi-select labeled "Choose one or more sections…", showing options like "
<class name>—<section name>".
Step 2 — Assign Subjects per Section
- For each section you picked, a card appears showing the class+section heading.
- Inside each card, a multi-select shows that class's subjects (filtered to subjects assigned to the school for this class). Pick the ones this teacher will teach.
- Required validation: at least one subject per selected section. If a section has zero subjects in the registry, the card displays "No subjects found for this class in the registry."
Currently Assigned (lower section)
- Below the selectors, a list of the teacher's existing assignments is shown grouped by section. Each subject is a closable tag — click the X to unassign that subject without leaving the modal.
- Sections where the teacher is also class teacher show a gold "CLASS TEACHER" pill (read-only context — class-teacher status isn't managed here).
Submit
- Click Save Assignments → toast either "
<n>subjects assigned successfully!" or "All selected subjects were already assigned." (no-op safety). - The modal refreshes its Currently Assigned section in place.
What a teacher unlocks once assigned
After admin assignments are saved, on the teacher's next teacher-app dashboard load:
- Subject teacher: their dashboard surfaces each
(section, subject)pair they own. They can:- Create homeworks / lessons / diary entries scoped to those pairs.
- See submissions and student rosters for those scopes.
- Class teacher: in addition to any subject-level scopes, they get section-wide tools:
- Section roster, attendance, broadcast alerts to the whole section.
- The teacher app shows a "Class Teacher" badge next to the section.
Without any assignment, a teacher can log in but their dashboard is essentially empty — they have no scope to author content against.
Edge cases & things to test
- Create section with no classes assigned to school: open the create modal — confirm the Class dropdown is disabled with the helpful message ("No classes available…") and Save is blocked.
- Section name uniqueness: create "Section A" twice under Class 8 — does the system allow duplicates? (Verify; deduping rules vary.)
- Section name max length: try 51 characters — should fail validation "Section name must be at most 50 characters".
- Delete section with students: try to delete a section that has even one student — confirm the delete is blocked with a clear message (the create-modal warning hints at this).
- Delete section with class teacher only: section has 0 students but a class teacher — confirm delete is also blocked (the rule is "students OR teachers").
- Class teacher already assigned elsewhere: pick a teacher who's class teacher of Section 8-A, try to assign them to Section 8-B — confirm they don't appear in the available list.
- Remove + re-assign in one session: remove the current CT and immediately try to assign a new one without closing the modal — confirm the available-teachers list refreshes (the freshly-removed teacher now appears in it).
- Subject teacher: zero subjects for a class: the school hasn't registered any subjects for Class 8 yet — confirm the per-section subject card shows "No subjects found for this class in the registry" and Save is blocked.
- Subject already assigned: assign Math to Teacher A in Section 8-A; then try to assign Math to Teacher B in the same section. Decide whether the system permits multiple subject teachers for the same
(section, subject)or rejects it. - Unassign last subject in a section: in the closable-tag list, remove the only subject for a section — confirm the section disappears from the teacher's app dashboard on next load.
- Two-tier role: same teacher is both class teacher of Section 8-A AND subject teacher of Math in 8-A — confirm both surfaces work and the teacher app doesn't double-list the section.
- Class teacher removed mid-term: a class teacher is removed while students are mid-attendance entry. Confirm the teacher app gracefully drops the section-wide controls without crashing the in-progress flow.
- Section move: a student is moved from Section A to Section B. Confirm subject teachers of Section B see them in their roster and Section A's teachers no longer do.
- Roll number rule = Manual: create a section with rule "Manual/Existing" — confirm new students added via the wizard preserve any incoming roll numbers (or behave per the chosen rule).
- Search & pagination on Sections: search "8" while on page 2 — confirm the page resets and matches "Class 8 — A" etc.
Related
- Teacher Creation — create the teachers you'll assign here
- Student Creation — students must be in a section to appear in any roster
- Yearly Plans — once assigned, subject teachers operate against the yearly plan
- Sub-Admin & Access Control — admin role required to manage sections/assignments