l-min-components 1.7.1325 → 1.7.1326
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
CHANGED
|
@@ -11,7 +11,8 @@ const ResponsePlayer = ({ text, audio, small, Label = "You say" }) => {
|
|
|
11
11
|
stop,
|
|
12
12
|
play,
|
|
13
13
|
} = useAudioPlayer({
|
|
14
|
-
streamSrc: audio,
|
|
14
|
+
streamSrc: audio?.url,
|
|
15
|
+
src: audio?.uploaded_media_url,
|
|
15
16
|
});
|
|
16
17
|
const audioRef = useRef(null);
|
|
17
18
|
const { speak, cancel } = useSpeechSynthesis({
|
|
@@ -42,7 +42,6 @@ const Speech = ({ data, audio }) => {
|
|
|
42
42
|
return findWord?.value?.["Word Score"];
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
console.log(getWordScore(1));
|
|
46
45
|
return (
|
|
47
46
|
<Container>
|
|
48
47
|
{" "}
|
|
@@ -59,21 +58,23 @@ const Speech = ({ data, audio }) => {
|
|
|
59
58
|
<p>
|
|
60
59
|
{data["Reference"]?.split(/\s+/)?.map((word, idx) => {
|
|
61
60
|
return (
|
|
62
|
-
<
|
|
61
|
+
<button
|
|
63
62
|
key={idx}
|
|
64
63
|
onClick={() => {
|
|
65
64
|
handeSelectWord(idx, word);
|
|
66
65
|
}}
|
|
66
|
+
className={`${
|
|
67
|
+
selectedWord?.value["Word"]?.toLowerCase() ===
|
|
68
|
+
word?.toLowerCase() && idx === selectedWord?.id
|
|
69
|
+
? "active"
|
|
70
|
+
: ""
|
|
71
|
+
}`}
|
|
67
72
|
style={{
|
|
68
|
-
color:
|
|
69
|
-
selectedWord?.value["Word"]?.toLowerCase() ===
|
|
70
|
-
word?.toLowerCase() && idx === selectedWord?.id
|
|
71
|
-
? "#099"
|
|
72
|
-
: setColor(getWordScore(idx)),
|
|
73
|
+
color: setColor(getWordScore(idx)),
|
|
73
74
|
}}
|
|
74
75
|
>
|
|
75
76
|
{word}{" "}
|
|
76
|
-
</
|
|
77
|
+
</button>
|
|
77
78
|
);
|
|
78
79
|
})}
|
|
79
80
|
</p>
|
|
@@ -85,11 +86,7 @@ const Speech = ({ data, audio }) => {
|
|
|
85
86
|
</h2>
|
|
86
87
|
<div className="resp">
|
|
87
88
|
{audio?.url && (
|
|
88
|
-
<ResponsePlayer
|
|
89
|
-
small
|
|
90
|
-
audio={audio?.url}
|
|
91
|
-
Label="Student response"
|
|
92
|
-
/>
|
|
89
|
+
<ResponsePlayer small audio={audio} Label="Student response" />
|
|
93
90
|
)}
|
|
94
91
|
|
|
95
92
|
<ResponsePlayer text={data["Reference"]} small />
|
|
@@ -171,15 +168,25 @@ const WordContent = styled.div`
|
|
|
171
168
|
background: #f5f7f7;
|
|
172
169
|
min-height: 182px;
|
|
173
170
|
padding: 10px;
|
|
171
|
+
width: 100%;
|
|
174
172
|
p {
|
|
175
173
|
line-height: 28px;
|
|
176
|
-
|
|
174
|
+
display: flex;
|
|
175
|
+
width: 100%;
|
|
176
|
+
flex-wrap: wrap;
|
|
177
|
+
gap: 4px;
|
|
178
|
+
button {
|
|
177
179
|
color: #636666;
|
|
178
180
|
font-size: 16px;
|
|
179
181
|
font-weight: 600;
|
|
180
182
|
cursor: pointer;
|
|
183
|
+
background-color: transparent;
|
|
184
|
+
border: 0;
|
|
185
|
+
outline: 0;
|
|
186
|
+
display: inline;
|
|
181
187
|
&.active {
|
|
182
|
-
color: #
|
|
188
|
+
background-color: #ff00ff3b;
|
|
189
|
+
border-radius: 4px;
|
|
183
190
|
font-weight: 700;
|
|
184
191
|
}
|
|
185
192
|
}
|