Skip to main content

Teacher Creation

A school admin adds a teacher from the school-scoped Teachers page. The flow is a single modal (not a wizard): email + names + department + joining date. On submit, the teacher gets an email with a set-password link; once they pick a password they can log into the teacher app, but they only see classes/sections/subjects after the admin assigns them. There's also a CSV bulk import for hiring season.

At a glance

Who can do thisAdmins assigned to the school. Super admin via the school-scoped route.
Where it livesAdmin panel → /dashboard/school/:id/teachersCreate Teacher (manual) or the Bulk Import CSV button
Credential deliveryEmail invite only. No "set initial password" field; the teacher's password is set by the teacher themselves via the emailed link.
First-login experienceTeacher app dashboard is mostly empty until the admin assigns sections + subjects (and optionally promotes them to class teacher of a section).
Related featuresStudent Creation · Sections & Teacher Assignment · Sub-Admin & Access Control

How it flows

Step-by-step — Manual (single-modal) creation

1. Open the page

  • Route: /dashboard/school/:id/teachers.
  • Page title Teachers, description "Manage your school teachers".
  • Click Create Teacher (top-right).

2. Fill the form

FieldRequiredNotes
EmailYesValidated as email. Live uniqueness check before submit — if the email is already a Scholiphi user, inline error "This email is already registered."
First NameNo (optional)Free-text
Last NameNo (optional)Free-text
DepartmentNoFree-text up to 200 chars (e.g. "Science & Mathematics"). Display-only metadata.
Joining dateNoDate picker, format YYYY-MM-DD

Notice: there is no password field in this modal. The teacher always picks their own password via the email link. The admin cannot pre-set a password from this page (super admin can reset other admins' passwords, but there is no equivalent for teachers in the UI today).

3. Submit

  • Click Create.
  • On success: toast "Teacher created successfully", modal closes, table refreshes. The new row shows tag INVITATION PENDING and a Resend Invite action in its dropdown until the teacher sets their password.
  • On failure with "already exists" in the error string, the email field is highlighted with "This email is already in use".

4. The teacher receives the invite and sets their password

  • Email contains a /setup-password?token=... link.
  • They open it, enter Password + Confirm Password (min 6 chars, must match), submit.
  • Toast: "Password set successfully". Auto-redirected to login after 2 seconds.

5. Teacher logs into the teacher app

  • Login at the teacher app's login screen with email + password.
  • The teacher's dashboard initially shows no classes, no sections, no subjects. They can edit their own profile and explore but cannot create lessons, homeworks, or alerts until an admin assigns them.

6. Admin unlocks the teacher with assignments

This is the step that actually makes the teacher useful. From the Teachers table:

  • Manage Sections (kebab menu on the row) → opens the Assign Sections & Subjects modal:
    1. Select one or more sections from the multi-select.
    2. For each selected section, a per-section subject multi-select appears (filtered to that section's class). Pick the subjects this teacher will teach in that section.
    3. The modal also displays the teacher's Currently Assigned groups, with each subject as a closable tag for quick unassignment.
    4. Click Save Assignments — toast counts how many were newly created (e.g. "3 subjects assigned successfully").
  • Class Teacher (separate flow) — to make this teacher the class teacher of a section, go to Sections page → row dropdown → Assign Class Teacher (one class teacher per section, max). See Sections & Teacher Assignment.

Once assignments exist:

  • The teacher app's dashboard surfaces those sections/subjects.
  • The teacher can create lessons/homework/diary/alerts scoped to those sections.
  • If they're the class teacher of a section, the teacher app additionally shows a "Class Teacher" tag and gives them section-wide controls (attendance, broadcasts).

Step-by-step — Bulk CSV import

  • Where: Same Teachers page → Bulk Import button (top of table).
  • Accept: .csv only.
  • Upload runs immediately on file selection; school is taken from the URL :id.
  • Toast on success: "Teachers imported successfully" + table refresh. On failure: "Import failed" or the backend message.
  • Same caveats as student bulk import: no in-UI template download, partial successes don't surface per-row errors in the toast.

Other admin actions on a teacher row

  • View Portfolio — navigates to /dashboard/school/:id/teachers/:teacherId for full details.
  • Resend Invite — only visible while isPasswordSet === false; re-sends the password setup email.
  • Account toggle (Switch in the row) — flips isActive (label: "Active" / "Locked"). A locked teacher cannot log in.
  • Remove Faculty — confirm modal, hard-deletes the teacher. Their assignments are detached; lessons/homework they previously authored stay (but verify behavior in the test suite).

Edge cases & things to test

  • Email already a parent/student: try creating a teacher with an email that's a parent in the same school — confirm the live check rejects it with "This email is already registered" (one user can't be both a teacher and a parent at this email).
  • No first/last name: submit with only email + department + joining date. Confirm the teacher is created and the table row shows "N/A" for the name (no crash).
  • Department > 200 chars: paste 201 chars — confirm the maxLength prop blocks input.
  • Joining date in the future: pick a date 6 months out — does the system allow it? (Profile-level metadata only; verify it doesn't break attendance or any cron logic that pivots on it.)
  • Login before password set: the teacher tries to log in to the teacher app before opening the email — confirm it fails with a clear message ("password not set" or generic "invalid credentials"), not a hang.
  • Login before assignments: teacher logs in but admin hasn't assigned sections — confirm the teacher app's UI degrades gracefully (empty states, no broken navigation) and that they can't accidentally create content for sections they don't own.
  • Assignment overlap: assign Teacher X to subject Math in Section 8-A. Then re-assign — confirm the modal's "All selected subjects were already assigned" info-toast fires (no duplicate rows).
  • Class teacher conflict: a teacher already class-teacher of Section 8-A — try to assign them to Section 8-B as class teacher. Confirm the second assignment fails (one section per teacher rule) and the modal's available-teachers list excludes them.
  • Remove class teacher: from Sections page, on a section with a class teacher, click "Assign Class Teacher" → click the X next to the existing teacher → confirm — confirm they're removed and the available list refreshes to include them again.
  • Bulk CSV — duplicate emails inside the file: upload a CSV where rows 3 and 7 share an email — confirm one wins, the other is skipped/errored.
  • Bulk CSV — wrong school: a CSV whose rows reference subjects/classes not assigned to this school — confirm rows are rejected with clear errors (and not silently dropped).
  • Resend invitation rate limit: rapidly click Resend Invite five times — confirm there's some safeguard (or at minimum that the teacher doesn't get five emails).
  • Delete teacher with active assignments: deleting a teacher with current section assignments — confirm assignments are removed cleanly and no orphaned references appear in the Sections page (e.g. "CT" badge still pointing to the removed teacher).
  • Mobile modal: open the create modal at <768px — confirm it's full-width and all fields are reachable without horizontal scroll.