l-min-components 1.7.1520 → 1.7.1522
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/assets/svg/dashboard.jsx +9 -12
- package/src/components/AIAnalysis/grammer.jsx +22 -22
- package/src/components/AIAnalysis/relevant.jsx +12 -12
- package/src/components/AIAnalysis/responsePlayer.jsx +8 -8
- package/src/components/AIAnalysis/speech.jsx +47 -47
- package/src/components/AdminDashboard/admin-dashboard.jsx +71 -71
- package/src/components/AdminLogin/index.jsx +21 -21
- package/src/components/AdminNavbar/index.jsx +13 -13
- package/src/components/AdminNotification/index.jsx +17 -17
- package/src/components/AdminResetPassword/change-password.jsx +21 -21
- package/src/components/AdminResetPassword/index.jsx +18 -18
- package/src/components/AdminResetPassword/success-screen.jsx +5 -5
- package/src/components/AdminRolesPermission/create/admins.jsx +28 -28
- package/src/components/AdminRolesPermission/create/index.jsx +12 -12
- package/src/components/AdminRolesPermission/create/permissions.jsx +25 -25
- package/src/components/AdminRolesPermission/create/role-name.jsx +25 -25
- package/src/components/AdminRolesPermission/index.jsx +39 -39
- package/src/components/AdminRolesPermission/modals/preview-modal.jsx +30 -30
- package/src/components/AdminRolesPermission/preview-panels/admins-panel.jsx +10 -10
- package/src/components/AdminRolesPermission/preview-panels/assignees-panel.jsx +12 -12
- package/src/components/AdminRolesPermission/preview-panels/unassigned.jsx +10 -10
- package/src/components/AdminSecuritySettings/2fa/index.jsx +49 -49
- package/src/components/AdminSecuritySettings/index.jsx +22 -22
- package/src/components/AdminSecuritySettings/modals/opt-out-modal.jsx +15 -15
- package/src/components/AdminSecuritySettings/modals/otp-password-modal.jsx +14 -14
- package/src/components/AdminSecuritySettings/modals/security-question-modal.jsx +18 -18
- package/src/components/AdminSecuritySettings/modals/success-modal.jsx +9 -9
- package/src/components/AdminSecuritySettings/password/change-password.jsx +25 -25
- package/src/components/AdminSecuritySettings/password/index.jsx +10 -10
- package/src/components/AdminSidebar/index.jsx +31 -31
- package/src/components/ApiProgress/ApiConsumption/index.jsx +11 -10
- package/src/components/AppMainLayout/index.jsx +65 -66
- package/src/components/GraphMap/index.jsx +15 -15
- package/src/components/InputEmoji/index.jsx +344 -344
- package/src/components/TextEditor2/emojiModal.jsx +7 -7
- package/src/components/TextEditor2/tools.jsx +40 -40
- package/src/components/authentication/mainLayout.jsx +5 -5
- package/src/components/banner/developerBanner.jsx +13 -13
- package/src/components/banner/index.jsx +15 -15
- package/src/components/course/coursecard/index.jsx +6 -6
- package/src/components/dashboardState/pendingDeleteState.jsx +11 -11
- package/src/components/datePicker/index.jsx +10 -10
- package/src/components/deactivated/index.jsx +24 -24
- package/src/components/deactivated/modal/subscription-expired-modal.jsx +24 -24
- package/src/components/developerAPIdocs/index.jsx +43 -43
- package/src/components/errorPage/index.jsx +14 -14
- package/src/components/fileRightBar/components/progressBar/index.jsx +12 -12
- package/src/components/fileRightBar/components/progressBar/progress.jsx +12 -12
- package/src/components/fileRightBar/components/ugradeLock.jsx +18 -18
- package/src/components/fileRightBar/components/users.jsx +7 -7
- package/src/components/fileRightBar/enterpriseRightBar/index.jsx +15 -15
- package/src/components/fileRightBar/enterpriseRightBar/upgrade.jsx +14 -14
- package/src/components/fileRightBar/instructorRightBar.jsx +33 -33
- package/src/components/fileRightBar/instructorRightBar2/affiliateRightBar.jsx +15 -15
- package/src/components/fileRightBar/instructorRightBar2/index.jsx +16 -16
- package/src/components/fileRightBar/instructorRightBar2/personalRightBar.jsx +30 -30
- package/src/components/fileRightBar/instructorRightBar2/testModal.jsx +9 -9
- package/src/components/fileRightBar/instructorRightBar2/upgrade.jsx +15 -15
- package/src/components/fileRightBar/managerPageRight.jsx +32 -32
- package/src/components/fileRightBar/personalRightBar/index.jsx +29 -29
- package/src/components/fileRightBar/personalRightBar/upgrade.jsx +17 -17
- package/src/components/fileRightBar/upgrade.jsx +33 -33
- package/src/components/fileRightBar/uploadRight.jsx +8 -8
- package/src/components/fileRightBar/users.jsx +16 -16
- package/src/components/friendRequest/friendRequestCard/index.jsx +11 -10
- package/src/components/friendRequest/friendRequestList/index.jsx +9 -8
- package/src/components/getErrorFeatures/errorWrapper.jsx +12 -13
- package/src/components/getErrorFeatures/index.jsx +14 -14
- package/src/components/graph/graphData.jsx +26 -26
- package/src/components/graph/index.jsx +19 -19
- package/src/components/header/index.jsx +47 -28
- package/src/components/header/languageDropdown.jsx +3 -3
- package/src/components/header/login-header.jsx +6 -6
- package/src/components/index.js +1 -0
- package/src/components/instructorAccountSwitcher/components/expiry modal/index.jsx +8 -8
- package/src/components/instructorAccountSwitcher/index.jsx +8 -8
- package/src/components/messageAddon/InputSection/index.jsx +12 -12
- package/src/components/messageAddon/assets/svg/check_circle.jsx +4 -4
- package/src/components/messageAddon/messages/chatheader/index.jsx +5 -5
- package/src/components/messageAddon/messages/dropdown/chat-dropdown.jsx +7 -7
- package/src/components/messageAddon/messages/message-modals/deleteChat-modal.jsx +36 -36
- package/src/components/messageAddon/messages/message-modals/report-modal.jsx +59 -59
- package/src/components/messageAddon/messages/messages.jsx +36 -36
- package/src/components/mobileLayout/index.jsx +8 -8
- package/src/components/notificationThreshold/index.jsx +36 -36
- package/src/components/notificationThreshold/slider.jsx +9 -9
- package/src/components/reportsComponents/fullAnalysis/components/Evaluation.jsx +19 -19
- package/src/components/reportsComponents/fullAnalysis/components/EvalutionFeedback.jsx +13 -13
- package/src/components/reportsComponents/fullAnalysis/components/Grammar.jsx +81 -69
- package/src/components/reportsComponents/fullAnalysis/components/Grammar.v2.jsx +65 -65
- package/src/components/reportsComponents/fullAnalysis/components/InlineClampedText.jsx +6 -6
- package/src/components/reportsComponents/fullAnalysis/components/PlayButton.jsx +23 -23
- package/src/components/reportsComponents/fullAnalysis/components/SpeechAnalysis.jsx +101 -100
- package/src/components/reportsComponents/fullAnalysis/index.jsx +34 -34
- package/src/components/reportsComponents/reportQuestions/components/analysisButton.jsx +5 -5
- package/src/components/reportsComponents/reportQuestions/components/comment.jsx +14 -14
- package/src/components/reportsComponents/reportQuestions/components/modals/deleteModal.jsx +8 -8
- package/src/components/reportsComponents/reportQuestions/components/modals/gradingModal.jsx +23 -23
- package/src/components/reportsComponents/reportQuestions/components/modals/index.jsx +18 -18
- package/src/components/reportsComponents/reportQuestions/components/previewImage/index.jsx +12 -14
- package/src/components/reportsComponents/reportQuestions/components/previewImage.jsx +12 -12
- package/src/components/reportsComponents/reportQuestions/components/questionDropdown.jsx +6 -6
- package/src/components/reportsComponents/reportQuestions/components/responseAudio.v2.jsx +12 -12
- package/src/components/reportsComponents/reportQuestions/index.jsx +67 -67
- package/src/components/reportsComponents/reportQuestions/questions/dialogueScripted.jsx +15 -15
- package/src/components/reportsComponents/reportQuestions/questions/dialogueUnscripted.jsx +14 -14
- package/src/components/reportsComponents/reportQuestions/questions/essayScripted.jsx +11 -11
- package/src/components/reportsComponents/reportQuestions/questions/essayUnscripted.jsx +10 -10
- package/src/components/reportsComponents/reportQuestions/questions/essayWritten.jsx +9 -9
- package/src/components/reportsComponents/reportQuestions/questions/matchPair.jsx +12 -12
- package/src/components/reportsComponents/reportQuestions/questions/quizMultipleChoice.jsx +12 -12
- package/src/components/reportsComponents/reportQuestions/questions/quizScripted.jsx +13 -13
- package/src/components/reportsComponents/reportQuestions/questions/quizUnsripted.jsx +13 -13
- package/src/components/reportsComponents/reportQuestions/questions/reading.jsx +12 -12
- package/src/components/reportsComponents/reportQuestions/questions/soundPlay.jsx +10 -10
- package/src/components/reportsComponents/reportQuestions/questions/wordPlayMultipleChoice.jsx +13 -13
- package/src/components/reportsComponents/reportQuestions/questions/wordPlayText.jsx +10 -10
- package/src/components/sideBar/sideMenu/index.jsx +10 -10
- package/src/components/sideBar/userCard/index.jsx +14 -14
- package/src/components/sideNav/index.jsx +4 -4
- package/src/components/subscriptionPreview/index.jsx +11 -11
- package/src/components/successCard/index.jsx +6 -6
- package/src/components/textEditor/index.jsx +22 -22
- package/src/components/textEditor/test.jsx +11 -11
- package/src/components/video-player/index.jsx +9 -9
- package/src/hooks/recorder-kit/index.jsx +58 -58
package/package.json
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { useTranslation } from 'l-min-components/src/components';
|
|
3
|
-
import wordStore from '../../mc/wordStore.json';
|
|
1
|
+
import React from "react";
|
|
4
2
|
export const DashboardIcon = ({ width, height, fill }) => (
|
|
5
3
|
<svg
|
|
6
|
-
width={width ||
|
|
7
|
-
height={height ||
|
|
4
|
+
width={width || "24"}
|
|
5
|
+
height={height || "25"}
|
|
8
6
|
viewBox="0 0 24 25"
|
|
9
7
|
fill="none"
|
|
10
8
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -48,11 +46,10 @@ export const DashboardIcon = ({ width, height, fill }) => (
|
|
|
48
46
|
</svg>
|
|
49
47
|
);
|
|
50
48
|
export const DashboardIconActive = ({ width, height }) => {
|
|
51
|
-
const { findText } = useTranslation(wordStore);
|
|
52
49
|
return (
|
|
53
50
|
<svg
|
|
54
|
-
width={width ||
|
|
55
|
-
height={height ||
|
|
51
|
+
width={width || "24"}
|
|
52
|
+
height={height || "25"}
|
|
56
53
|
viewBox="0 0 24 25"
|
|
57
54
|
fill="none"
|
|
58
55
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -64,7 +61,7 @@ export const DashboardIconActive = ({ width, height }) => {
|
|
|
64
61
|
stroke-miterlimit="10"
|
|
65
62
|
stroke-linecap="round"
|
|
66
63
|
stroke-linejoin="round"
|
|
67
|
-
fill=
|
|
64
|
+
fill="#ffffff"
|
|
68
65
|
/>
|
|
69
66
|
<path
|
|
70
67
|
d="M17 10.1797H19C21 10.1797 22 9.17969 22 7.17969V5.17969C22 3.17969 21 2.17969 19 2.17969H17C15 2.17969 14 3.17969 14 5.17969V7.17969C14 9.17969 15 10.1797 17 10.1797Z"
|
|
@@ -73,7 +70,7 @@ export const DashboardIconActive = ({ width, height }) => {
|
|
|
73
70
|
stroke-miterlimit="10"
|
|
74
71
|
stroke-linecap="round"
|
|
75
72
|
stroke-linejoin="round"
|
|
76
|
-
fill={
|
|
73
|
+
fill={"#ffffff"}
|
|
77
74
|
/>
|
|
78
75
|
<path
|
|
79
76
|
d="M17 22.1797H19C21 22.1797 22 21.1797 22 19.1797V17.1797C22 15.1797 21 14.1797 19 14.1797H17C15 14.1797 14 15.1797 14 17.1797V19.1797C14 21.1797 15 22.1797 17 22.1797Z"
|
|
@@ -82,7 +79,7 @@ export const DashboardIconActive = ({ width, height }) => {
|
|
|
82
79
|
stroke-miterlimit="10"
|
|
83
80
|
stroke-linecap="round"
|
|
84
81
|
stroke-linejoin="round"
|
|
85
|
-
fill={
|
|
82
|
+
fill={"#ffffff"}
|
|
86
83
|
/>
|
|
87
84
|
<path
|
|
88
85
|
d="M5 22.1797H7C9 22.1797 10 21.1797 10 19.1797V17.1797C10 15.1797 9 14.1797 7 14.1797H5C3 14.1797 2 15.1797 2 17.1797V19.1797C2 21.1797 3 22.1797 5 22.1797Z"
|
|
@@ -91,7 +88,7 @@ export const DashboardIconActive = ({ width, height }) => {
|
|
|
91
88
|
stroke-miterlimit="10"
|
|
92
89
|
stroke-linecap="round"
|
|
93
90
|
stroke-linejoin="round"
|
|
94
|
-
fill={
|
|
91
|
+
fill={"#ffffff"}
|
|
95
92
|
/>
|
|
96
93
|
</svg>
|
|
97
94
|
);
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import React, { useState } from
|
|
2
|
-
import CursorClickIcon from
|
|
3
|
-
import styled from
|
|
4
|
-
import { IoCloseOutline } from
|
|
5
|
-
import { FaCheck } from
|
|
6
|
-
import ButtonComponent from
|
|
7
|
-
import
|
|
8
|
-
import wordStore from
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import CursorClickIcon from "./assets/cursorClick";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
import { IoCloseOutline } from "react-icons/io5";
|
|
5
|
+
import { FaCheck } from "react-icons/fa6";
|
|
6
|
+
import ButtonComponent from "../button";
|
|
7
|
+
import useTranslation from "../../hooks/useTranslation.jsx";
|
|
8
|
+
import wordStore from "../../mc/wordStore.json";
|
|
9
9
|
const Grammer = ({ data, hideScore }) => {
|
|
10
10
|
const { findText } = useTranslation(wordStore);
|
|
11
11
|
const [selected, setSelected] = useState(null);
|
|
12
12
|
const [showVersion, setShowVersion] = useState(null);
|
|
13
|
-
const feedbackCorrection = data[
|
|
14
|
-
const originalText = data[
|
|
15
|
-
const correctText = data[
|
|
13
|
+
const feedbackCorrection = data["Correction Operations (Optional)"] || [];
|
|
14
|
+
const originalText = data["Original Speech"] || "";
|
|
15
|
+
const correctText = data["Grammatical Correct Version"] || "";
|
|
16
16
|
const getFeekbackResult = () => {
|
|
17
17
|
const result = [];
|
|
18
18
|
let positionCounter = 1; // Tracks the word position in the text
|
|
@@ -25,7 +25,7 @@ const Grammer = ({ data, hideScore }) => {
|
|
|
25
25
|
const correction = feedbackCorrection[correctionIndex];
|
|
26
26
|
if (
|
|
27
27
|
correction &&
|
|
28
|
-
correction?.operation ===
|
|
28
|
+
correction?.operation === "substituted" &&
|
|
29
29
|
// Handle substitution
|
|
30
30
|
words
|
|
31
31
|
.slice(
|
|
@@ -104,7 +104,7 @@ const Grammer = ({ data, hideScore }) => {
|
|
|
104
104
|
return result;
|
|
105
105
|
};
|
|
106
106
|
const generateParagraph = (data) => {
|
|
107
|
-
let paragraph =
|
|
107
|
+
let paragraph = "<p>";
|
|
108
108
|
data?.forEach((item) => {
|
|
109
109
|
if (item?.highlight) {
|
|
110
110
|
paragraph += `<span>${item?.text}</span> `;
|
|
@@ -112,7 +112,7 @@ const Grammer = ({ data, hideScore }) => {
|
|
|
112
112
|
paragraph += `${item?.text} `;
|
|
113
113
|
}
|
|
114
114
|
});
|
|
115
|
-
paragraph = paragraph?.trim() +
|
|
115
|
+
paragraph = paragraph?.trim() + "</p>";
|
|
116
116
|
return paragraph;
|
|
117
117
|
};
|
|
118
118
|
return (
|
|
@@ -131,14 +131,14 @@ const Grammer = ({ data, hideScore }) => {
|
|
|
131
131
|
<CursorClickIcon />
|
|
132
132
|
<p>
|
|
133
133
|
{findText(
|
|
134
|
-
|
|
134
|
+
"Click on the words/sentences highlighted in red to see feedback"
|
|
135
135
|
)}
|
|
136
136
|
</p>
|
|
137
137
|
</div>
|
|
138
138
|
{!hideScore && (
|
|
139
139
|
<p>
|
|
140
|
-
{findText(
|
|
141
|
-
<span>{data?.[
|
|
140
|
+
{findText("Points:")}
|
|
141
|
+
<span>{data?.["Grammar Score"] || 0}</span>
|
|
142
142
|
</p>
|
|
143
143
|
)}
|
|
144
144
|
</Header>
|
|
@@ -159,7 +159,7 @@ const Grammer = ({ data, hideScore }) => {
|
|
|
159
159
|
</div>
|
|
160
160
|
{selected && (
|
|
161
161
|
<div className="feedback_content">
|
|
162
|
-
<h3>{findText(
|
|
162
|
+
<h3>{findText("Feedback:")}</h3>
|
|
163
163
|
<div className="reply">
|
|
164
164
|
{selected?.operation !== 'inserted' && (
|
|
165
165
|
<div className="row red">
|
|
@@ -187,7 +187,7 @@ const Grammer = ({ data, hideScore }) => {
|
|
|
187
187
|
});
|
|
188
188
|
}}
|
|
189
189
|
>
|
|
190
|
-
<ButtonComponent text={findText(
|
|
190
|
+
<ButtonComponent text={findText("View script")} type="secondary" />
|
|
191
191
|
</span>
|
|
192
192
|
<span
|
|
193
193
|
onClick={() => {
|
|
@@ -200,7 +200,7 @@ const Grammer = ({ data, hideScore }) => {
|
|
|
200
200
|
}}
|
|
201
201
|
>
|
|
202
202
|
<ButtonComponent
|
|
203
|
-
text={findText(
|
|
203
|
+
text={findText("View corrected version")}
|
|
204
204
|
type="secondary"
|
|
205
205
|
/>
|
|
206
206
|
</span>
|
|
@@ -220,8 +220,8 @@ const WordsModal = ({ onClose, isCorrect, value }) => {
|
|
|
220
220
|
<div className="word_wrapper">
|
|
221
221
|
{isCorrect && (
|
|
222
222
|
<div className="header">
|
|
223
|
-
<h4>{findText(
|
|
224
|
-
<p>{findText(
|
|
223
|
+
<h4>{findText("Corrected version")}</h4>
|
|
224
|
+
<p>{findText("Introduced words are highlighted in green")}</p>
|
|
225
225
|
</div>
|
|
226
226
|
)}
|
|
227
227
|
<div
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React, { useState } from
|
|
2
|
-
import styled from
|
|
3
|
-
import ArrowDown from
|
|
4
|
-
import
|
|
5
|
-
import wordStore from
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import ArrowDown from "./assets/arrowDown";
|
|
4
|
+
import useTranslation from "../../hooks/useTranslation.jsx";
|
|
5
|
+
import wordStore from "../../mc/wordStore.json";
|
|
6
6
|
const Relevant = ({ data, student_text, hideScore }) => {
|
|
7
7
|
const { findText } = useTranslation(wordStore);
|
|
8
8
|
return (
|
|
@@ -13,14 +13,14 @@ const Relevant = ({ data, student_text, hideScore }) => {
|
|
|
13
13
|
</h2>
|
|
14
14
|
{!hideScore && (
|
|
15
15
|
<p>
|
|
16
|
-
{findText(
|
|
16
|
+
{findText("Points:")}
|
|
17
17
|
<span>{data?.Point || 0}</span>
|
|
18
18
|
</p>
|
|
19
19
|
)}
|
|
20
20
|
</Header>
|
|
21
|
-
<Dropdown label={findText(
|
|
21
|
+
<Dropdown label={findText("Feedback")} isFeedback text={data?.Feedback} />
|
|
22
22
|
{student_text && (
|
|
23
|
-
<Dropdown label={findText(
|
|
23
|
+
<Dropdown label={findText("Student essay")} text={student_text} />
|
|
24
24
|
)}
|
|
25
25
|
</Container>
|
|
26
26
|
);
|
|
@@ -31,16 +31,16 @@ const Dropdown = ({ isFeedback, text, label }) => {
|
|
|
31
31
|
const [toggle, setToggle] = useState(true);
|
|
32
32
|
return (
|
|
33
33
|
<DropdownContainer
|
|
34
|
-
className={findText(
|
|
35
|
-
arg1: isFeedback ?
|
|
34
|
+
className={findText("{arg1}", {
|
|
35
|
+
arg1: isFeedback ? "feedback" : undefined,
|
|
36
36
|
})}
|
|
37
37
|
onClick={() => {
|
|
38
38
|
text && setToggle(!toggle);
|
|
39
39
|
}}
|
|
40
40
|
>
|
|
41
41
|
<div
|
|
42
|
-
className={findText(
|
|
43
|
-
arg1: toggle ?
|
|
42
|
+
className={findText("dd_header {arg1}", {
|
|
43
|
+
arg1: toggle ? "toggle" : "",
|
|
44
44
|
})}
|
|
45
45
|
>
|
|
46
46
|
<p>{label}</p> <ArrowDown />
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React, { useState } from
|
|
2
|
-
import styled from
|
|
3
|
-
import { useSpeechSynthesis } from
|
|
4
|
-
import useAudioPlayer from
|
|
5
|
-
import
|
|
6
|
-
import wordStore from
|
|
7
|
-
const ResponsePlayer = ({ text, audio, small, Label =
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { useSpeechSynthesis } from "react-speech-kit";
|
|
4
|
+
import useAudioPlayer from "../useAudioPlayer";
|
|
5
|
+
import useTranslation from "../../hooks/useTranslation.jsx";
|
|
6
|
+
import wordStore from "../../mc/wordStore.json";
|
|
7
|
+
const ResponsePlayer = ({ text, audio, small, Label = "You say" }) => {
|
|
8
8
|
const { findText } = useTranslation(wordStore);
|
|
9
9
|
const [isPlaying, setIsPlaying] = useState(false);
|
|
10
10
|
const {
|
|
@@ -39,7 +39,7 @@ const ResponsePlayer = ({ text, audio, small, Label = 'You say' }) => {
|
|
|
39
39
|
}}
|
|
40
40
|
>
|
|
41
41
|
{isPlaying ? <StopIcon /> : <EarIcon />}
|
|
42
|
-
<span>{findText(
|
|
42
|
+
<span>{findText("Correct response")}</span>
|
|
43
43
|
</Button>
|
|
44
44
|
)}
|
|
45
45
|
{audio && isReady && (
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import React, { useState } from
|
|
2
|
-
import styled from
|
|
3
|
-
import CursorClickIcon from
|
|
4
|
-
import ResponsePlayer from
|
|
5
|
-
import DropdownResult from
|
|
6
|
-
import WordWheel from
|
|
7
|
-
import formatScore from
|
|
8
|
-
import
|
|
9
|
-
import wordStore from
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import CursorClickIcon from "./assets/cursorClick";
|
|
4
|
+
import ResponsePlayer from "./responsePlayer";
|
|
5
|
+
import DropdownResult from "./dropdownResult";
|
|
6
|
+
import WordWheel from "./wordWheel";
|
|
7
|
+
import formatScore from "../../utils/formatScore";
|
|
8
|
+
import useTranslation from "../../hooks/useTranslation.jsx";
|
|
9
|
+
import wordStore from "../../mc/wordStore.json";
|
|
10
10
|
const Speech = ({ data, audio, hideScore }) => {
|
|
11
11
|
const { findText } = useTranslation(wordStore);
|
|
12
|
-
const wordsData = Object.values(data[
|
|
12
|
+
const wordsData = Object.values(data["Word Phonetic Evaluation"])?.map(
|
|
13
13
|
(word, idx) => ({
|
|
14
14
|
id: idx,
|
|
15
15
|
value: word,
|
|
16
|
-
})
|
|
16
|
+
})
|
|
17
17
|
);
|
|
18
18
|
const [selectedWord, setSelectWord] = useState(wordsData[0]);
|
|
19
19
|
const handeSelectWord = (idx, word) => {
|
|
@@ -47,12 +47,12 @@ const Speech = ({ data, audio, hideScore }) => {
|
|
|
47
47
|
<Header>
|
|
48
48
|
<div className="info">
|
|
49
49
|
<CursorClickIcon />
|
|
50
|
-
<p>{findText(
|
|
50
|
+
<p>{findText("Click on the word to see detailed feedback")}</p>
|
|
51
51
|
</div>
|
|
52
52
|
{!hideScore && (
|
|
53
53
|
<p>
|
|
54
|
-
{findText(
|
|
55
|
-
<span>{formatScore(data[
|
|
54
|
+
{findText("Points:")}
|
|
55
|
+
<span>{formatScore(data["General Score"]) || 0}</span>
|
|
56
56
|
</p>
|
|
57
57
|
)}
|
|
58
58
|
</Header>
|
|
@@ -80,17 +80,17 @@ const Speech = ({ data, audio, hideScore }) => {
|
|
|
80
80
|
<div className="resp_body">
|
|
81
81
|
<h2
|
|
82
82
|
style={{
|
|
83
|
-
color: setColor(selectedWord?.value[
|
|
83
|
+
color: setColor(selectedWord?.value["Word Score"]),
|
|
84
84
|
}}
|
|
85
85
|
>
|
|
86
|
-
'{selectedWord?.value[
|
|
86
|
+
'{selectedWord?.value["Word"]?.toLowerCase()}'
|
|
87
87
|
</h2>
|
|
88
88
|
<div className="resp">
|
|
89
89
|
{audio?.url && (
|
|
90
90
|
<ResponsePlayer
|
|
91
91
|
small
|
|
92
92
|
audio={audio}
|
|
93
|
-
Label={findText(
|
|
93
|
+
Label={findText("Student response")}
|
|
94
94
|
/>
|
|
95
95
|
)}
|
|
96
96
|
|
|
@@ -98,7 +98,7 @@ const Speech = ({ data, audio, hideScore }) => {
|
|
|
98
98
|
</div>
|
|
99
99
|
</div>{' '}
|
|
100
100
|
<DropdownResult
|
|
101
|
-
label={findText(
|
|
101
|
+
label={findText("Phoneme phonetics")}
|
|
102
102
|
element={
|
|
103
103
|
<PhonemePhonetics
|
|
104
104
|
data={selectedWord?.value['Phoneme Phonetic Evaluation']}
|
|
@@ -106,11 +106,11 @@ const Speech = ({ data, audio, hideScore }) => {
|
|
|
106
106
|
}
|
|
107
107
|
/>
|
|
108
108
|
<DropdownResult
|
|
109
|
-
label={findText(
|
|
109
|
+
label={findText("Word phonetics")}
|
|
110
110
|
element={<WordPhonetics data={selectedWord?.value} />}
|
|
111
111
|
/>
|
|
112
112
|
<DropdownResult
|
|
113
|
-
label={findText(
|
|
113
|
+
label={findText("Clarity level")}
|
|
114
114
|
element={
|
|
115
115
|
<Claritylevel
|
|
116
116
|
audibility={data?.Audibility}
|
|
@@ -120,8 +120,8 @@ const Speech = ({ data, audio, hideScore }) => {
|
|
|
120
120
|
}
|
|
121
121
|
/>
|
|
122
122
|
<DropdownResult
|
|
123
|
-
label={findText(
|
|
124
|
-
element={<Intonation value={data[
|
|
123
|
+
label={findText("Intonation")}
|
|
124
|
+
element={<Intonation value={data["Intonation"]} />}
|
|
125
125
|
/>
|
|
126
126
|
</BottomWrapper>
|
|
127
127
|
</Container>
|
|
@@ -244,37 +244,37 @@ export const Claritylevel = ({
|
|
|
244
244
|
<ClaritylevelContent>
|
|
245
245
|
<div className="context_box">
|
|
246
246
|
<div className="top">
|
|
247
|
-
<h4>{findText(
|
|
248
|
-
<p>{findText(
|
|
247
|
+
<h4>{findText("Speech Rate")}</h4>
|
|
248
|
+
<p>{findText("Your average words spoken per minute.")}</p>
|
|
249
249
|
</div>
|
|
250
250
|
<div className="botton">
|
|
251
251
|
<SpeedRateIcon />
|
|
252
252
|
<p>
|
|
253
253
|
{Math.floor(speechRate) || 0}
|
|
254
|
-
{findText(
|
|
254
|
+
{findText("(wpm)")}
|
|
255
255
|
</p>
|
|
256
256
|
</div>
|
|
257
257
|
</div>
|
|
258
258
|
<div className="context_box">
|
|
259
259
|
<div className="top">
|
|
260
|
-
<h4>{findText(
|
|
260
|
+
<h4>{findText("Fluency")}</h4>
|
|
261
261
|
<p>
|
|
262
|
-
{findText(
|
|
262
|
+
{findText("Your level of speaking proficiency in the language.")}
|
|
263
263
|
</p>
|
|
264
264
|
</div>
|
|
265
265
|
<div className="botton">
|
|
266
266
|
<WaveIcon />
|
|
267
267
|
<p>
|
|
268
268
|
{Math.floor(fluency) || 0}
|
|
269
|
-
{findText(
|
|
269
|
+
{findText("(decibel level)")}
|
|
270
270
|
</p>
|
|
271
271
|
</div>
|
|
272
272
|
</div>
|
|
273
273
|
<div className="context_box">
|
|
274
274
|
<div className="top">
|
|
275
|
-
<h4>{findText(
|
|
275
|
+
<h4>{findText("Audibility")}</h4>
|
|
276
276
|
<p>
|
|
277
|
-
{findText(
|
|
277
|
+
{findText("How clearly you project your voice while speaking.")}
|
|
278
278
|
</p>
|
|
279
279
|
</div>
|
|
280
280
|
<div className="botton">
|
|
@@ -447,7 +447,7 @@ export const Intonation = ({ value = 0 }) => {
|
|
|
447
447
|
: '#F95454';
|
|
448
448
|
return (
|
|
449
449
|
<IntonationContainer>
|
|
450
|
-
<p>{findText(
|
|
450
|
+
<p>{findText("The rise and fall of your voice while speaking.")}</p>
|
|
451
451
|
<IntonationIcon />
|
|
452
452
|
<p
|
|
453
453
|
style={{
|
|
@@ -498,8 +498,8 @@ export const PhonemePhonetics = ({ data }) => {
|
|
|
498
498
|
};
|
|
499
499
|
const getFeedback = (v) => {
|
|
500
500
|
if (v) {
|
|
501
|
-
const content = v[
|
|
502
|
-
const title = v[
|
|
501
|
+
const content = v["Phoneme Feedback"];
|
|
502
|
+
const title = v["Phoneme Feedback Summary"];
|
|
503
503
|
if (content && title)
|
|
504
504
|
return {
|
|
505
505
|
title,
|
|
@@ -514,9 +514,9 @@ export const PhonemePhonetics = ({ data }) => {
|
|
|
514
514
|
<div className="box_container">
|
|
515
515
|
<div className="table_wrapper">
|
|
516
516
|
<div className="t_head">
|
|
517
|
-
<p>{findText(
|
|
518
|
-
<p>{findText(
|
|
519
|
-
<p>{findText(
|
|
517
|
+
<p>{findText("Phoneme")}</p>
|
|
518
|
+
<p>{findText("Score")}</p>
|
|
519
|
+
<p>{findText("Grade")}</p>
|
|
520
520
|
</div>
|
|
521
521
|
<div className="row">
|
|
522
522
|
{values?.map((v, idx) => (
|
|
@@ -632,25 +632,25 @@ const PhonemePhoneticsContainer = styled.div`
|
|
|
632
632
|
`;
|
|
633
633
|
export const WordPhonetics = ({ data }) => {
|
|
634
634
|
const { findText } = useTranslation(wordStore);
|
|
635
|
-
const progress = data[
|
|
636
|
-
const syllables = data[
|
|
635
|
+
const progress = data["Word Score"];
|
|
636
|
+
const syllables = data["Syllables"];
|
|
637
637
|
return (
|
|
638
638
|
<WordPhoneticsContainer>
|
|
639
639
|
<div className="header">
|
|
640
640
|
<div className="box">
|
|
641
|
-
<p>{findText(
|
|
641
|
+
<p>{findText("Word Score:")}</p> <WordWheel progress={progress} />
|
|
642
642
|
</div>
|
|
643
643
|
<div className="box">
|
|
644
|
-
<p>{findText(
|
|
645
|
-
<span>{data[
|
|
644
|
+
<p>{findText("Number of Syllables:")}</p>
|
|
645
|
+
<span>{data["Number Of Syllables"]}</span>
|
|
646
646
|
</div>
|
|
647
647
|
</div>
|
|
648
648
|
<div className="table_wrapper">
|
|
649
649
|
<div className="t_head">
|
|
650
|
-
<p>{findText(
|
|
651
|
-
<p>{findText(
|
|
652
|
-
<p>{findText(
|
|
653
|
-
<p>{findText(
|
|
650
|
+
<p>{findText("Syllables")}</p>
|
|
651
|
+
<p>{findText("Score")}</p>
|
|
652
|
+
<p>{findText("Syllable Structure")}</p>
|
|
653
|
+
<p>{findText("Stress")}</p>
|
|
654
654
|
</div>
|
|
655
655
|
<div className="t_row">
|
|
656
656
|
{syllables?.map((v, key) => (
|
|
@@ -686,10 +686,10 @@ export const WordPhonetics = ({ data }) => {
|
|
|
686
686
|
<div className="box">
|
|
687
687
|
<p
|
|
688
688
|
style={{
|
|
689
|
-
textTransform:
|
|
689
|
+
textTransform: "capitalize",
|
|
690
690
|
}}
|
|
691
691
|
>
|
|
692
|
-
{v[
|
|
692
|
+
{v["Stress"]}
|
|
693
693
|
</p>
|
|
694
694
|
</div>
|
|
695
695
|
</div>
|