wingkwong / react-quiz-component

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

start quiz in a new window #152

Closed trash369 closed 1 year ago

trash369 commented 1 year 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 1 year 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 1 year ago

Thank you @wingkwong Now its working perfectly