Next.js Discord

Discord Forum

How should I generate questions for quiz web app?

Unanswered
Iridescent shark posted this in #help-forum
Open in Discord
Iridescent sharkOP
I'm building web app which helps learning vocabulary by generation multiple answer questions. For example, term - definition 1, definition 2, definition 3, definition 4 (answer). I also have a data stored in mongo db in format term - definition. My question is where should I generate quiz question?
1) Generate all questions on server side (api route) and send them as array of {term, option 1, option 2, option 3, answer}
2) Send array of term - definition and generate new question each time user answers previous one?
Which option do you think is better to use?

1 Reply

West African Lion
I did something similar as a binary number quiz for my students. I used an array of objects with term and correct answers. Then I created random wrong answers for each question. You could have a second array of wring answers to randomly pull from. I did mine on server side as an api. Not sure if that's the most efficient way, but worked for me.