Fetch PASS's real per-lesson roster (Eve-Det.asp), show unregistered classmates to teacher #1

Open
mael wants to merge 3 commits from worktree-roster-prefill into main
Owner

Eve-Det.asp (the event-detail popup PASS shows when a student clicks an agenda
entry) returns the actual Formateur(s)/Apprenant(s) list for that event, keyed by
the shared NumEve id. Pulling it eagerly alongside every agenda sync gives:

  • A reliable teacher name (lesson_roster role='teacher') feeding autogen_teacher_
    links, replacing the old free-text "does this line look like a person's name"
    guess as the primary source (kept as fallback for lessons not yet roster-synced).
  • The viewer's own PASS numeric id (student_pass_ids, read off the NomCal hidden
    field) — an exact, non-fuzzy link from a roster row back to a real account once
    that student logs in for the first time.
  • /sign/ now lists every classmate PASS says was in a signed-in student's
    session, not just the subset who'd already registered a teacher link themselves.
    Unregistered ones show with no pair_value — visible to the teacher, but sign()'s
    valid_pairs check can never record a signature against them (needs their own
    account linked via student_pass_ids first). Storing name+PASS id for students who
    haven't opened this app is a deliberate scope call, not an oversight: actually
    letting a teacher batch-sign attendance for someone who's never touched the app
    is a separate, bigger decision this doesn't make.

New tables: lesson_roster, student_pass_ids (additive, no backfill needed).

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01AhtAKWj9fVGNgw3rqv8zAV

Eve-Det.asp (the event-detail popup PASS shows when a student clicks an agenda entry) returns the actual Formateur(s)/Apprenant(s) list for that event, keyed by the shared NumEve id. Pulling it eagerly alongside every agenda sync gives: - A reliable teacher name (lesson_roster role='teacher') feeding autogen_teacher_ links, replacing the old free-text "does this line look like a person's name" guess as the primary source (kept as fallback for lessons not yet roster-synced). - The viewer's own PASS numeric id (student_pass_ids, read off the NomCal hidden field) — an exact, non-fuzzy link from a roster row back to a real account once that student logs in for the first time. - /sign/<token> now lists every classmate PASS says was in a signed-in student's session, not just the subset who'd already registered a teacher link themselves. Unregistered ones show with no pair_value — visible to the teacher, but sign()'s valid_pairs check can never record a signature against them (needs their own account linked via student_pass_ids first). Storing name+PASS id for students who haven't opened this app is a deliberate scope call, not an oversight: actually letting a teacher batch-sign attendance for someone who's never touched the app is a separate, bigger decision this doesn't make. New tables: lesson_roster, student_pass_ids (additive, no backfill needed). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AhtAKWj9fVGNgw3rqv8zAV
Eve-Det.asp (the event-detail popup PASS shows when a student clicks an agenda
entry) returns the actual Formateur(s)/Apprenant(s) list for that event, keyed by
the shared NumEve id. Pulling it eagerly alongside every agenda sync gives:

- A reliable teacher name (lesson_roster role='teacher') feeding autogen_teacher_
  links, replacing the old free-text "does this line look like a person's name"
  guess as the primary source (kept as fallback for lessons not yet roster-synced).
- The viewer's own PASS numeric id (student_pass_ids, read off the NomCal hidden
  field) — an exact, non-fuzzy link from a roster row back to a real account once
  that student logs in for the first time.
- /sign/<token> now lists every classmate PASS says was in a signed-in student's
  session, not just the subset who'd already registered a teacher link themselves.
  Unregistered ones show with no pair_value — visible to the teacher, but sign()'s
  valid_pairs check can never record a signature against them (needs their own
  account linked via student_pass_ids first). Storing name+PASS id for students who
  haven't opened this app is a deliberate scope call, not an oversight: actually
  letting a teacher batch-sign attendance for someone who's never touched the app
  is a separate, bigger decision this doesn't make.

New tables: lesson_roster, student_pass_ids (additive, no backfill needed).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AhtAKWj9fVGNgw3rqv8zAV
Roster-only students in _teacher_candidates now get a real, signable pair_value
("<lesson_id>::pid:<pass_id>") instead of None — the teacher ticks them alongside
registered students and signs once for the whole group, same as before. Since
there's no owner_username yet, the signature/absence lands in new
lesson_signatures_pending / lesson_absences_pending tables (keyed by pass_id)
instead of the real ones.

pass_session._reconcile_pending_signatures migrates those pending rows onto the
real owner_username the moment that student's own pass_id is learned (their first
agenda sync) — the signature just appears on their /lessons and /pdf with no
action needed from them. Already-pending pass_ids are filtered back out of
_teacher_candidates so the teacher doesn't see (or re-sign) someone already
covered.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AhtAKWj9fVGNgw3rqv8zAV
profiles.nom/prenom stayed blank until a student manually visited /profile and
imported their Dossier Etudiant — until then, _teacher_candidates fell back to
showing their raw PASS username on /sign/<token> instead of their name (same
blank fields also left the PDF header's NOM/PRENOM empty). The roster sync
already has the viewer's own real name (their own pass_id shows up as a
role='student' entry in every lesson_roster fetch), so seed profiles from it
automatically — never overwrites a name already set by the user or a prior
Dossier import.

Verified locally: after a resync, m24grama's /sign/<token> row switched from
"m24grama" to "Maël GRAMAIN", with formation/taf/campus untouched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AhtAKWj9fVGNgw3rqv8zAV
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin worktree-roster-prefill:worktree-roster-prefill
git switch worktree-roster-prefill

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff worktree-roster-prefill
git switch worktree-roster-prefill
git rebase main
git switch main
git merge --ff-only worktree-roster-prefill
git switch worktree-roster-prefill
git rebase main
git switch main
git merge --no-ff worktree-roster-prefill
git switch main
git merge --squash worktree-roster-prefill
git switch main
git merge --ff-only worktree-roster-prefill
git switch main
git merge worktree-roster-prefill
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mael/esignature!1
No description provided.