We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 260633b commit 918db58Copy full SHA for 918db58
components/mdx/Quiz.tsx
@@ -89,7 +89,7 @@ const Quiz: FC<QuizProps> = (props: QuizProps) => {
89
correctAnswers &&
90
correctAnswers.indexOf(currentQuestionIndex) !== -1 &&
91
quiz.questions[currentQuestionIndex].options[optionIndex].correct &&
92
- answers[currentQuestionIndex].includes(optionIndex)
+ answers[currentQuestionIndex]?.includes(optionIndex)
93
) {
94
return 'green.500'
95
}
@@ -162,6 +162,7 @@ const Quiz: FC<QuizProps> = (props: QuizProps) => {
162
const cancelQuiz = () => {
163
setAnswers({})
164
setShowQuiz(false)
165
+ setCorrectAnswers(null)
166
setCurrentQuestionIndex(0)
167
168
0 commit comments