From 62a01fa6b52f23dd8ea14e040d2e4849b70ef19e Mon Sep 17 00:00:00 2001 From: Ajinkya Pande Date: Fri, 25 Oct 2024 12:35:08 +0530 Subject: [PATCH 1/6] Issueid #0000 iframe height for fill in the blanks --- src/views/Practice/Practice.jsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/views/Practice/Practice.jsx b/src/views/Practice/Practice.jsx index 7b436aa0..4feabc65 100644 --- a/src/views/Practice/Practice.jsx +++ b/src/views/Practice/Practice.jsx @@ -716,9 +716,10 @@ const Practice = () => { questions[currentQuestion]?.contentSourceData || []; const stringLengths = contentSourceData.map((item) => item.text.length); const length = - questions[currentQuestion]?.mechanics_data && - questions[currentQuestion]?.mechanics_data[0]?.mechanics_id === - "mechanic_2" + (questions[currentQuestion]?.mechanics_data && + questions[currentQuestion]?.mechanics_data[0]?.mechanics_id === + "mechanic_2") || + "mechanic_1" ? 500 : stringLengths[0]; window.parent.postMessage({ type: "stringLengths", length }, "*"); From 5ef2315688b128891b0bee644604bc108320a357 Mon Sep 17 00:00:00 2001 From: Ajinkya Pande Date: Fri, 25 Oct 2024 12:46:45 +0530 Subject: [PATCH 2/6] Issueid #0000 iframe height for fill in the blanks --- src/views/Practice/Practice.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/views/Practice/Practice.jsx b/src/views/Practice/Practice.jsx index 4feabc65..5fd15360 100644 --- a/src/views/Practice/Practice.jsx +++ b/src/views/Practice/Practice.jsx @@ -719,7 +719,8 @@ const Practice = () => { (questions[currentQuestion]?.mechanics_data && questions[currentQuestion]?.mechanics_data[0]?.mechanics_id === "mechanic_2") || - "mechanic_1" + questions[currentQuestion]?.mechanics_data[0]?.mechanics_id === + "mechanic_1" ? 500 : stringLengths[0]; window.parent.postMessage({ type: "stringLengths", length }, "*"); From d1d20d3f6c8b83497a5b7aae8f338c6fe62eefab Mon Sep 17 00:00:00 2001 From: Ajinkya Pande Date: Mon, 28 Oct 2024 09:25:09 +0530 Subject: [PATCH 3/6] Issueid #0000 iframe height for fill in the blanks --- src/views/Practice/Practice.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/Practice/Practice.jsx b/src/views/Practice/Practice.jsx index 5fd15360..a2bfe855 100644 --- a/src/views/Practice/Practice.jsx +++ b/src/views/Practice/Practice.jsx @@ -716,11 +716,11 @@ const Practice = () => { questions[currentQuestion]?.contentSourceData || []; const stringLengths = contentSourceData.map((item) => item.text.length); const length = - (questions[currentQuestion]?.mechanics_data && + questions[currentQuestion]?.mechanics_data && + (questions[currentQuestion]?.mechanics_data[0]?.mechanics_id === + "mechanic_2" || questions[currentQuestion]?.mechanics_data[0]?.mechanics_id === - "mechanic_2") || - questions[currentQuestion]?.mechanics_data[0]?.mechanics_id === - "mechanic_1" + "mechanic_1") ? 500 : stringLengths[0]; window.parent.postMessage({ type: "stringLengths", length }, "*"); From ef82f92090a8cd41e398b33fe85a0f8833143482 Mon Sep 17 00:00:00 2001 From: Ajinkya Pande Date: Mon, 28 Oct 2024 12:30:40 +0530 Subject: [PATCH 4/6] Issueid #229204 fix: Even after speaking correct word,showing wrong answer on result page. PFA --- src/utils/VoiceAnalyser.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/utils/VoiceAnalyser.js b/src/utils/VoiceAnalyser.js index e3bc3d02..9d7260d4 100644 --- a/src/utils/VoiceAnalyser.js +++ b/src/utils/VoiceAnalyser.js @@ -501,6 +501,15 @@ function VoiceAnalyser(props) { ); setApiResponse(callUpdateLearner ? data.status : "success"); + + if ( + callUpdateLearner && + (props.pageName === "wordsorimage" || props.pageName === "m5") + ) { + const isMatching = + responseText.toLowerCase() === originalText.toLowerCase(); + props.updateStoredData(recordedAudio, isMatching); + } if (props.handleNext) { props.handleNext(); if (temp_audio !== null) { @@ -712,12 +721,6 @@ function VoiceAnalyser(props) { { - if ( - props.pageName === "wordsorimage" || - props.pageName === "m5" - ) { - props.updateStoredData(recordedAudio, isMatching); - } if (props.setIsNextButtonCalled) { props.setIsNextButtonCalled(true); } else { From cc3d78ed6fc3f61ea34dc4138b28514954a61a14 Mon Sep 17 00:00:00 2001 From: Ajinkya Pande Date: Mon, 28 Oct 2024 16:31:03 +0530 Subject: [PATCH 5/6] Issueid #229204 fix: Even after speaking correct word,showing wrong answer on result page. PFA --- src/utils/VoiceAnalyser.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/VoiceAnalyser.js b/src/utils/VoiceAnalyser.js index 9d7260d4..ca9fa094 100644 --- a/src/utils/VoiceAnalyser.js +++ b/src/utils/VoiceAnalyser.js @@ -507,8 +507,10 @@ function VoiceAnalyser(props) { (props.pageName === "wordsorimage" || props.pageName === "m5") ) { const isMatching = - responseText.toLowerCase() === originalText.toLowerCase(); - props.updateStoredData(recordedAudio, isMatching); + data?.createScoreData?.session?.error_rate?.character === 0; + if (typeof props.updateStoredData === "function") { + props.updateStoredData(recordedAudio, isMatching); + } } if (props.handleNext) { props.handleNext(); From 24f489fc428b732b7c52e974857607365bb05f1e Mon Sep 17 00:00:00 2001 From: Ajinkya Pande Date: Mon, 28 Oct 2024 18:09:56 +0530 Subject: [PATCH 6/6] Issueid #229204 fix: Even after speaking correct word,showing wrong answer on result page. PFA --- src/views/Practice/Practice.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/Practice/Practice.jsx b/src/views/Practice/Practice.jsx index a2bfe855..5fd15360 100644 --- a/src/views/Practice/Practice.jsx +++ b/src/views/Practice/Practice.jsx @@ -716,11 +716,11 @@ const Practice = () => { questions[currentQuestion]?.contentSourceData || []; const stringLengths = contentSourceData.map((item) => item.text.length); const length = - questions[currentQuestion]?.mechanics_data && - (questions[currentQuestion]?.mechanics_data[0]?.mechanics_id === - "mechanic_2" || + (questions[currentQuestion]?.mechanics_data && questions[currentQuestion]?.mechanics_data[0]?.mechanics_id === - "mechanic_1") + "mechanic_2") || + questions[currentQuestion]?.mechanics_data[0]?.mechanics_id === + "mechanic_1" ? 500 : stringLengths[0]; window.parent.postMessage({ type: "stringLengths", length }, "*");