v2 Gap Analysis — Teacher Management
Teacher Management — V2 Review Gap Analysis
Source: BACKEND-RAMBLINGS.md lines 234-269
Spec: docs/admin-spec/07-teacher-management.md
Implementation: src/pages/teacher-management/
Screens covered
- Teachers list
- Teacher profile / Teacher Detail
- Teacher Assignment Criteria
(Stakeholder does not mention TA Reports or Student Groups — these remain per spec; not analyzed here.)
Teachers list
Matches
- Name, Email, Status, Assigned Students columns present
- Avg Response Time column present and sortable
- Filter by Status (Active/Inactive) ✓
- Filter by Gender (Male/Female) ✓
- Add/Create TA button ✓
- Sortable columns ✓
Expands
Stakeholder requests exact stats, current spec matches:
- Assigned students count per selected semester (✓ present as
assignedStudents) - Avg response time (✓ present, highlighted red if >48 hrs)
- Live sessions per week (✗ MISSING)
- Live session slots per week (✗ MISSING)
Deviates
- Missing semester filter: Stakeholder states "filter by semester" and notes "when a new semester is created, our entire teacher list is automatically copied to that semester." Current implementation has no semester selector on teachers list. Data model (
teachers.ts) is flat and doesn't track semester-specific assignments. Filtering UI present in Student Groups but not Teachers.
Adds
- Groups column (count of assigned groups) — not explicitly requested but related to student assignment scope.
Ambiguous
- Live session metrics: "How many live sessions per week they are scheduled for" + "How many live session slots are there per week" — unclear if these are:
- Distinct metrics (sessions scheduled vs. capacity slots)?
- Derived from
appointments+ta-schedules? - Should be computed and displayed, or entered manually?
- Example: TA has 4 appointment slots open weekly; currently scheduled for 2. Are both shown?
Teacher profile / Detail
Matches
- Profile tab with name, email, timezone, status, gender ✓
- Schedule tab showing weekly availability grid ✓
- Students & Groups tab showing assigned students ✓
- Performance tab with metrics ✓
- Entity header with email, status, timezone, student count, avg response time ✓
Expands
Stakeholder requests exact performance stats — current implementation includes:
- Avg response time (✓)
- Submissions received this semester (✗ labeled "Reviews This Semester" — counts reviewed submissions, not total received)
- Avg grade given (✗ MISSING)
- Pending reviews (✓)
- Student pass rate (✓)
Also requests stats already shown in list:
- Assigned students (✓ in header + Profile tab Assignment Summary)
- Avg response time (✓)
- Live session slots per week (✗ MISSING)
- Live sessions per week (✗ MISSING — mentioned in lines 252–253 of stakeholder notes)
Deviates
- Profile tab labeling: Profile tab shows "Assignment Summary" (students, groups, response time) instead of embedding the teacher-specific profile fields more prominently. Layout is correct but presentation differs slightly from spec intent.
- Submissions metric interpretation: Stakeholder says "submissions received" but implementation counts "reviewed submissions" only. Pending reviews are shown separately, but the distinction may not be clear.
Adds
- Personal leave/holiday section present in Schedule tab ✓ (explicitly requested by stakeholder, line 254)
- Upcoming appointments (next 7 days) shown in Schedule tab ✓
Ambiguous
- "Submissions received this semester": Does this mean:
- Total submissions from all students assigned to this TA this semester?
- Only graded/reviewed submissions (current impl)?
- Should include pending reviews as a separate count?
- Average grade given: Stakeholder requests this metric but current implementation does not compute or display it. Possible data gap: submissions data includes grades but no aggregation logic in PerformanceTab.
Teacher Assignment Criteria
Major section spanning lines 263–269 of stakeholder narration. Current implementation shows a rules-based system; stakeholder describes a criterion-driven, configuration-heavy system with algorithmic weighting. High complexity gap.
Matches
- Repeat student auto-assignment toggle present (spec Section 4.4, matches stakeholder intent: "do not assign same teacher on repeat" is inverted to "auto-assign to previous TA") ✓
- CRUD on rules ✓ (Add Rule, Edit, Delete, Enable/Disable)
- Rules can be prioritized ✓
Expands
Stakeholder specifies granular configuration elements:
Missing from current implementation:
Semester-specific criteria configuration (line 265)
- Current: Single global rule set, no semester selector
- Expected: "Add a semester teacher assignment criteria" — admin selects semester, then configures rules for that semester only
- Spec mentions this implicitly (entry point: "Semester Hub > Setup Checklist")
- Gap: No UI for "which semester is this rule set for?"
Gender matching (line 266)
- Current: Generic "Gender Match" rule present, description mentions it
- Stake holder specifies: "automated to simply match TA gender to student gender"
- Gap: No clear UI for admin to understand or configure this. Is it automatic or configurable?
Max student capacity per TA (line 267)
- Current: Generic "Balanced Load" rule mentions "max 10 students per TA"
- Stakeholder: "maximal student capacity for the semester for each TA" — implies per-TA, per-semester capacity settings, not global
- Gap: Capacity should be configurable per TA, not just a global rule. Where does admin set "TA A can take 8, TA B can take 50"?
TA level specialization (line 267)
- Current: Generic "Level Specialization" rule mentioned
- Stakeholder: "which TAs are dealing with which levels" — needs explicit configuration per TA
- Gap: No UI to map "TA X handles Level 1 & 2, TA Y handles Level 3" or to show this matrix.
New vs. returning student routing (line 267)
- Current: Repeat student auto-assign toggle only
- Stakeholder: "which TAs are dealing with new students and which are dealing with repeat and graduate students"
- Gap: Needs explicit TA → student-type routing config. Is TA A only for new students? TA B for repeats? Should be configurable and visible.
Weighted distribution algorithm (line 269)
- Current: Rules system with priority; no explicit weighted algorithm UI
- Stakeholder: Detailed example: "If one TA can take 10 students and another TA takes 50, and we have 6 students in total, they should be distributed fairly so that everybody gets their 20% filled out. The one that's taking 10 students gets 1 student and the one that's taking 50 students gets 5 students."
- Gap: MAJOR AMBIGUITY
- Is this algorithm automatic (computed at enrollment time)?
- Or must admin enter weights manually?
- How is this visualized? Is it:
- A read-only calculation preview ("if 6 students enroll, distribution will be: TA A gets 1, TA B gets 5")?
- Configurable weights that admin enters ("TA A weight = 0.2, TA B weight = 0.8")?
- Just capacities, and algorithm handles the rest behind scenes?
- Stakeholder description is mathematically clear but doesn't specify UI interaction.
Deviates
- Rule types available: Current implementation lists "Gender Match", "Timezone", "Level", "Capacity". Stakeholder doesn't mention Timezone at all. Rule catalog differs.
- Rule priority model: Spec Section 4.4 says repeat student rule takes priority "before other assignment criteria rules" (system rule, not editable priority). Current impl shows repeat toggle separately, which is correct, but regular rules have configurable priority integers (1, 2, 3, 4). Model is close but not fully aligned to spec's "system rule" vs "assignment rule" distinction.
Adds
- Timezone proximity rule (not requested by stakeholder)
Ambiguous
Weighted distribution algorithm presentation (critical)
- How should admin interact with the weight formula?
- Is there a visualization showing the expected distribution?
- Example: If TA A capacity = 10, TA B = 50, and 60 students enroll, should UI show:
- "Fair split: 10 to A, 50 to B" (read-only)?
- Or allow admin to adjust weights?
- Recommendation: Clarify whether this is deterministic (auto-calculated from capacity only) or admin-configurable (requires weight input).
Per-TA configuration surface
- Stakeholder wants per-TA-per-semester settings (capacity, level, student type).
- Current implementation is global rules.
- Where does admin configure "TA Smith handles Level 1–2, TA Jones handles Level 3"?
- Is this done on the TA Detail page, or within Assignment Criteria?
- Current gap: No per-TA matrix/table to edit capacity, level, and student-type assignments.
Semester binding
- Stakeholder: "semester specific" — rules should apply to one semester only.
- Current: No semester selector visible in Assignment Criteria UI.
- Gap: Unclear if rules are globally applied or if there's a hidden semester context.
Conflict resolution
- Stakeholder prioritizes: "student is assigned to the same gender teacher who handles their level and handles new or returning students."
- Multiple constraints (gender, level, student type, capacity, weighted distribution).
- Ambiguous: If all constraints can't be met (e.g., no female TA handles Level 3 for new students), what's the fallback? Current rule system doesn't express this hierarchy explicitly.
Summary
Net-new screens/sections:
- Semester-specific Assignment Criteria configuration — currently missing selector/context
- Per-TA configuration matrix for capacity, level specialization, and student-type routing (new vs. repeat) — currently not exposed in UI
Biggest deviations:
- Live session metrics missing from teacher list and profile (2 metrics: sessions scheduled, session slots available)
- Average grade given metric missing from Performance tab
- Teachers list lacks semester filter despite stakeholder emphasis on semester-specific data
- Weighted distribution algorithm underspecified — current rules-based system doesn't clearly expose how the weight/fair-split logic is configured or visualized
Assignment criteria complexity:
- Stakeholder narration clearly outlines 6 configuration axes (gender, capacity, level, student type, repeat routing, weighted distribution)
- Current implementation provides only a generic rules engine (4 rule types, no per-TA configuration, no capacity per TA, no student-type routing UI)
- Primary gap: No structured form or matrix to configure per-TA settings; no weighted algorithm visualization
Top ambiguities:
- Weighted distribution: Is it deterministic (capacity only) or does admin tune weights? How is it shown to admin?
- Per-TA specialization UI: Where/how does admin set "TA X handles Level 1–2 only" or "TA Y for new students only"?
- Live session metrics: Are these derived from appointments + schedules, or entered separately? How are "slots" distinct from "sessions"?
- Average grade computation: Which submissions/grades are included? All-time or this-semester?
- Semester context in Assignment Criteria: Is there a semester selector, or is it implied from global context (e.g., Semester Hub entry point)?