diff --git a/src/components/Exercises/FillBlanks.tsx b/src/components/Exercises/FillBlanks.tsx
index 6172b32b..1a670d33 100644
--- a/src/components/Exercises/FillBlanks.tsx
+++ b/src/components/Exercises/FillBlanks.tsx
@@ -44,20 +44,20 @@ function WordsPopout({words, isOpen, onCancel, onAnswer}: WordsPopoutProps) {
List of words
-
+
{words.map((word) => (
onAnswer(word.word)}
disabled={word.isDisabled}
- className={clsx("btn btn-wide gap-4 relative text-white", infoButtonStyle)}>
+ className={clsx("btn sm:btn-wide gap-4 relative text-white", infoButtonStyle)}>
{word.word}
))}
-
+
Close
@@ -100,7 +100,7 @@ export default function FillBlanks({id, allowRepetition, prompt, solutions, text
return (
<>
-
+
({word, isDisabled: allowRepetition ? false : userSolutions.map((x) => x.solution).includes(word)}))}
isOpen={!!currentBlankId}
@@ -110,7 +110,7 @@ export default function FillBlanks({id, allowRepetition, prompt, solutions, text
setCurrentBlankId(undefined);
}}
/>
-
+
{prompt.split("\\n").map((line, index) => (
{line}
@@ -128,7 +128,7 @@ export default function FillBlanks({id, allowRepetition, prompt, solutions, text
-
+
diff --git a/src/components/LevelLabel.tsx b/src/components/LevelLabel.tsx
index 784f3c1f..3eb45125 100644
--- a/src/components/LevelLabel.tsx
+++ b/src/components/LevelLabel.tsx
@@ -8,5 +8,5 @@ interface Props {
export default function LevelLabel({experience, className}: Props) {
const {label} = levelCalculator(experience);
- return
{label} ;
+ return
{label} ;
}
diff --git a/src/components/LevelProgressBar.tsx b/src/components/LevelProgressBar.tsx
index e9bb630e..7c6908d9 100644
--- a/src/components/LevelProgressBar.tsx
+++ b/src/components/LevelProgressBar.tsx
@@ -12,7 +12,7 @@ export default function LevelProgressBar({experience, className, progressBarWidt
return (
-
+
Lvl. {levelResult.currentLevel}
Lvl. {levelResult.nextLevel}
diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx
index d58b2497..b1c633f9 100644
--- a/src/components/Navbar.tsx
+++ b/src/components/Navbar.tsx
@@ -1,16 +1,18 @@
import axios from "axios";
import Link from "next/link";
import {useRouter} from "next/router";
+import {Button} from "primereact/button";
import {Menubar} from "primereact/menubar";
import {MenuItem} from "primereact/menuitem";
interface Props {
profilePicture: string;
timer?: number;
+ showExamEnd?: boolean;
}
/* eslint-disable @next/next/no-img-element */
-export default function Navbar({profilePicture, timer}: Props) {
+export default function Navbar({profilePicture, timer, showExamEnd = false}: Props) {
const router = useRouter();
const logout = async () => {
@@ -50,7 +52,7 @@ export default function Navbar({profilePicture, timer}: Props) {
},
];
- const end = timer && (
+ const endTimer = timer && (
{Math.floor(timer / 60) < 10 ? "0" : ""}
{Math.floor(timer / 60)}:{timer % 60 < 10 ? "0" : ""}
@@ -58,9 +60,15 @@ export default function Navbar({profilePicture, timer}: Props) {
);
+ const endNewExam = (
+
+
+
+ );
+
return (
-
+
);
}
diff --git a/src/components/ProfileCard.tsx b/src/components/ProfileCard.tsx
index 40d97eb6..b846e4cc 100644
--- a/src/components/ProfileCard.tsx
+++ b/src/components/ProfileCard.tsx
@@ -11,17 +11,17 @@ interface Props {
export default function ProfileCard({user, className}: Props) {
return (
-
+
-
+
- {user.name}
+ {user.name}
-
+
);
}
diff --git a/src/exams/Finish.tsx b/src/exams/Finish.tsx
index 86e53e75..442bdd16 100644
--- a/src/exams/Finish.tsx
+++ b/src/exams/Finish.tsx
@@ -52,10 +52,9 @@ export default function Finish({user, scores, modules, onViewResults}: Props) {
return (
-
+
-
You have finished the exam!
{modules.map((module) => (
))}
-
+
diff --git a/src/exams/Reading.tsx b/src/exams/Reading.tsx
index 014a1262..0fac3a62 100644
--- a/src/exams/Reading.tsx
+++ b/src/exams/Reading.tsx
@@ -100,27 +100,27 @@ export default function Reading({exam, showSolutions = false, onFinish}: Props)
};
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.content.split("\\n").map((line, index) => (
{line}
))}
- >
+
);
return (
<>
setShowTextModal(false)} />
-
+
{exerciseIndex === -1 && renderText()}
{exerciseIndex > -1 &&
exerciseIndex < exam.exercises.length &&
@@ -130,7 +130,8 @@ export default function Reading({exam, showSolutions = false, onFinish}: Props)
exerciseIndex < exam.exercises.length &&
showSolutions &&
renderSolution(exam.exercises[exerciseIndex], nextExercise, previousExercise)}
-
-1 ? "w-full justify-between" : "self-end")}>
+
-1 ? "w-full justify-center md:justify-between" : "self-end w-full md:w-fit flex")}>
{exerciseIndex > -1 && (
)}
{exerciseIndex === -1 && (
- nextExercise()}>
+ nextExercise()}>
Next
diff --git a/src/exams/Selection.tsx b/src/exams/Selection.tsx
index 0104eda8..16338db9 100644
--- a/src/exams/Selection.tsx
+++ b/src/exams/Selection.tsx
@@ -29,7 +29,7 @@ export default function Selection({user, onStart}: Props) {
-
+
{
if (exam) {
setTimer(exam.minTimer * 60);
- const timerInterval = setInterval(() => setTimer((prev) => prev && prev - 1), 1000);
+ const timerInterval = setInterval(() => setTimer((prev) => (prev && prev > 0 ? prev - 1 : 0)), 1000);
return () => {
clearInterval(timerInterval);
@@ -158,9 +158,9 @@ export default function Page({user}: {user: User}) {
-
-
-
+
+
+
{renderScreen()}
>
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index 66996b24..75c0bd02 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -15,6 +15,7 @@ import JSON_RESULTS from "@/demo/user_results.json";
import {withIronSessionSsr} from "iron-session/next";
import {sessionOptions} from "@/lib/session";
import {User} from "@/interfaces/user";
+import {useEffect, useState} from "react";
export const getServerSideProps = withIronSessionSsr(({req, res}) => {
const user = req.session.user;
@@ -36,6 +37,10 @@ export const getServerSideProps = withIronSessionSsr(({req, res}) => {
}, sessionOptions);
export default function Home({user}: {user: User}) {
+ const [showEndExam, setShowEndExam] = useState(false);
+
+ useEffect(() => setShowEndExam(window.innerWidth <= 960), []);
+
return (
<>
@@ -47,20 +52,14 @@ export default function Home({user}: {user: User}) {
-
-
+
+