Resolved the Questions Blank bug

This commit is contained in:
Tiago Ribeiro
2023-08-12 00:03:35 +01:00
parent d9ca0e84a6
commit ef736bc63e
2 changed files with 16 additions and 2 deletions

View File

@@ -112,7 +112,14 @@ export default function Reading({exam, showSolutions = false, onFinish}: Props)
return;
}
if (![...userSolutions.map((x) => x.score.missing), solution?.score.missing].every((x) => x === 0) && !showSolutions && !hasExamEnded) {
if (
solution &&
![...userSolutions.filter((x) => x.exercise !== solution?.exercise).map((x) => x.score.missing), solution?.score.missing].every(
(x) => x === 0,
) &&
!showSolutions &&
!hasExamEnded
) {
setShowBlankModal(true);
return;
}