l-min-components 1.7.1409 → 1.7.1411
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/PlayButton.jsx +1 -0
- package/src/components/reportsComponents/fullAnalysis/components/SpeechAnalysis.jsx +18 -16
- package/src/components/reportsComponents/fullAnalysis/index.jsx +94 -88
- package/src/components/reportsComponents/fullAnalysis/style.jsx +33 -13
- package/src/components/reportsComponents/reportQuestions/index.jsx +1 -0
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
SpeechAnalysisContentWordScore,
|
|
9
9
|
SpeechAnalysisContentWordSection,
|
|
10
10
|
SpeechAnalysisHeader,
|
|
11
|
+
SpeechTitle,
|
|
11
12
|
} from "../style";
|
|
12
13
|
import HandIcon from "../icons/hand";
|
|
13
14
|
import classNames from "classnames";
|
|
@@ -21,8 +22,9 @@ import Table from "./Table";
|
|
|
21
22
|
import { Progress } from "rsuite";
|
|
22
23
|
import ClarityItem from "./ClarityItem";
|
|
23
24
|
import InlineClampedText from "./InlineClampedText";
|
|
25
|
+
import PlayButton from "./PlayButton";
|
|
24
26
|
|
|
25
|
-
const SpeechAnalysis = ({ Aidata }) => {
|
|
27
|
+
const SpeechAnalysis = ({ Aidata, isPersonal }) => {
|
|
26
28
|
const [selectedWord, setSelectedWord] = useState(1);
|
|
27
29
|
const [selectedSection, setSelectedSection] = useState(null);
|
|
28
30
|
|
|
@@ -65,10 +67,19 @@ const SpeechAnalysis = ({ Aidata }) => {
|
|
|
65
67
|
<ModelComtainer>
|
|
66
68
|
<ModelContent>
|
|
67
69
|
<SpeechAnalysisHeader>
|
|
68
|
-
<
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
<SpeechTitle>
|
|
71
|
+
<div className="label">
|
|
72
|
+
<HandIcon />
|
|
73
|
+
<p>Click on the words to see detailed feedback</p>
|
|
74
|
+
</div>
|
|
75
|
+
{isPersonal && (
|
|
76
|
+
<div className="">
|
|
77
|
+
<PlayButton audio={Aidata?.audioData} />
|
|
78
|
+
<PlayButton type="ai" refernceText={Aidata?.data?.Reference} />
|
|
79
|
+
</div>
|
|
80
|
+
)}
|
|
81
|
+
</SpeechTitle>
|
|
82
|
+
|
|
72
83
|
<div className="transcript-wrapper">
|
|
73
84
|
{words.map((word) => (
|
|
74
85
|
<span>
|
|
@@ -142,18 +153,11 @@ const SpeechAnalysis = ({ Aidata }) => {
|
|
|
142
153
|
<p className="good">
|
|
143
154
|
Perfect! you pronounced this sound correctly
|
|
144
155
|
</p>
|
|
145
|
-
) :
|
|
156
|
+
) : (
|
|
146
157
|
<div className="feedback">
|
|
147
158
|
<div className="feedback_header">
|
|
148
159
|
<div className="feedback_header-content">
|
|
149
|
-
{
|
|
150
|
-
You sound like{" "}
|
|
151
|
-
<span className="bad">/ʌ/</span>
|
|
152
|
-
</p>
|
|
153
|
-
<p>It is actually /ʌ/</p> */}
|
|
154
|
-
<p>
|
|
155
|
-
{item?.["Phoneme Feedback Summary"] || ""}
|
|
156
|
-
</p>
|
|
160
|
+
{item?.["Phoneme Feedback Summary"] || ""}
|
|
157
161
|
</div>
|
|
158
162
|
</div>
|
|
159
163
|
<InlineClampedText
|
|
@@ -161,8 +165,6 @@ const SpeechAnalysis = ({ Aidata }) => {
|
|
|
161
165
|
text={item?.["Phoneme Feedback"] || ""}
|
|
162
166
|
/>
|
|
163
167
|
</div>
|
|
164
|
-
) : (
|
|
165
|
-
<p className="bad">You missed this sound</p>
|
|
166
168
|
)}
|
|
167
169
|
</div>
|
|
168
170
|
);
|
|
@@ -17,8 +17,9 @@ import Tabs from "../reportQuestions/components/tabs";
|
|
|
17
17
|
import Evaluation from "./components/Evaluation";
|
|
18
18
|
import SpeechAnalysis from "./components/SpeechAnalysis";
|
|
19
19
|
import Grammar from "./components/Grammar";
|
|
20
|
+
import classNames from "classnames";
|
|
20
21
|
|
|
21
|
-
const FullAnalysis = ({ data, onClose }) => {
|
|
22
|
+
const FullAnalysis = ({ data, onClose, accountType }) => {
|
|
22
23
|
const { setRightLayout, setCenterLayoutStyle } = useContext(OutletContext);
|
|
23
24
|
|
|
24
25
|
// const colors = [
|
|
@@ -73,94 +74,96 @@ const FullAnalysis = ({ data, onClose }) => {
|
|
|
73
74
|
<ArrowLeft />
|
|
74
75
|
<h1>Full analysis</h1>
|
|
75
76
|
</Header>
|
|
76
|
-
<Content>
|
|
77
|
-
|
|
78
|
-
<
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
77
|
+
<Content className={classNames({ personal: accountType === "personal" })}>
|
|
78
|
+
{accountType !== "personal" && (
|
|
79
|
+
<Sidebar>
|
|
80
|
+
<ProgressSidebar>
|
|
81
|
+
<ProgressCircleSection>
|
|
82
|
+
{thirdModel && (
|
|
83
|
+
<Progress.Circle
|
|
84
|
+
percent={thirdModel?.score}
|
|
85
|
+
strokeWidth={4}
|
|
86
|
+
trailWidth={4}
|
|
87
|
+
strokeColor={thirdModel?.primaryColor}
|
|
88
|
+
trailColor="#F2F2F2"
|
|
89
|
+
showInfo={false}
|
|
90
|
+
className="progress-circle"
|
|
91
|
+
style={{
|
|
92
|
+
width: "130px",
|
|
93
|
+
}}
|
|
94
|
+
/>
|
|
95
|
+
)}
|
|
96
|
+
{secondModel && (
|
|
97
|
+
<Progress.Circle
|
|
98
|
+
percent={secondModel?.score}
|
|
99
|
+
strokeWidth={4}
|
|
100
|
+
trailWidth={4}
|
|
101
|
+
strokeColor={secondModel?.primaryColor}
|
|
102
|
+
trailColor="#F2F2F2"
|
|
103
|
+
showInfo={false}
|
|
104
|
+
className="progress-circle"
|
|
105
|
+
style={{
|
|
106
|
+
width: "110px",
|
|
107
|
+
}}
|
|
108
|
+
/>
|
|
109
|
+
)}
|
|
108
110
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
111
|
+
{firstModel && (
|
|
112
|
+
<Progress.Circle
|
|
113
|
+
percent={firstModel?.score}
|
|
114
|
+
strokeWidth={4}
|
|
115
|
+
trailWidth={4}
|
|
116
|
+
strokeColor={firstModel?.primaryColor}
|
|
117
|
+
trailColor={"#F2F2F2"}
|
|
118
|
+
showInfo={false}
|
|
119
|
+
className="progress-circle"
|
|
120
|
+
style={{
|
|
121
|
+
width: "90px",
|
|
122
|
+
}}
|
|
123
|
+
/>
|
|
124
|
+
)}
|
|
123
125
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
126
|
+
<p>
|
|
127
|
+
AI score <br />
|
|
128
|
+
<span>{data?.AiScore || 0}%</span>
|
|
129
|
+
</p>
|
|
130
|
+
</ProgressCircleSection>
|
|
131
|
+
<ul>
|
|
132
|
+
{data?.models?.map((model) => {
|
|
133
|
+
if (model?.id === "logic_evaluation") return null;
|
|
134
|
+
return (
|
|
135
|
+
<li key={model?.id}>
|
|
136
|
+
<p>{`${model?.label} point`}</p>
|
|
137
|
+
<div style={{ backgroundColor: model?.bgColor }}>
|
|
138
|
+
<span style={{ color: model?.primaryColor }}>
|
|
139
|
+
{model?.score || 0}%
|
|
140
|
+
</span>
|
|
141
|
+
<Progress.Line
|
|
142
|
+
percent={model?.score || 0}
|
|
143
|
+
strokeWidth={4}
|
|
144
|
+
trailWidth={4}
|
|
145
|
+
strokeColor={model?.primaryColor}
|
|
146
|
+
trailColor={"#fff"}
|
|
147
|
+
showInfo={false}
|
|
148
|
+
style={{ width: "100%" }}
|
|
149
|
+
/>
|
|
150
|
+
</div>
|
|
151
|
+
</li>
|
|
152
|
+
);
|
|
153
|
+
})}
|
|
154
|
+
</ul>
|
|
155
|
+
</ProgressSidebar>
|
|
156
|
+
{selectedModel?.id === "speech_analysis" && (
|
|
157
|
+
<SpeechSideSection>
|
|
158
|
+
<PlayButton audio={selectedModel?.audioData} />
|
|
159
|
+
<PlayButton
|
|
160
|
+
type="ai"
|
|
161
|
+
refernceText={selectedModel?.data?.Reference}
|
|
162
|
+
/>
|
|
163
|
+
</SpeechSideSection>
|
|
164
|
+
)}
|
|
165
|
+
</Sidebar>
|
|
166
|
+
)}
|
|
164
167
|
<MainSection>
|
|
165
168
|
{tabs?.length > 0 && (
|
|
166
169
|
<Tabs options={tabs} selected={selected} onChange={setSelected} />
|
|
@@ -169,7 +172,10 @@ const FullAnalysis = ({ data, onClose }) => {
|
|
|
169
172
|
<Evaluation Aidata={selectedModel} />
|
|
170
173
|
)}
|
|
171
174
|
{selectedModel?.id === "speech_analysis" && (
|
|
172
|
-
<SpeechAnalysis
|
|
175
|
+
<SpeechAnalysis
|
|
176
|
+
Aidata={selectedModel}
|
|
177
|
+
isPersonal={accountType === "personal"}
|
|
178
|
+
/>
|
|
173
179
|
)}
|
|
174
180
|
{selectedModel?.id === "gammar" && <Grammar />}
|
|
175
181
|
</MainSection>
|
|
@@ -10,6 +10,9 @@ export const Content = styled.div`
|
|
|
10
10
|
grid-template-columns: 220px 1fr;
|
|
11
11
|
gap: 10px;
|
|
12
12
|
margin-top: 8px;
|
|
13
|
+
&.personal {
|
|
14
|
+
grid-template-columns: 1fr;
|
|
15
|
+
}
|
|
13
16
|
`;
|
|
14
17
|
export const Sidebar = styled.div`
|
|
15
18
|
width: 100;
|
|
@@ -223,19 +226,6 @@ export const EvaluationCharactersItem = styled.div`
|
|
|
223
226
|
`;
|
|
224
227
|
|
|
225
228
|
export const SpeechAnalysisHeader = styled.div`
|
|
226
|
-
.label {
|
|
227
|
-
display: flex;
|
|
228
|
-
align-items: center;
|
|
229
|
-
padding: 0 20px;
|
|
230
|
-
gap: 10px;
|
|
231
|
-
margin-bottom: 10px;
|
|
232
|
-
|
|
233
|
-
p {
|
|
234
|
-
font-size: 14px;
|
|
235
|
-
line-height: 24px;
|
|
236
|
-
color: #7c8080;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
229
|
.capitalise {
|
|
240
230
|
text-transform: capitalize;
|
|
241
231
|
}
|
|
@@ -275,6 +265,36 @@ export const SpeechAnalysisHeader = styled.div`
|
|
|
275
265
|
}
|
|
276
266
|
`;
|
|
277
267
|
|
|
268
|
+
export const SpeechTitle = styled.div`
|
|
269
|
+
display: flex;
|
|
270
|
+
align-items: center;
|
|
271
|
+
justify-content: space-between;
|
|
272
|
+
width: 100%;
|
|
273
|
+
|
|
274
|
+
margin-bottom: 10px;
|
|
275
|
+
.label {
|
|
276
|
+
display: flex;
|
|
277
|
+
align-items: center;
|
|
278
|
+
padding: 0 20px;
|
|
279
|
+
gap: 10px;
|
|
280
|
+
|
|
281
|
+
p {
|
|
282
|
+
font-size: 14px;
|
|
283
|
+
line-height: 24px;
|
|
284
|
+
color: #7c8080;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
> div {
|
|
288
|
+
display: flex;
|
|
289
|
+
align-items: center;
|
|
290
|
+
gap: 12px;
|
|
291
|
+
button {
|
|
292
|
+
width: 170px;
|
|
293
|
+
height: 40px;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
`;
|
|
297
|
+
|
|
278
298
|
export const SelectedWord = styled.p`
|
|
279
299
|
color: #636666;
|
|
280
300
|
font-size: 16px;
|