- Prevent the CTRL+F on Reading;

- Made the Listening audio appear on exercises;
This commit is contained in:
Tiago Ribeiro
2023-08-31 20:39:38 +01:00
parent 7dd96bf259
commit b3b804fc11
4 changed files with 19 additions and 4 deletions

View File

@@ -87,6 +87,20 @@ export default function Reading({exam, showSolutions = false, onFinish}: Props)
const [hasExamEnded, setHasExamEnded] = useExamStore((state) => [state.hasExamEnded, state.setHasExamEnded]);
useEffect(() => {
const listener = (e: KeyboardEvent) => {
if (e.key === "F3" || ((e.ctrlKey || e.metaKey) && e.key === "f")) {
e.preventDefault();
}
};
document.addEventListener("keydown", listener);
return () => {
document.removeEventListener("keydown", listener);
};
}, []);
useEffect(() => {
if (hasExamEnded && exerciseIndex === -1) {
setExerciseIndex((prev) => prev + 1);