feat: Co-teaching and partial credits (#20) - #21
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.DataStoreconverts 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
Alice (2), Bob (1); slot color uses the primary (first) instructor; the instructor filter keeps a slot visible if any assigned instructor matches.step="0.5").Behavior
Testing
🤖 Generated with Claude Code