From 6555e3d6e9cec641568157996d86983528946e00 Mon Sep 17 00:00:00 2001 From: andrewtan2000 Date: Mon, 16 Sep 2024 02:14:36 +0800 Subject: [PATCH] Debug options selection --- app/(main)/test/page.tsx | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/app/(main)/test/page.tsx b/app/(main)/test/page.tsx index 5f41d05..68e2560 100644 --- a/app/(main)/test/page.tsx +++ b/app/(main)/test/page.tsx @@ -279,25 +279,7 @@ const QuizPage: React.FC = () => { fetchData(); }, [selectedTopics, selectedSkills]); - const calculateScore = () => { - if (!quiz) return; - - let score = 0; - quiz.mcqs.forEach((mcq) => { - const selectedOption = selectedOptions[mcq.id]; - const correctOption = mcq.options.find((option) => option.isAnswer)?.no; - - if (selectedOption === correctOption) { - score++; - } - }); - - return score; - }; - const displayScore = () => { - const score = calculateScore(); - const totalQuestions = quiz?.mcqs.length || 0; setCurrentTestQuestionIndex(currentTestQuestionIndex + 1) setShowTestScore(true); setShowTestScoreMessage(`You have completed the class test.`);