-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
backendbackend stuffbackend stuff
Description
Summary
Implement real-time question creation with rate limiting, validation, and broadcasting to all session participants.
[Estimated hours: 9-10]
Objectives
- Create
question:createevent handler - Implement rate limiting (10 questions per minute)
- Validate question content and visibility
- Save question to database
- Broadcast new question to session room
- Handle anonymous questions properly
Description
When a student asks a question, it should appear instantly for all users in the session (respecting visibility rules). This ticket handles the most critical real-time feature of AskEasy.
User Flow
- Student types question and clicks "Ask"
- Frontend emits
question:createevent - Backend validates content and checks rate limit
- Question saved to database
- Backend broadcasts
question:createdto all users in session - All clients update their question list
Technical Details
File Structure
src/socket/handlers/
└── questionHandlers.ts
Functions:
- handleQuestionCreate(socket, io)
- validateQuestionContent(content)
- checkQuestionRateLimit(userId)
- broadcastQuestion(io, sessionId, question)
Acceptance Criteria
- Student can create question → appears for all users
- Anonymous question doesn't reveal author
- Rate limit blocks after 10 questions in 1 minute
- Rate limit error message shown to user
- Question with visibility "TA" only appears for TAs and professors
- Question with visibility "PROFESSOR" only appears for professors
- Invalid content (too short/long) rejected with error
- Cannot create question when submissions disabled
- Question linked to correct slide if
slideIdprovided
Resources
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
backendbackend stuffbackend stuff