From 8dcfb8a670df6edb630fd36ef9fdede0169dc02a Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Wed, 13 Sep 2023 07:40:20 +0100 Subject: [PATCH] Removed the ability to pause the listening --- src/components/Low/AudioPlayer.tsx | 7 ++++--- src/exams/Listening.tsx | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/Low/AudioPlayer.tsx b/src/components/Low/AudioPlayer.tsx index 16d7d6c9..3546e987 100644 --- a/src/components/Low/AudioPlayer.tsx +++ b/src/components/Low/AudioPlayer.tsx @@ -11,9 +11,10 @@ interface Props { autoPlay?: boolean; disabled?: boolean; onEnd?: () => void; + disablePause?: boolean; } -export default function AudioPlayer({src, color, autoPlay = false, disabled = false, onEnd}: Props) { +export default function AudioPlayer({src, color, autoPlay = false, disabled = false, onEnd, disablePause = false}: Props) { const [isPlaying, setIsPlaying] = useState(false); const [duration, setDuration] = useState(0); const [currentTime, setCurrentTime] = useState(0); @@ -62,8 +63,8 @@ export default function AudioPlayer({src, color, autoPlay = false, disabled = fa
{isPlaying && ( )} {!isPlaying && ( diff --git a/src/exams/Listening.tsx b/src/exams/Listening.tsx index 5fac882e..cb349650 100644 --- a/src/exams/Listening.tsx +++ b/src/exams/Listening.tsx @@ -107,6 +107,7 @@ export default function Listening({exam, showSolutions = false, onFinish}: Props color="listening" onEnd={() => setTimesListened((prev) => prev + 1)} disabled={timesListened === exam.audio.repeatableTimes} + disablePause />