Feature Description
Currently, the QUIZ component involves 10 questions per course in all semesters. I propose using a database to store questions instead of hard-coding them onto the website. This allows community contribution, a larger question-set and true learning nature as the answers won't be publicly visible.
Problem It Solves
It improves on the current status of the feature and brings it closer to a production-level build. A student could previously navigate to the repository and view the answers, defeating the purpose of the testing setup.
Proposed Solution
A (Prisma) database connection shall be set up in lib\ instead of the current question list. Current consideration of the file structure is:
lib/
quizData.ts (Keep types only (Quiz, Question interfaces))
db.ts (Database connection (Prisma))
app/
quiz/
page.tsx (Fetch subjects from DB (server component))
[slug]/
page.tsx (Fetch questions from DB (server component))
QuizClient.tsx (No changes needed (receives Quiz prop as before))
prisma/
schema.prisma (DB schema)
A swap-in ready AI version shall be kept in comments for further improvement in another issue. Discussion on this aspect is necessary - design and architecture choices for latency and accuracy.
Additional Context
- Limited changes are expected in about 3 files on the system.
- Due to an extended dependency,
package-lock.json etc shall change (prisma).
- A seeding script will be made available for initial startups.
Kindly assign this issue to me under GSSOC'26. Further discussion is encouraged in this thread.
Feature Description
Currently, the QUIZ component involves 10 questions per course in all semesters. I propose using a database to store questions instead of hard-coding them onto the website. This allows community contribution, a larger question-set and true learning nature as the answers won't be publicly visible.
Problem It Solves
It improves on the current status of the feature and brings it closer to a production-level build. A student could previously navigate to the repository and view the answers, defeating the purpose of the testing setup.
Proposed Solution
A (Prisma) database connection shall be set up in
lib\instead of the current question list. Current consideration of the file structure is:A swap-in ready AI version shall be kept in comments for further improvement in another issue. Discussion on this aspect is necessary - design and architecture choices for latency and accuracy.
Additional Context
package-lock.jsonetc shall change (prisma).Kindly assign this issue to me under GSSOC'26. Further discussion is encouraged in this thread.