import Navbar from "@/components/Navbar"; import {ReadingExam} from "@/interfaces/exam"; import Head from "next/head"; // TODO: Remove this import import JSON_READING from "@/demo/reading.json"; import JSON_USER from "@/demo/user.json"; import {Fragment, useState} from "react"; import Icon from "@mdi/react"; import {mdiArrowRight, mdiNotebook} from "@mdi/js"; import clsx from "clsx"; import {infoButtonStyle} from "@/constants/buttonStyles"; import FillBlanks from "@/components/Exercises/FillBlanks"; import {Dialog, Transition} from "@headlessui/react"; interface Props { exam: ReadingExam; } export const getServerSideProps = () => { return { props: { exam: JSON_READING, }, }; }; function TextModal({isOpen, onClose}: {isOpen: boolean; onClose: () => void}) { return (
Payment successful

Your payment has been successfully submitted. We’ve sent you an email with all of the details of your order.

); } export default function Reading({exam}: Props) { const [exerciseIndex, setExerciseIndex] = useState(-1); const [showTextModal, setShowTextModal] = useState(false); const nextExercise = () => { setExerciseIndex((prev) => prev + 1); }; const renderText = () => ( <>
Please read the following excerpt attentively, you will then be asked questions about the text you've read. You will be allowed to read the text while doing the exercises
{exam.text.title} {exam.text.content.split("\n").map((line) => ( <> {line}
))}
); const renderQuestion = () => { const exercise = exam.exercises[exerciseIndex]; switch (exercise.type) { case "fillBlanks": return ; } }; return ( <> Create Next App
setShowTextModal(false)} />
{exerciseIndex === -1 && renderText()} {exerciseIndex > -1 && exerciseIndex < exam.exercises.length && renderQuestion()}
{exerciseIndex > -1 && ( )}
); }