Skip to content

feat: Co-teaching and partial credits (#20) - #21

Merged
Joe-Ortiz merged 1 commit into
mainfrom
feat/co-teaching-partial-credits
Jul 16, 2026
Merged

feat: Co-teaching and partial credits (#20)#21
Joe-Ortiz merged 1 commit into
mainfrom
feat/co-teaching-partial-credits

Conversation

@Joe-Ortiz

Copy link
Copy Markdown
Member

Closes #20

What & why

Courses can now have multiple instructors co-teaching, each assigned their own share of the course's credits, with fractional (floating-point) values supported. Per the issue, each instructor is assigned a number of credits; the split is enforced to total the course's credits, and course credits themselves may now be fractional.

Data model

  • courseInstructors[key] changes from a single instructor-id string to an array of { instructorId, credits } entries.
  • A load-time migration in DataStore converts legacy single-instructor data (the lone instructor inherits the full course credits). The read path tolerates both the old string shape and the new array shape, so existing localStorage and exported JSON keep working.

UI

  • The Edit Course modal replaces the single instructor dropdown with a dynamic list of instructor + credits rows ("+ Add Instructor" / remove), plus a live "Assigned X of Y credits" indicator that turns green when balanced.
  • Save is blocked (with an explanatory alert) when the split doesn't total the course credits or lists an instructor twice.
  • Sidebar and grid show co-teachers as Alice (2), Bob (1); slot color uses the primary (first) instructor; the instructor filter keeps a slot visible if any assigned instructor matches.
  • Course credit inputs accept decimals (step="0.5").

Behavior

  • Workload now sums each instructor's share per scheduled course rather than the whole credit value.
  • Validation flags overlapping-class conflicts per co-teaching instructor.

Testing

  • 98 unit tests pass — added coverage for assignment normalization, the credit-split workload math, the legacy→array migration, and remove-protection for co-taught instructors.
  • 24 e2e tests pass — added 3 for fractional course credits, a 2/1 co-teaching split, and the blocked unbalanced-save case.
  • Manually verified in-app: an unbalanced 2+2 split is rejected while 2+1 saves, and after scheduling the course the workloads read Alice = 2, Bob = 1.

🤖 Generated with Claude Code

Allow multiple instructors on a course, each assigned their own share of
the course's credits, with fractional (floating-point) values supported.

- Data model: per-schedule courseInstructors[key] becomes an array of
  { instructorId, credits } entries; a load-time migration converts legacy
  single-instructor strings (lone instructor inherits full course credits),
  and reads tolerate both shapes for backward compatibility.
- Edit Course modal: dynamic instructor + credits rows with add/remove and a
  live "Assigned X of Y credits" indicator. Save enforces that the split
  totals the course credits and rejects duplicate instructors.
- Workload sums each instructor's share; grid/sidebar show co-teachers and
  their splits; slot color uses the primary instructor; the instructor filter
  keeps a slot visible if any assigned instructor matches.
- Validation flags overlaps per co-teaching instructor.
- Course credits accept fractional values (step 0.5).

Tested: 98 unit + 24 e2e passing (new coverage for the split math,
normalization, migration, remove-protection, and modal flows).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Joe-Ortiz
Joe-Ortiz merged commit a6b7322 into main Jul 16, 2026
4 checks passed
@Joe-Ortiz
Joe-Ortiz deleted the feat/co-teaching-partial-credits branch July 16, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Co-teaching and partial credits

1 participant