Adding a quiz component #4643
Gitstar-OC
started this conversation in
Ideas
Replies: 2 comments 3 replies
-
Any reply or should I submit a pull request directly? |
Beta Was this translation helpful? Give feedback.
2 replies
-
Just do it dude no one's stopping you. If you can contribute, then contribute. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am thinking of adding a quiz component like the one this next js component have below it for various purposes which it can be used especially in docs, forms or surveys .
I will add options to the question and add a particular property of isAnswer={yes} if that one is answer and one of the many option can be selected and if the correct one is selected as a quiz it will be shown a promt of something that the developer wants to show or a more easier one like congratulations and for the generic one the developer could select a more normal one like incorrect option please select another one.
Here's the step by step process in the Shadcn way,
1st step will be that the user will need to import the Quiz, QuizQuestion, QuizOption and one as a QuizAnswer ( in place of creating the isAnswer function for now). Here's an example code block
We can also add more options or functions to it as if developer wants to show answer to user on selecting the incorrect option or giving more detail about the answer once a option or answer is selected for example for the we can add more properties
Here's how we can use it in the above example for more details
More things can be added to this component if this works in the future ( if multiple forms and surveys starts using this component ) like adding multiple correct options to it, filling it up with a text field etc. but right now this is all I can think with one addition to it.
There will also be an option to use an image to be shown in the question for more hard problem solving or if the question is related to the image or video, the developer could add it with the help of a special QuizQuestionImage, QuizQuestionVideo or QuizQuestionBanner component. The image or video will be of the users choice.
Note that this component will also include some of the other components like card ( if used ), tooltip and other icons for the questons and option.
Should I build this component as I will also be using this for the documentation of my website ?
Beta Was this translation helpful? Give feedback.
All reactions