Skip to content

Commit

Permalink
Merge pull request #174 from ajinkyapandetekdi/fillintheblanks-all-de…
Browse files Browse the repository at this point in the history
…v-tn

#0000 Fixed audio issue and uppercase issue
  • Loading branch information
gouravmore authored Oct 18, 2024
2 parents 83b9cf1 + 0fe8e71 commit ddbbd0f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
5 changes: 3 additions & 2 deletions src/components/DiscoverSentance/DiscoverSentance.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ const SpeakSentenceComponent = () => {
const [assesmentCount, setAssesmentcount] = useState(0);
const [initialAssesment, setInitialAssesment] = useState(true);
const [disableScreen, setDisableScreen] = useState(false);
const [play] = useSound(LevelCompleteAudio);
// const [play] = useSound(LevelCompleteAudio);
const [openMessageDialog, setOpenMessageDialog] = useState("");
const [totalSyllableCount, setTotalSyllableCount] = useState("");
const [isNextButtonCalled, setIsNextButtonCalled] = useState(false);

const callConfettiAndPlay = () => {
play();
let audio = new Audio(LevelCompleteAudio);
audio.play();
callConfetti();
};

Expand Down
12 changes: 2 additions & 10 deletions src/components/Practice/Mechanics6.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,11 @@ const Mechanics2 = ({
? 0
: currrentProgress / duration;

const getEnableButton = () => {
if (type === "fillInTheBlank") {
return enableNext;
}
if (type === "audio") {
return selectedWord === wordToCheck;
}
};
return (
<MainLayout
background={background}
handleNext={handleNext}
enableNext={getEnableButton()}
enableNext={enableNext}
showTimer={showTimer}
points={points}
{...{
Expand Down Expand Up @@ -485,7 +477,7 @@ const Mechanics2 = ({
dontShowListen={true}
// updateStory={updateStory}
originalText={parentWords}
enableNext={getEnableButton()}
enableNext={enableNext}
handleNext={handleNext}
{...{
contentId,
Expand Down
10 changes: 6 additions & 4 deletions src/views/Practice/Practice.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Practice = () => {
const [disableScreen, setDisableScreen] = useState(false);
const [mechanism, setMechanism] = useState("");

const [play] = useSound(LevelCompleteAudio);
// const [play] = useSound(LevelCompleteAudio);
const [livesData, setLivesData] = useState();
const [gameOverData, setGameOverData] = useState();
const [loading, setLoading] = useState();
Expand All @@ -71,7 +71,8 @@ const Practice = () => {
}, [startShowCase]);

const callConfettiAndPlay = () => {
play();
let audio = new Audio(LevelCompleteAudio);
audio.play();
callConfetti();
};

Expand Down Expand Up @@ -600,6 +601,7 @@ const Practice = () => {
});

let type = currentContentType?.toLowerCase();
// console.log(type, sentence, matchedChar);
if (type === "char" || type === "word") {
const word = splitGraphemes(words[0].toLowerCase()).filter(
(item) => item !== "‌" && item !== "" && item !== " "
Expand All @@ -626,7 +628,7 @@ const Practice = () => {
background: "#FFF0BD",
}}
>
{substr}
{i === 0 ? substr.toUpperCase() : substr}
</Typography>
</React.Fragment>
);
Expand All @@ -649,7 +651,7 @@ const Practice = () => {
lineHeight: "50px",
}}
>
{word[i]}
{i === 0 ? word[i].toUpperCase() : word[i]}
</Typography>
</React.Fragment>
);
Expand Down

0 comments on commit ddbbd0f

Please sign in to comment.