refactor(client): have a single place to edit sounds url (#66381)

This commit is contained in:
DanielRosa74
2026-03-12 11:20:11 -03:00
committed by GitHub
parent 046d707dd8
commit 42ca533939
2 changed files with 4 additions and 4 deletions
@@ -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,
@@ -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: