Summary
Add a toggle in the instructor/professor room view to show or hide student identities, so names can be safely hidden while questions and slides are projected on a classroom screen.
[Estimated hours: 3-4]
Objectives
Description
Instructors often project the slides and live Q&A on the classroom screen (e.g. CSC209 lectures). Today the instructor view always shows the real author of a question — including authors revealed via the question:author:revealed socket event — which leaks student names to the whole room and contradicts the point of anonymous questions.
This ticket adds a single client-side toggle in the instructor view that hides all identifying info from the rendered list, turning the instructor's screen into a "projection-safe" view without changing what data the instructor could otherwise see. Flipping it back instantly restores names for private grading/triage.
User Flow
Professor/TA opens the room view
→ Toggle "Hide names (projection mode)" is ON by default
→ All questions/answers render with authors hidden (no name, no role icon, no utorid)
→ Professor projects screen safely
→ Professor flips toggle OFF on their own laptop later
→ Real authors (incl. revealed anonymous authors) appear again
→ Choice persists across refresh (localStorage)
Technical Details
Affected Files
src/app/room/classChat/
├── ChatHeader.tsx # Add toggle control (render only for PROFESSOR/TA)
├── index.tsx # Hold `projectionMode` state, gate author data passed down,
│ # persist to localStorage
└── post/
├── PostUtils.tsx # renderUsername()/renderRoleIcon() respect projectionMode
├── QuestionPost.tsx # Pass projectionMode into renderUsername()
└── index.tsx # Pass projectionMode through to answer rendering
Implementation Notes
- Role is already known in the room via
/api/sessions/{sessionId}/my-role; only render the toggle when role is TA or PROFESSOR.
- Reuse the existing
renderUsername() / renderRoleIcon() helpers in PostUtils.tsx. When projectionMode is on, render the same anonymized output a student would see (e.g. "Anonymous", no role icon), regardless of isAnonymous or revealed-author state.
- This is presentation-only: do NOT change socket payloads, the
question:author:revealed flow, or what the server sends. The instructor still receives author data; the UI simply does not display it while the toggle is on.
- Keep this distinct from the per-post
isAnonymous flag and the globalIsAnonymous compose toggle (classChat/index.tsx) — those control how a post is submitted; this controls how the instructor views the room.
- Persist under a stable key, e.g.
localStorage["room:projectionMode"].
Acceptance Criteria
Notes
- Future enhancement: make this a persisted per-session setting on the
Session model (e.g. defaultProjectionMode) so it applies across an instructor's devices — out of scope here, this ticket is client-side only.
- Pairs well with the slide viewer panel; consider surfacing the toggle near the presenter/slide controls in a follow-up.
Summary
Add a toggle in the instructor/professor room view to show or hide student identities, so names can be safely hidden while questions and slides are projected on a classroom screen.
[Estimated hours: 3-4]
Objectives
Description
Instructors often project the slides and live Q&A on the classroom screen (e.g. CSC209 lectures). Today the instructor view always shows the real author of a question — including authors revealed via the
question:author:revealedsocket event — which leaks student names to the whole room and contradicts the point of anonymous questions.This ticket adds a single client-side toggle in the instructor view that hides all identifying info from the rendered list, turning the instructor's screen into a "projection-safe" view without changing what data the instructor could otherwise see. Flipping it back instantly restores names for private grading/triage.
User Flow
Technical Details
Affected Files
Implementation Notes
/api/sessions/{sessionId}/my-role; only render the toggle when role isTAorPROFESSOR.renderUsername()/renderRoleIcon()helpers inPostUtils.tsx. WhenprojectionModeis on, render the same anonymized output a student would see (e.g. "Anonymous", no role icon), regardless ofisAnonymousor revealed-author state.question:author:revealedflow, or what the server sends. The instructor still receives author data; the UI simply does not display it while the toggle is on.isAnonymousflag and theglobalIsAnonymouscompose toggle (classChat/index.tsx) — those control how a post is submitted; this controls how the instructor views the room.localStorage["room:projectionMode"].Acceptance Criteria
question:author:revealedare NOT displayedNotes
Sessionmodel (e.g.defaultProjectionMode) so it applies across an instructor's devices — out of scope here, this ticket is client-side only.