From 42ca533939b96ac5072f4826884d7d9cbf346f31 Mon Sep 17 00:00:00 2001 From: DanielRosa74 <58576743+DanielRosa74@users.noreply.github.com> Date: Thu, 12 Mar 2026 11:20:11 -0300 Subject: [PATCH] refactor(client): have a single place to edit sounds url (#66381) --- .../Challenges/components/multiple-choice-questions.tsx | 5 ++--- client/src/templates/Challenges/quiz/show.tsx | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/templates/Challenges/components/multiple-choice-questions.tsx b/client/src/templates/Challenges/components/multiple-choice-questions.tsx index df0414e081e..2a81689b98a 100644 --- a/client/src/templates/Challenges/components/multiple-choice-questions.tsx +++ b/client/src/templates/Challenges/components/multiple-choice-questions.tsx @@ -12,6 +12,7 @@ import SpeakingModal from './speaking-modal'; import ChallengeHeading from './challenge-heading'; import PrismFormatted from './prism-formatted'; import { stripHtmlTags } from './speaking-modal-helpers'; +import { sounds } from './scene/scene-assets'; type MultipleChoiceQuestionsProps = { questions: Question[]; @@ -54,9 +55,7 @@ function MultipleChoiceQuestions({ }; const constructAudioUrl = (audioId?: string): string | undefined => - audioId - ? `https://cdn.freecodecamp.org/curriculum/english/animation-assets/sounds/${audioId}` - : undefined; + audioId ? `${sounds}/${audioId}` : undefined; const getAudioUrl = ( questionIndex: number, diff --git a/client/src/templates/Challenges/quiz/show.tsx b/client/src/templates/Challenges/quiz/show.tsx index 2ad31145521..3817320cbf9 100644 --- a/client/src/templates/Challenges/quiz/show.tsx +++ b/client/src/templates/Challenges/quiz/show.tsx @@ -37,6 +37,7 @@ import { import { isChallengeCompletedSelector } from '../redux/selectors'; import PrismFormatted from '../components/prism-formatted'; import { usePageLeave } from '../hooks'; +import { sounds } from '../components/scene/scene-assets'; import ExitQuizModal from './exit-quiz-modal'; import FinishQuizModal from './finish-quiz-modal'; @@ -170,7 +171,7 @@ const ShowQuiz = ({ const audioData = question.audioData?.audio?.filename ? { - audioUrl: `https://cdn.freecodecamp.org/curriculum/english/animation-assets/sounds/${question.audioData.audio.filename}`, + audioUrl: `${sounds}/${question.audioData.audio.filename}`, audioStartTime: question.audioData.audio.startTimestamp ?? undefined, audioFinishTime: