Skip to content

Scrum 33 backend quizzes#24

Merged
Ligo-code merged 7 commits intomainfrom
SCRUM-33-backend-quizzes
Jan 25, 2026
Merged

Scrum 33 backend quizzes#24
Ligo-code merged 7 commits intomainfrom
SCRUM-33-backend-quizzes

Conversation

@Ligo-code
Copy link
Collaborator

@Ligo-code Ligo-code commented Jan 25, 2026

Quiz Generation Feature

Add AI-powered quiz generation from study resources with complete CRUD operations.

Added:

  • 3 models: Quiz, QuizQuestion, QuizAttempt
  • AI service with Gemini API integration (3-50 questions)
  • 7 protected REST endpoints with rate limiting (20/15min)
  • MongoDB transactions with rollback support

Endpoints:
Generate, list, take, submit, get results, delete quizzes

Screenshot 2026-01-24 at 6 37 00 PM Screenshot 2026-01-24 at 6 38 39 PM Screenshot 2026-01-24 at 6 40 55 PM

I hadn't studied at all(

Screenshot 2026-01-24 at 7 22 07 PM

After studing, I got 100% Yey!!!:

Screenshot 2026-01-24 at 7 30 08 PM

Now, I'm really proud of this result!

Screenshot 2026-01-24 at 7 30 53 PM

And I don't need this quiz anymore.

Screenshot 2026-01-24 at 6 44 59 PM

Kseniia Zakharova added 7 commits January 23, 2026 23:38
… models for quiz feature with proper indexes and validation. QuizQuestion has unique constraint on quizId+order to prevent duplicates. Add validation to Quiz models.
…ered quiz generation with comprehensive validation including text length checks, question count limits, and strict validation of AI response structure to prevent malformed quiz data.Add markdown code block removal from AI responses, export QUIZ_LIMITS constants for controller validation, and enhance prompt clarity to ensure valid JSON output.
…ent quiz controller with AI generation, MongoDB transactions, rollback on errors, and comprehensive validation. All 7 quiz endpoints include proper auth checks and error handling.
…h 7 endpoints for quiz generation, management, and taking. Mount routes in app.ts with authentication middleware.
…limits to constants.ts for consistency, update quizGenerator to use centralized constants, and add rate limiting (20 requests per 15 minutes) to quiz generation endpoint to prevent AI API abuse
@AidaBur
Copy link
Collaborator

AidaBur commented Jan 25, 2026

I tested quiz generation with different question counts.
Generation works reliably for 5–10 questions, but starts failing around 15+, even though backend validation allows up to 50.
This seems to be an LLM limitation rather than a backend issue. Given that we agreed 10 questions is the comfortable default, it probably makes sense to enforce this limit on the frontend to avoid unnecessary generation failures.

Overall, the quiz flow looks solid.
As a minor improvement, error response formats could be unified for easier frontend handling (some return { success: false, error: "..." } while others return { error: "..." }). This is not blocking.

Great work overall! LGTM and good to go 👍

@Ligo-code Ligo-code merged commit 52325b8 into main Jan 25, 2026
2 checks passed
@Ligo-code Ligo-code deleted the SCRUM-33-backend-quizzes branch January 25, 2026 22:37
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.

2 participants