Skip to content

Show students' Cal 1 Card photos to staff - #98

Closed
rabiachadha wants to merge 1 commit into
mainfrom
roster-photos
Closed

rabiachadha wants to merge 1 commit into
mainfrom
roster-photos

Conversation

@rabiachadha

Copy link
Copy Markdown

Closes #4

Staff now see each student's Cal 1 Card photo, so TAs can learn names. Students never see photos.

Where photos appear

  • Roster cards (Roster tab of a section)
  • Lab, discussion and tutoring attendance lists
  • A student's history page, when staff open it

Students without a photo get a gray placeholder.

How it works

  • SIDs: a new users.sid column (migration 0005_sid) is filled from Canvas's sis_user_id when a student logs in and when staff add a student by email. We confirmed bCourses returns sis_user_id on a student's own profile.
  • C1C: server/c1c_service.py fetches photos the same way seating does (server/services/c1c/__init__.py): GET {C1C_API_DOMAIN}/c1c-api/v1/photo/{sid} with basic auth, through C1C_PROXY_URL, with a 10-second timeout. Any failure means no photo. The setting names match seating's.
  • Route: GET /offerings/<id>/api/students/<user_id>/photo serves the photo only to staff in that course. It sends Cache-Control: private, max-age=3600 and saves nothing. SIDs are never sent to the browser.
  • Development: uses a drawn fake photo unless MOCK_C1C=false.

Not in this PR

  • Deploy settings. The C1C settings and secrets aren't added to the staging or production deploys yet, so deployed Sections shows placeholders until they are.
  • Real photos untested. Seating's proxy answered 407 Proxy Authentication Required from a laptop, so no real photo has come back yet. Waiting on Silas.
  • Students who never log in (e.g. imported from a spreadsheet) have no SID until they do, or until staff re-add them.

Testing

  • 99 unit tests pass. New: tests/unit/test_roster_photos.py, plus SID checks in the login and add-students tests.
  • The a11y audit passes. The photo route is listed as "not a page".
  • Checked locally with the fake Canvas and fake photos: a student with a SID gets a photo (200), and one without gets the placeholder (404).
  • This PR adds a migration, so its preview deploy will say the database needs migrating. Previews share the staging database and don't run migrations.

🤖 Generated with Claude Code

Staff see each student's photo on the roster cards, the attendance lists
and the student's history page, with a placeholder when there's none.

- Store each student's SID (Canvas's sis_user_id) at login and when staff
  add them by email (migration 0005_sid).
- c1c_service.py fetches photos from the C1C API the way seating does:
  /c1c-api/v1/photo/{sid}, basic auth, through C1C_PROXY_URL, with the
  same settings. Development uses a drawn fake unless MOCK_C1C=false.
- GET /api/students/<id>/photo serves a photo to staff in the course
  only, with Cache-Control: private, and nothing is saved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rabiachadha
rabiachadha deleted the roster-photos branch November 17, 2026 08:14
@rabiachadha

rabiachadha commented Nov 17, 2026 •

Copy link
Copy Markdown
Author

Please look at new PR: #99 as base branch on this PR was not updated locally, caused many merged conflicts, so made claude copy them over to new branch

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.

Add roster photos to Sections

1 participant