Skip to content

Commit

Permalink
onSubmit in quiz page no need argument
Browse files Browse the repository at this point in the history
  • Loading branch information
leung018 committed Aug 2, 2024
1 parent 61f0454 commit 000ee4b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/components/quiz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class MultipleChoiceQuizUIService {
return (
<MultipleChoiceQuiz
questionSet={questionSet}
onSubmit={(questionSet) => {
onSubmit={() => {
this.questionSetRepo.upsertQuestionSet(
questionSet.newSwappedChoicesQuestionSet(),
)
Expand All @@ -83,7 +83,7 @@ function MultipleChoiceQuiz({
onSubmit,
}: {
questionSet: QuestionSet
onSubmit: (questionSet: QuestionSet) => void
onSubmit: () => void
}) {
const [score, setScore] = useState<number | null>(null)

Expand All @@ -99,7 +99,7 @@ function MultipleChoiceQuiz({

const handleSubmit = () => {
setScore(calculateScore())
onSubmit(questionSet)
onSubmit()
}

const isSubmitted = () => score !== null
Expand Down

0 comments on commit 000ee4b

Please sign in to comment.