(`/api/exams/${params.id}`)
.then(setPaper)
- .catch(() => setPaper(null));
+ .catch(() => setLoadError(true));
}, [params.id]);
- if (!paper) return {t.common.loading}
;
+ if (!paper) {
+ if (loadError) {
+ return (
+
+
+
{t.exam.printLoadFailed}
+
{t.exam.printLoadFailedHint}
+
+
+
+ );
+ }
+ return {t.common.loading}
;
+ }
const figureQuestions = paper.questions.filter((question) => question.status === "ready" && question.questionText && Boolean(question.figureSvg || question.figureImage || question.figureUploadImage));
const readyCount = paper.questions.filter((question) => question.status === "ready" && question.questionText).length;
@@ -193,7 +207,7 @@ export default function ExamPrintPage() {
{t.exam.answerSpace}