From 7cff3139fed64b656999bef1c2548ff0d21e0686 Mon Sep 17 00:00:00 2001 From: Ibrahim-Halil-Kuray <71791007+Ibrahim-Halil-Kuray@users.noreply.github.com> Date: Sun, 29 Oct 2023 10:37:28 +0100 Subject: [PATCH] Create Questions.tsx --- src/components/Questions.tsx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/components/Questions.tsx diff --git a/src/components/Questions.tsx b/src/components/Questions.tsx new file mode 100644 index 0000000..ea2390c --- /dev/null +++ b/src/components/Questions.tsx @@ -0,0 +1,25 @@ +import React, { useState, useEffect } from 'react'; + +interface QuestionsProps { + apiUrl: string; // get data from backend +} + +interface Question { + question: string; + options: string[]; + correct_answer: number; + explanation: string; +} + +const Questions: React.FC = ({ apiUrl }) => { + const [questions, setQuestions] = useState([]); + const [currentQuestionIndex, setCurrentQuestionIndex] = useState(0); + const [userAnswers, setUserAnswers] = useState([]); + const [isTimeUp, setIsTimeUp] = useState(false); + const [isAnswered, setIsAnswered] = useState(false); + const [timer, setTimer] = useState(0); + + return
; +}; + +export default Questions;