diff --git a/app/game/[id]/AnswerPage.tsx b/app/game/[id]/AnswerPage.tsx new file mode 100644 index 0000000..4e29af0 --- /dev/null +++ b/app/game/[id]/AnswerPage.tsx @@ -0,0 +1,120 @@ +"use client"; +import Link from "next/link"; +import quizs from "@/lib/database"; +import { useRouter } from "next/navigation"; +import { useState } from "react"; +import { useSearchParams } from "next/navigation"; + +interface AnswerPageProps { + id: string; +} + +export function AnswerPage({ id }: AnswerPageProps) { + const searchParams = useSearchParams(); + const correct = searchParams.get("correctOrWrong") === "true"; + const view = searchParams.get("view") === "true"; + const currentQuiz = quizs.quizs[Number(id)]; + const [selectedOption, setSelectedOption] = useState(""); + const [score, setScore] = useState(0); + const router = useRouter(); + + return ( +
บริหารการเงิน
++ {currentQuiz.id} quiz +
++ {currentQuiz.question} +
++1 coin
+-1 coin
+เฉลย: {currentQuiz.answer}
++1 coin
+-1 coin
+เฉลย: {currentQuiz.answer}
+บริหารการเงิน
-{currentQuiz.id} quiz
-{currentQuiz.question}
-+1 coin
--1 coin
-เฉลย: {currentQuiz.answer}
-+1 coin
--1 coin
-เฉลย: {currentQuiz.answer}
-