l-min-components 1.7.1487 → 1.7.1489
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/reportsComponents/fullAnalysis/components/Grammar.v2.jsx +29 -27
- package/src/components/reportsComponents/fullAnalysis/question.data.jsx +1337 -0
- package/src/components/reportsComponents/reportQuestions/components/responseAudio.jsx +5 -9
- package/src/components/reportsComponents/reportQuestions/questions/dialogueScripted.jsx +1 -0
- package/src/components/reportsComponents/reportQuestions/questions/dialogueUnscripted.jsx +1 -0
- package/src/components/reportsComponents/reportQuestions/questions/essayScripted.jsx +10 -4
- package/src/components/reportsComponents/reportQuestions/questions/essayUnscripted.jsx +10 -4
- package/src/components/reportsComponents/reportQuestions/questions/quizScripted.jsx +1 -0
- package/src/components/reportsComponents/reportQuestions/questions/quizUnsripted.jsx +1 -0
- package/src/components/reportsComponents/reportQuestions/questions/reading.jsx +2 -0
- package/src/components/reportsComponents/reportQuestions/questions/soundPlay.jsx +2 -0
- package/src/components/useAudioPlayer/index.jsx +2 -1
|
@@ -13,18 +13,14 @@ import useAudioPlayer from "../../../useAudioPlayer";
|
|
|
13
13
|
import PlayIcon from "../../../../assets/svg/playIcon";
|
|
14
14
|
import classNames from "classnames";
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
* @param {Object} props
|
|
18
|
-
* @param {string} props.url
|
|
19
|
-
* @param {String} props.streamUrl
|
|
20
|
-
* @returns {React.ReactNode}
|
|
21
|
-
*/
|
|
22
|
-
const ResponseAudio = ({ url, streamUrl }) => {
|
|
16
|
+
const ResponseAudio = ({ url, streamUrl, audioData }) => {
|
|
23
17
|
const { play, isPlaying, isReady, pause } = useAudioPlayer({
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
streamSrc: audioData?.url || streamUrl,
|
|
19
|
+
src: audioData?.uploaded_media_url || url,
|
|
26
20
|
});
|
|
27
21
|
|
|
22
|
+
console.log(url, "/////");
|
|
23
|
+
|
|
28
24
|
useEffect(() => {
|
|
29
25
|
return () => {
|
|
30
26
|
if (isPlaying) {
|
|
@@ -81,6 +81,7 @@ const DialogueScripted = ({ data, aiData, setToggle }) => {
|
|
|
81
81
|
<ResponseAudio
|
|
82
82
|
streamUrl={selectedResponse?.recording?.url}
|
|
83
83
|
url={selectedResponse?.recording?.uploaded_media_url}
|
|
84
|
+
audioData={selectedResponse?.recording}
|
|
84
85
|
key={selected}
|
|
85
86
|
/>
|
|
86
87
|
<div className="right">
|
|
@@ -79,6 +79,7 @@ const DialogueUnscripted = ({ data, aiData, setToggle }) => {
|
|
|
79
79
|
<ResponseAudio
|
|
80
80
|
streamUrl={selectedResponse?.recording?.url}
|
|
81
81
|
url={selectedResponse?.recording?.uploaded_media_url}
|
|
82
|
+
audioData={selectedResponse?.recording}
|
|
82
83
|
key={selected}
|
|
83
84
|
/>
|
|
84
85
|
<div className="right">
|
|
@@ -14,6 +14,8 @@ const EssayScripted = ({ data, aiData, setToggle }) => {
|
|
|
14
14
|
const [analysis, setAnalysis] = useState(null);
|
|
15
15
|
const { setupAnalysis, getTrabScriptData } = useReportUtils();
|
|
16
16
|
|
|
17
|
+
// console.log(data?.answer?.data?.data?.recording?.uploaded_media_url);
|
|
18
|
+
|
|
17
19
|
useEffect(() => {
|
|
18
20
|
if (data) {
|
|
19
21
|
const models = setupAnalysis(
|
|
@@ -50,10 +52,14 @@ const EssayScripted = ({ data, aiData, setToggle }) => {
|
|
|
50
52
|
/>
|
|
51
53
|
|
|
52
54
|
<QuestionSectionAction>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
{data?.answer && (
|
|
56
|
+
<ResponseAudio
|
|
57
|
+
streamUrl={data?.answer?.data?.data?.recording?.url}
|
|
58
|
+
url={data?.answer?.data?.data?.recording?.uploaded_media_url}
|
|
59
|
+
audioData={data?.answer?.data?.data?.recording}
|
|
60
|
+
key={data?.answer?.data?.data?.recording?.id}
|
|
61
|
+
/>
|
|
62
|
+
)}
|
|
57
63
|
<div className="right">
|
|
58
64
|
<AnalysisButton
|
|
59
65
|
disabled={!analysis?.models?.length > 0}
|
|
@@ -25,6 +25,8 @@ const EssayUnscripted = ({ data, aiData, setToggle }) => {
|
|
|
25
25
|
}
|
|
26
26
|
}, [data]);
|
|
27
27
|
const transcript = getTrabScriptData(analysis?.models);
|
|
28
|
+
|
|
29
|
+
console.log(data?.answer?.data?.data?.recording?.uploaded_media_url);
|
|
28
30
|
return (
|
|
29
31
|
<QuestionSection>
|
|
30
32
|
{data?.question_data?.question_title && (
|
|
@@ -45,10 +47,14 @@ const EssayUnscripted = ({ data, aiData, setToggle }) => {
|
|
|
45
47
|
isAiWordFlow
|
|
46
48
|
/>
|
|
47
49
|
<QuestionSectionAction>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
{data?.answer && (
|
|
51
|
+
<ResponseAudio
|
|
52
|
+
key={data?.answer?.data?.data?.recording?.id}
|
|
53
|
+
streamUrl={data?.answer?.data?.data?.recording?.url}
|
|
54
|
+
url={data?.answer?.data?.data?.recording?.uploaded_media_url}
|
|
55
|
+
audioData={data?.answer?.data?.data?.recording}
|
|
56
|
+
/>
|
|
57
|
+
)}
|
|
52
58
|
<div className="right">
|
|
53
59
|
{" "}
|
|
54
60
|
<AnalysisButton
|
|
@@ -73,6 +73,7 @@ const QuizScripted = ({ data, aiData, setToggle }) => {
|
|
|
73
73
|
<ResponseAudio
|
|
74
74
|
streamUrl={selectedResponse?.recording?.url}
|
|
75
75
|
url={selectedResponse?.recording?.uploaded_media_url}
|
|
76
|
+
audioData={selectedResponse?.recording}
|
|
76
77
|
key={selected}
|
|
77
78
|
/>
|
|
78
79
|
<div className="right">
|
|
@@ -68,6 +68,7 @@ const QuizUnscripted = ({ data, aiData, setToggle }) => {
|
|
|
68
68
|
<ResponseAudio
|
|
69
69
|
streamUrl={selectedResponse?.recording?.url}
|
|
70
70
|
url={selectedResponse?.recording?.uploaded_media_url}
|
|
71
|
+
audioData={selectedResponse?.recording}
|
|
71
72
|
key={selected}
|
|
72
73
|
/>
|
|
73
74
|
<div className="right">
|
|
@@ -49,6 +49,8 @@ const Reading = ({ data, aiData, setToggle }) => {
|
|
|
49
49
|
<ResponseAudio
|
|
50
50
|
streamUrl={data?.answer?.data?.recording?.url}
|
|
51
51
|
url={data?.answer?.data?.recording?.uploaded_media_url}
|
|
52
|
+
audioData={data?.answer?.data?.recording}
|
|
53
|
+
key={data?.answer?.data?.recording?.id}
|
|
52
54
|
/>
|
|
53
55
|
<div className="right">
|
|
54
56
|
<AnalysisButton
|
|
@@ -51,6 +51,8 @@ const SoundPlay = ({ data, aiData, setToggle }) => {
|
|
|
51
51
|
<ResponseAudio
|
|
52
52
|
streamUrl={data?.answer?.data?.audio?.url}
|
|
53
53
|
url={data?.answer?.data?.audio?.uploaded_media_url}
|
|
54
|
+
audioData={data?.answer?.data?.audio}
|
|
55
|
+
key={data?.answer?.data?.audio?.id}
|
|
54
56
|
/>
|
|
55
57
|
<div className="right">
|
|
56
58
|
<AnalysisButton
|
|
@@ -127,6 +127,7 @@ const useAudioPlayer = ({ src, streamSrc }) => {
|
|
|
127
127
|
audio.addEventListener("loadedmetadata", () => {
|
|
128
128
|
setIsReady(true);
|
|
129
129
|
});
|
|
130
|
+
audio.load();
|
|
130
131
|
attachAudioEvents();
|
|
131
132
|
}
|
|
132
133
|
|
|
@@ -136,7 +137,7 @@ const useAudioPlayer = ({ src, streamSrc }) => {
|
|
|
136
137
|
}
|
|
137
138
|
audio.pause();
|
|
138
139
|
audio.currentTime = 0;
|
|
139
|
-
setIsReady(false);
|
|
140
|
+
// setIsReady(false);
|
|
140
141
|
};
|
|
141
142
|
}, [url, accessToken, accountId, audio, src, streamSrc]);
|
|
142
143
|
|