wingkwong / react-quiz-component

:orange_book: React Quiz Component
https://wingkwong.github.io/react-quiz-component/
MIT License
370 stars 142 forks source link

start quiz in a new window #152

Closed trash369 closed 11 months ago

trash369 commented 11 months ago

i am getting my quizes as json object stored in mongodb then display as a list. quizes

is there anyway to start quiz in a new page after click start quiz button. i mean pass my JSON object to another page. I am using Nextjs

wingkwong commented 11 months ago

I think you've already answered your question. In your listing page (assuming it is quiz/index.tsx), you don't need to use react-quiz-component. Since you got your quiz data on your mongodb, you can still display the same as your screenshot. Then your custom button should redirect to a quiz page (assuming it is quiz/[id].tsx), in this page you can fetch the corresponding quiz object based on id, then pass to <Quiz /> with disableSynopsis.

trash369 commented 11 months ago

Thank you @wingkwong Now its working perfectly