List lifecycle polish and cycle batches, from live walkthrough feedback
Generating a call list is non-destructive by intent: the button reads Regenerate when an unused list exists and replaces it freely, with a confirmation only when the day already has recorded outcomes (which are always kept). The print view shows resolved calls' outcomes, offers generate/regenerate in place, and the home page links to the existing list. The day editor now supports adding calls after the fact (any roster student, with status/assessment/note), completing full editability: add, edit, delete. Cycle mode is now a true rolling rotation driven by non-skipped call counts: batches of n take the next students of the current pass, remainder batches come up short rather than wrapping, a new pass starts when everyone has been called, and the cycle continues across lists and class days. Live mode uses the same rule. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -93,6 +93,24 @@ def test_generate_day_list_cycle_covers_roster(db_session):
|
||||
assert all(c.status == models.STATUS_PENDING for c in generated)
|
||||
|
||||
|
||||
def test_generate_day_list_cycle_batches_continue_across_days(db_session):
|
||||
course, students = make_course(db_session, mode=models.SELECTION_CYCLE)
|
||||
rng = random.Random(1)
|
||||
day2 = DAY + datetime.timedelta(days=2)
|
||||
|
||||
first = calls.generate_day_list(db_session, course, DAY, n=3, rng=rng)
|
||||
assert len(first) == 3
|
||||
# Next day's batch continues the pass: the remaining student only.
|
||||
second = calls.generate_day_list(db_session, course, day2, n=3, rng=rng)
|
||||
assert len(second) == 1
|
||||
assert sorted(c.student_id for c in first + second) == sorted(
|
||||
s.id for s in students
|
||||
)
|
||||
# Pass complete: the next batch starts a fresh pass.
|
||||
third = calls.generate_day_list(db_session, course, day2, n=3, rng=rng)
|
||||
assert len(third) == 3
|
||||
|
||||
|
||||
def test_generate_day_list_weighted_length_and_optouts(db_session):
|
||||
course, students = make_course(db_session)
|
||||
db_session.add(
|
||||
|
||||
Reference in New Issue
Block a user