Interactive quiz generating website.
Tools:Quizzgen is a quick clean quiz generating website, inspired by the UI of Duolingo. You simply type in a prompt, then it makes a call to the Groq API which spins up some JSON with the following schema:
const quiz_schema = jsonSchema({
type: 'object',
properties: {
quiz_name: { type: 'string' },
content: {
type: 'array',
items: {
type: 'object',
properties: {
name: { type: 'string' },
questions: {
type: 'array',
items: {
type: 'object',
properties: {
question: { type: 'string' },
responses: {
type: 'array',
items: { type: 'string' },
},
correct_index: { type: 'integer' },
},
required: ['question', 'responses', 'correct_index'],
},
},
},
required: ['name', 'questions'],
},
},
},
required: ['quiz_name', 'content'],
})
After it's done generating, the JSON gets stored in the quizzes table in MongoDB with a unique code property, and the code gets returned to the user who generated it. Then the frontend goes to ./quiz/{code} and the quiz JSON gets fetched from the database according to the unique code. This makes it shareable and repeatable, so instead of just sending back the quiz to the frontend we A) don't burden the network with sending hundreds of lines of JSON and B) allow anyone to play any quiz by simply typing in the code. Each quiz keeps a leaderboard which shows who has the best score, and users can visit past quizzes at ./quiz.