From d9ca0e84a6f0621a1cec245ccb391639a860d435 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Fri, 11 Aug 2023 23:54:09 +0100 Subject: [PATCH] Some light bug solving --- src/components/Exercises/Speaking.tsx | 20 +++++++++++--------- src/exams/Listening.tsx | 2 +- src/exams/Reading.tsx | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/components/Exercises/Speaking.tsx b/src/components/Exercises/Speaking.tsx index eaad579d..7049bd16 100644 --- a/src/components/Exercises/Speaking.tsx +++ b/src/components/Exercises/Speaking.tsx @@ -57,16 +57,18 @@ export default function Speaking({id, title, text, type, prompts, onNext, onBack ))} -
- You should talk about the following things: -
- {prompts.map((x, index) => ( -
  • - {x} -
  • - ))} + {prompts && prompts.length > 0 && ( +
    + You should talk about the following things: +
    + {prompts.map((x, index) => ( +
  • + {x} +
  • + ))} +
    -
    + )}
    x.score.missing).every((x) => x === 0) && !showSolutions && !hasExamEnded) { + if (![...userSolutions.map((x) => x.score.missing), solution?.score.missing].every((x) => x === 0) && !showSolutions && !hasExamEnded) { setShowBlankModal(true); return; } diff --git a/src/exams/Reading.tsx b/src/exams/Reading.tsx index bf9d80db..b2a81994 100644 --- a/src/exams/Reading.tsx +++ b/src/exams/Reading.tsx @@ -112,7 +112,7 @@ export default function Reading({exam, showSolutions = false, onFinish}: Props) return; } - if (!userSolutions.map((x) => x.score.missing).every((x) => x === 0) && !showSolutions && !hasExamEnded) { + if (![...userSolutions.map((x) => x.score.missing), solution?.score.missing].every((x) => x === 0) && !showSolutions && !hasExamEnded) { setShowBlankModal(true); return; }