-
{info}
-
- {prompt.split("\\n").map((line, index) => (
-
- {line}
-
-
- ))}
-
- {attachment &&

}
+ <>
+ {attachment && (
+
+
+
+ )}
+
+
+
{info}
+
+ {prompt.split("\\n").map((line, index) => (
+
+ {line}
+
+
+ ))}
+
+ {attachment && (
+
![]()
setIsModalOpen(true)}
+ src={attachment.url}
+ alt={attachment.description}
+ className="max-w-md self-center rounded-xl cursor-pointer"
+ />
+ )}
+
+
+
+
+ You should write {wordCounter.type === "min" ? "at least" : "at most"} {wordCounter.limit} words.
+
+
-
-
- You should write {wordCounter.type === "min" ? "at least" : "at most"} {wordCounter.limit} words.
-
-
-
-
+ >
);
}
diff --git a/src/components/Solutions/Writing.tsx b/src/components/Solutions/Writing.tsx
new file mode 100644
index 00000000..cc4db9ad
--- /dev/null
+++ b/src/components/Solutions/Writing.tsx
@@ -0,0 +1,105 @@
+/* eslint-disable @next/next/no-img-element */
+import {errorButtonStyle, infoButtonStyle} from "@/constants/buttonStyles";
+import {WritingExercise} from "@/interfaces/exam";
+import {mdiArrowLeft, mdiArrowRight} from "@mdi/js";
+import Icon from "@mdi/react";
+import clsx from "clsx";
+import {CommonProps} from ".";
+import {Fragment, useEffect, useState} from "react";
+import {toast} from "react-toastify";
+import Button from "../Low/Button";
+import {Dialog, Transition} from "@headlessui/react";
+
+export default function Writing({id, prompt, info, evaluation, attachment, userSolutions, onNext, onBack}: WritingExercise & CommonProps) {
+ const [isModalOpen, setIsModalOpen] = useState(false);
+
+ return (
+ <>
+ {attachment && (
+
+
+
+ )}
+
+
+
+ {prompt.split("\\n").map((line, index) => (
+
+ {line}
+
+
+ ))}
+
+ {attachment && (
+
![]()
setIsModalOpen(true)}
+ src={attachment.url}
+ alt={attachment.description}
+ className="max-w-[200px] self-center rounded-xl cursor-pointer"
+ />
+ )}
+
+
+
+ {userSolutions && (
+
+ Your answer:
+
+
+ )}
+
+
+ {Object.keys(evaluation!.task_response).map((key) => (
+
+ {key}: Level {evaluation!.task_response[key]}
+
+ ))}
+
+
{evaluation!.comment}
+
+
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/src/components/Solutions/index.tsx b/src/components/Solutions/index.tsx
index 3f503911..fdb3d2f3 100644
--- a/src/components/Solutions/index.tsx
+++ b/src/components/Solutions/index.tsx
@@ -1,8 +1,9 @@
-import {Exercise, FillBlanksExercise, MatchSentencesExercise, MultipleChoiceExercise, WriteBlanksExercise} from "@/interfaces/exam";
+import {Exercise, FillBlanksExercise, MatchSentencesExercise, MultipleChoiceExercise, WriteBlanksExercise, WritingExercise} from "@/interfaces/exam";
import dynamic from "next/dynamic";
import FillBlanks from "./FillBlanks";
import MultipleChoice from "./MultipleChoice";
import WriteBlanks from "./WriteBlanks";
+import Writing from "./Writing";
const MatchSentences = dynamic(() => import("@/components/Solutions/MatchSentences"), {ssr: false});
@@ -21,5 +22,7 @@ export const renderSolution = (exercise: Exercise, onNext: () => void, onBack: (
return
;
case "writeBlanks":
return
;
+ case "writing":
+ return
;
}
};
diff --git a/src/exams/Finish.tsx b/src/exams/Finish.tsx
index 0bbce8bb..e238b4eb 100644
--- a/src/exams/Finish.tsx
+++ b/src/exams/Finish.tsx
@@ -22,10 +22,11 @@ interface Props {
user: User;
modules: Module[];
scores: Score[];
+ isLoading: boolean;
onViewResults: () => void;
}
-export default function Finish({user, scores, modules, onViewResults}: Props) {
+export default function Finish({user, scores, modules, isLoading, onViewResults}: Props) {
const [selectedModule, setSelectedModule] = useState(modules[0]);
const [selectedScore, setSelectedScore] = useState
(scores.find((x) => x.module === modules[0])!);
@@ -108,82 +109,94 @@ export default function Finish({user, scores, modules, onViewResults}: Props) {