l-min-components 1.7.1519 → 1.7.1521
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 +53 -50
- package/src/components/AIAnalysis/grammer.jsx +45 -44
- package/src/components/AIAnalysis/relevant.jsx +19 -12
- package/src/components/AIAnalysis/responsePlayer.jsx +9 -12
- package/src/components/AIAnalysis/speech.jsx +126 -103
- package/src/components/AdminDashboard/admin-dashboard.jsx +84 -59
- package/src/components/AdminLogin/index.jsx +18 -12
- package/src/components/AdminNavbar/index.jsx +10 -8
- package/src/components/AdminNotification/index.jsx +12 -9
- package/src/components/AdminResetPassword/change-password.jsx +21 -14
- package/src/components/AdminResetPassword/index.jsx +16 -9
- package/src/components/AdminResetPassword/success-screen.jsx +17 -12
- package/src/components/AdminRolesPermission/create/admins.jsx +24 -21
- package/src/components/AdminRolesPermission/create/index.jsx +10 -8
- package/src/components/AdminRolesPermission/create/permissions.jsx +34 -20
- package/src/components/AdminRolesPermission/create/role-name.jsx +42 -23
- package/src/components/AdminRolesPermission/index.jsx +42 -28
- package/src/components/AdminRolesPermission/modals/preview-modal.jsx +10 -5
- package/src/components/AdminRolesPermission/preview-panels/admins-panel.jsx +24 -22
- package/src/components/AdminRolesPermission/preview-panels/assignees-panel.jsx +11 -12
- package/src/components/AdminRolesPermission/preview-panels/unassigned.jsx +10 -9
- package/src/components/AdminSecuritySettings/2fa/index.jsx +64 -35
- package/src/components/AdminSecuritySettings/index.jsx +17 -12
- package/src/components/AdminSecuritySettings/modals/opt-out-modal.jsx +42 -29
- package/src/components/AdminSecuritySettings/modals/otp-password-modal.jsx +38 -37
- package/src/components/AdminSecuritySettings/modals/security-question-modal.jsx +36 -32
- package/src/components/AdminSecuritySettings/modals/success-modal.jsx +29 -25
- package/src/components/AdminSecuritySettings/password/change-password.jsx +22 -19
- package/src/components/AdminSecuritySettings/password/index.jsx +12 -8
- package/src/components/AdminSidebar/index.jsx +15 -18
- package/src/components/ApiProgress/ApiConsumption/index.jsx +5 -5
- package/src/components/AppMainLayout/index.jsx +130 -153
- package/src/components/GraphMap/index.jsx +45 -37
- package/src/components/InputEmoji/index.jsx +739 -207
- package/src/components/TextEditor2/emojiModal.jsx +5 -5
- package/src/components/TextEditor2/tools.jsx +65 -34
- package/src/components/authentication/mainLayout.jsx +4 -3
- package/src/components/banner/developerBanner.jsx +41 -42
- package/src/components/banner/index.jsx +30 -28
- package/src/components/button/index.jsx +19 -20
- package/src/components/calender/input.jsx +40 -57
- package/src/components/course/coursecard/index.jsx +9 -11
- package/src/components/dashboardState/pendingDeleteState.jsx +13 -9
- package/src/components/datePicker/index.jsx +11 -11
- package/src/components/deactivated/index.jsx +67 -58
- package/src/components/deactivated/modal/subscription-expired-modal.jsx +41 -45
- package/src/components/developerAPIdocs/index.jsx +87 -55
- package/src/components/dropdown component/dropdown.jsx +97 -93
- package/src/components/dropdown component/index.jsx +16 -19
- package/src/components/errorPage/index.jsx +26 -24
- package/src/components/fileRightBar/components/progressBar/index.jsx +24 -27
- package/src/components/fileRightBar/components/progressBar/progress.jsx +24 -27
- package/src/components/fileRightBar/components/ugradeLock.jsx +27 -33
- package/src/components/fileRightBar/components/users.jsx +29 -34
- package/src/components/fileRightBar/enterpriseRightBar/index.jsx +25 -31
- package/src/components/fileRightBar/enterpriseRightBar/upgrade.jsx +26 -21
- package/src/components/fileRightBar/instructorRightBar.jsx +71 -76
- package/src/components/fileRightBar/instructorRightBar2/affiliateRightBar.jsx +25 -28
- package/src/components/fileRightBar/instructorRightBar2/index.jsx +28 -34
- package/src/components/fileRightBar/instructorRightBar2/personalRightBar.jsx +20 -20
- package/src/components/fileRightBar/instructorRightBar2/testModal.jsx +14 -9
- package/src/components/fileRightBar/instructorRightBar2/upgrade.jsx +26 -21
- package/src/components/fileRightBar/managerPageRight.jsx +59 -69
- package/src/components/fileRightBar/personalRightBar/index.jsx +107 -116
- package/src/components/fileRightBar/personalRightBar/upgrade.jsx +26 -32
- package/src/components/fileRightBar/upgrade.jsx +71 -81
- package/src/components/fileRightBar/uploadRight.jsx +24 -30
- package/src/components/fileRightBar/users.jsx +36 -41
- package/src/components/friendRequest/friendRequestCard/index.jsx +22 -12
- package/src/components/friendRequest/friendRequestList/index.jsx +7 -7
- package/src/components/getErrorFeatures/errorWrapper.jsx +24 -31
- package/src/components/getErrorFeatures/index.jsx +52 -39
- package/src/components/graph/graphData.jsx +109 -33
- package/src/components/graph/index.jsx +38 -31
- package/src/components/header/account-dropdown.jsx +86 -92
- package/src/components/header/index.jsx +122 -130
- package/src/components/header/languageDropdown.jsx +19 -25
- package/src/components/header/login-header.jsx +28 -31
- package/src/components/instructorAccountSwitcher/components/expiry modal/index.jsx +4 -10
- package/src/components/instructorAccountSwitcher/components/renew modal/index.jsx +8 -13
- package/src/components/instructorAccountSwitcher/index.jsx +40 -56
- package/src/components/messageAddon/InputSection/index.jsx +79 -81
- package/src/components/messageAddon/assets/svg/check_circle.jsx +38 -34
- package/src/components/messageAddon/messages/chatheader/index.jsx +25 -22
- package/src/components/messageAddon/messages/dropdown/chat-dropdown.jsx +7 -8
- package/src/components/messageAddon/messages/message-modals/deleteChat-modal.jsx +8 -7
- package/src/components/messageAddon/messages/message-modals/report-modal.jsx +41 -29
- package/src/components/messageAddon/messages/messages.jsx +55 -48
- package/src/components/mobileLayout/index.jsx +6 -5
- package/src/components/notificationThreshold/index.jsx +21 -14
- package/src/components/notificationThreshold/slider.jsx +6 -5
- package/src/components/reportsComponents/fullAnalysis/components/Evaluation.jsx +20 -15
- package/src/components/reportsComponents/fullAnalysis/components/EvalutionFeedback.jsx +12 -10
- package/src/components/reportsComponents/fullAnalysis/components/Grammar.jsx +28 -67
- package/src/components/reportsComponents/fullAnalysis/components/Grammar.v2.jsx +59 -51
- package/src/components/reportsComponents/fullAnalysis/components/InlineClampedText.jsx +4 -8
- package/src/components/reportsComponents/fullAnalysis/components/PlayButton.jsx +17 -13
- package/src/components/reportsComponents/fullAnalysis/components/SpeechAnalysis.jsx +98 -61
- package/src/components/reportsComponents/fullAnalysis/components/translateDropdown.jsx +8 -19
- package/src/components/reportsComponents/fullAnalysis/index.jsx +32 -29
- package/src/components/reportsComponents/reportQuestions/components/analysisButton.jsx +4 -3
- package/src/components/reportsComponents/reportQuestions/components/comment.jsx +88 -77
- package/src/components/reportsComponents/reportQuestions/components/modals/deleteModal.jsx +9 -12
- package/src/components/reportsComponents/reportQuestions/components/modals/gradingModal.jsx +23 -30
- package/src/components/reportsComponents/reportQuestions/components/modals/index.jsx +32 -35
- package/src/components/reportsComponents/reportQuestions/components/previewImage/index.jsx +10 -11
- package/src/components/reportsComponents/reportQuestions/components/previewImage.jsx +10 -11
- package/src/components/reportsComponents/reportQuestions/components/questionDropdown.jsx +9 -5
- package/src/components/reportsComponents/reportQuestions/components/response.jsx +20 -16
- package/src/components/reportsComponents/reportQuestions/components/responseAudio.v2.jsx +11 -10
- package/src/components/reportsComponents/reportQuestions/index.jsx +11 -23
- package/src/components/reportsComponents/reportQuestions/questions/dialogueScripted.jsx +13 -17
- package/src/components/reportsComponents/reportQuestions/questions/dialogueUnscripted.jsx +9 -15
- package/src/components/reportsComponents/reportQuestions/questions/essayScripted.jsx +7 -8
- package/src/components/reportsComponents/reportQuestions/questions/essayUnscripted.jsx +7 -8
- package/src/components/reportsComponents/reportQuestions/questions/essayWritten.jsx +6 -6
- package/src/components/reportsComponents/reportQuestions/questions/matchPair.jsx +22 -21
- package/src/components/reportsComponents/reportQuestions/questions/quizMultipleChoice.jsx +10 -7
- package/src/components/reportsComponents/reportQuestions/questions/quizScripted.jsx +7 -13
- package/src/components/reportsComponents/reportQuestions/questions/quizUnsripted.jsx +8 -12
- package/src/components/reportsComponents/reportQuestions/questions/reading.jsx +7 -9
- package/src/components/reportsComponents/reportQuestions/questions/soundPlay.jsx +7 -9
- package/src/components/reportsComponents/reportQuestions/questions/wordPlayMultipleChoice.jsx +9 -6
- package/src/components/reportsComponents/reportQuestions/questions/wordPlayText.jsx +5 -4
- package/src/components/sideBar/sideMenu/index.jsx +79 -79
- package/src/components/sideBar/userCard/index.jsx +13 -19
- package/src/components/sideNav/index.jsx +36 -36
- package/src/components/subscriptionPreview/index.jsx +28 -11
- package/src/components/successCard/index.jsx +16 -9
- package/src/components/textEditor/index.jsx +127 -96
- package/src/components/textEditor/test.jsx +19 -15
- package/src/components/video-player/index.jsx +43 -63
- package/src/hooks/recorder-kit/index.jsx +206 -190
package/package.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useTranslation } from 'l-min-components/src/components';
|
|
3
|
+
import wordStore from '../../mc/wordStore.json';
|
|
2
4
|
export const DashboardIcon = ({ width, height, fill }) => (
|
|
3
5
|
<svg
|
|
4
|
-
width={width ||
|
|
5
|
-
height={height ||
|
|
6
|
+
width={width || '24'}
|
|
7
|
+
height={height || '25'}
|
|
6
8
|
viewBox="0 0 24 25"
|
|
7
9
|
fill="none"
|
|
8
10
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -45,50 +47,51 @@ export const DashboardIcon = ({ width, height, fill }) => (
|
|
|
45
47
|
/>
|
|
46
48
|
</svg>
|
|
47
49
|
);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
);
|
|
50
|
+
export const DashboardIconActive = ({ width, height }) => {
|
|
51
|
+
return (
|
|
52
|
+
<svg
|
|
53
|
+
width={width || "24"}
|
|
54
|
+
height={height || "25"}
|
|
55
|
+
viewBox="0 0 24 25"
|
|
56
|
+
fill="none"
|
|
57
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
58
|
+
>
|
|
59
|
+
<path
|
|
60
|
+
d="M5 10.1797H7C9 10.1797 10 9.17969 10 7.17969V5.17969C10 3.17969 9 2.17969 7 2.17969H5C3 2.17969 2 3.17969 2 5.17969V7.17969C2 9.17969 3 10.1797 5 10.1797Z"
|
|
61
|
+
stroke="white"
|
|
62
|
+
stroke-width="1.5"
|
|
63
|
+
stroke-miterlimit="10"
|
|
64
|
+
stroke-linecap="round"
|
|
65
|
+
stroke-linejoin="round"
|
|
66
|
+
fill="#ffffff"
|
|
67
|
+
/>
|
|
68
|
+
<path
|
|
69
|
+
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"
|
|
70
|
+
stroke="white"
|
|
71
|
+
stroke-width="1.5"
|
|
72
|
+
stroke-miterlimit="10"
|
|
73
|
+
stroke-linecap="round"
|
|
74
|
+
stroke-linejoin="round"
|
|
75
|
+
fill={findText("#ffffff")}
|
|
76
|
+
/>
|
|
77
|
+
<path
|
|
78
|
+
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"
|
|
79
|
+
stroke="white"
|
|
80
|
+
stroke-width="1.5"
|
|
81
|
+
stroke-miterlimit="10"
|
|
82
|
+
stroke-linecap="round"
|
|
83
|
+
stroke-linejoin="round"
|
|
84
|
+
fill={findText("#ffffff")}
|
|
85
|
+
/>
|
|
86
|
+
<path
|
|
87
|
+
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"
|
|
88
|
+
stroke="white"
|
|
89
|
+
stroke-width="1.5"
|
|
90
|
+
stroke-miterlimit="10"
|
|
91
|
+
stroke-linecap="round"
|
|
92
|
+
stroke-linejoin="round"
|
|
93
|
+
fill={findText("#ffffff")}
|
|
94
|
+
/>
|
|
95
|
+
</svg>
|
|
96
|
+
);
|
|
97
|
+
};
|
|
@@ -4,15 +4,15 @@ import styled from "styled-components";
|
|
|
4
4
|
import { IoCloseOutline } from "react-icons/io5";
|
|
5
5
|
import { FaCheck } from "react-icons/fa6";
|
|
6
6
|
import ButtonComponent from "../button";
|
|
7
|
-
|
|
7
|
+
import useTranslation from "../../hooks/useTranslation.jsx";
|
|
8
|
+
import wordStore from "../../mc/wordStore.json";
|
|
8
9
|
const Grammer = ({ data, hideScore }) => {
|
|
10
|
+
const { findText } = useTranslation(wordStore);
|
|
9
11
|
const [selected, setSelected] = useState(null);
|
|
10
12
|
const [showVersion, setShowVersion] = useState(null);
|
|
11
|
-
|
|
12
13
|
const feedbackCorrection = data["Correction Operations (Optional)"] || [];
|
|
13
14
|
const originalText = data["Original Speech"] || "";
|
|
14
15
|
const correctText = data["Grammatical Correct Version"] || "";
|
|
15
|
-
|
|
16
16
|
const getFeekbackResult = () => {
|
|
17
17
|
const result = [];
|
|
18
18
|
let positionCounter = 1; // Tracks the word position in the text
|
|
@@ -23,16 +23,16 @@ const Grammer = ({ data, hideScore }) => {
|
|
|
23
23
|
while (wordIndex <= words?.length) {
|
|
24
24
|
const word = words[wordIndex];
|
|
25
25
|
const correction = feedbackCorrection[correctionIndex];
|
|
26
|
-
|
|
27
26
|
if (
|
|
28
27
|
correction &&
|
|
29
|
-
correction?.operation === "substituted" &&
|
|
28
|
+
correction?.operation === "substituted" &&
|
|
29
|
+
// Handle substitution
|
|
30
30
|
words
|
|
31
31
|
.slice(
|
|
32
32
|
wordIndex,
|
|
33
|
-
wordIndex + correction?.original_word.split(
|
|
33
|
+
wordIndex + correction?.original_word.split(' ').length,
|
|
34
34
|
)
|
|
35
|
-
.join(
|
|
35
|
+
.join(' ') === correction?.original_word
|
|
36
36
|
) {
|
|
37
37
|
result.push({
|
|
38
38
|
text: correction?.original_word,
|
|
@@ -40,13 +40,14 @@ const Grammer = ({ data, hideScore }) => {
|
|
|
40
40
|
position: positionCounter,
|
|
41
41
|
operation: correction?.operation,
|
|
42
42
|
});
|
|
43
|
-
wordIndex += correction?.original_word.split(
|
|
43
|
+
wordIndex += correction?.original_word.split(' ').length || 0;
|
|
44
44
|
correctionIndex++;
|
|
45
45
|
positionCounter++;
|
|
46
|
-
} else if (correction && correction?.operation ===
|
|
46
|
+
} else if (correction && correction?.operation === 'inserted') {
|
|
47
47
|
result.push({
|
|
48
48
|
text: correction?.word,
|
|
49
|
-
correct: correction?.word,
|
|
49
|
+
correct: correction?.word,
|
|
50
|
+
// Insert the new word
|
|
50
51
|
position: positionCounter,
|
|
51
52
|
operation: correction?.operation,
|
|
52
53
|
});
|
|
@@ -54,12 +55,13 @@ const Grammer = ({ data, hideScore }) => {
|
|
|
54
55
|
positionCounter++;
|
|
55
56
|
} else {
|
|
56
57
|
if (word !== undefined) {
|
|
57
|
-
result.push({
|
|
58
|
+
result.push({
|
|
59
|
+
text: word,
|
|
60
|
+
});
|
|
58
61
|
}
|
|
59
62
|
wordIndex++;
|
|
60
63
|
}
|
|
61
64
|
}
|
|
62
|
-
|
|
63
65
|
return result;
|
|
64
66
|
};
|
|
65
67
|
const getCorrectResult = () => {
|
|
@@ -67,44 +69,42 @@ const Grammer = ({ data, hideScore }) => {
|
|
|
67
69
|
let correctionIndex = 0;
|
|
68
70
|
let words = correctText.split(/\s+/);
|
|
69
71
|
let wordIndex = 0;
|
|
70
|
-
|
|
71
72
|
while (wordIndex < words.length) {
|
|
72
73
|
const word = words[wordIndex];
|
|
73
74
|
const correction = feedbackCorrection[correctionIndex];
|
|
74
75
|
if (
|
|
75
76
|
correction &&
|
|
76
|
-
correction?.operation ===
|
|
77
|
+
correction?.operation === 'substituted' &&
|
|
77
78
|
words
|
|
78
79
|
.slice(
|
|
79
80
|
wordIndex,
|
|
80
|
-
wordIndex + correction?.replacement_word.split(
|
|
81
|
+
wordIndex + correction?.replacement_word.split(' ').length,
|
|
81
82
|
)
|
|
82
|
-
.join(
|
|
83
|
+
.join(' ') === correction?.replacement_word
|
|
83
84
|
) {
|
|
84
85
|
result.push({
|
|
85
86
|
text: correction?.replacement_word,
|
|
86
87
|
highlight: true,
|
|
87
88
|
});
|
|
88
|
-
wordIndex += correction?.replacement_word.split(
|
|
89
|
+
wordIndex += correction?.replacement_word.split(' ').length;
|
|
89
90
|
correctionIndex++;
|
|
90
|
-
} else if (correction && correction?.operation ===
|
|
91
|
+
} else if (correction && correction?.operation === 'inserted') {
|
|
91
92
|
result.push({
|
|
92
93
|
text: correction?.word,
|
|
93
94
|
highlight: true,
|
|
94
95
|
});
|
|
95
96
|
correctionIndex++;
|
|
96
97
|
} else {
|
|
97
|
-
result.push({
|
|
98
|
+
result.push({
|
|
99
|
+
text: word,
|
|
100
|
+
});
|
|
98
101
|
wordIndex++;
|
|
99
102
|
}
|
|
100
103
|
}
|
|
101
|
-
|
|
102
104
|
return result;
|
|
103
105
|
};
|
|
104
|
-
|
|
105
106
|
const generateParagraph = (data) => {
|
|
106
107
|
let paragraph = "<p>";
|
|
107
|
-
|
|
108
108
|
data?.forEach((item) => {
|
|
109
109
|
if (item?.highlight) {
|
|
110
110
|
paragraph += `<span>${item?.text}</span> `;
|
|
@@ -112,12 +112,9 @@ const Grammer = ({ data, hideScore }) => {
|
|
|
112
112
|
paragraph += `${item?.text} `;
|
|
113
113
|
}
|
|
114
114
|
});
|
|
115
|
-
|
|
116
115
|
paragraph = paragraph?.trim() + "</p>";
|
|
117
|
-
|
|
118
116
|
return paragraph;
|
|
119
117
|
};
|
|
120
|
-
|
|
121
118
|
return (
|
|
122
119
|
<Container>
|
|
123
120
|
{showVersion && (
|
|
@@ -132,11 +129,16 @@ const Grammer = ({ data, hideScore }) => {
|
|
|
132
129
|
<Header>
|
|
133
130
|
<div className="info">
|
|
134
131
|
<CursorClickIcon />
|
|
135
|
-
<p>
|
|
132
|
+
<p>
|
|
133
|
+
{findText(
|
|
134
|
+
"Click on the words/sentences highlighted in red to see feedback"
|
|
135
|
+
)}
|
|
136
|
+
</p>
|
|
136
137
|
</div>
|
|
137
138
|
{!hideScore && (
|
|
138
139
|
<p>
|
|
139
|
-
Points:
|
|
140
|
+
{findText("Points:")}
|
|
141
|
+
<span>{data?.["Grammar Score"] || 0}</span>
|
|
140
142
|
</p>
|
|
141
143
|
)}
|
|
142
144
|
</Header>
|
|
@@ -148,18 +150,18 @@ const Grammer = ({ data, hideScore }) => {
|
|
|
148
150
|
onClick={() => {
|
|
149
151
|
if (value?.position) setSelected(value);
|
|
150
152
|
}}
|
|
151
|
-
className={`${value?.position ?
|
|
153
|
+
className={`${value?.position ? 'error' : ''}`}
|
|
152
154
|
>
|
|
153
|
-
{
|
|
155
|
+
{' '}
|
|
154
156
|
{value?.position && <span>{value?.position}</span>} {value?.text}
|
|
155
157
|
</span>
|
|
156
158
|
))}
|
|
157
159
|
</div>
|
|
158
160
|
{selected && (
|
|
159
161
|
<div className="feedback_content">
|
|
160
|
-
<h3>Feedback
|
|
162
|
+
<h3>{findText("Feedback:")}</h3>
|
|
161
163
|
<div className="reply">
|
|
162
|
-
{selected?.operation !==
|
|
164
|
+
{selected?.operation !== 'inserted' && (
|
|
163
165
|
<div className="row red">
|
|
164
166
|
<IoCloseOutline color="#F95454" />
|
|
165
167
|
<p className="red">
|
|
@@ -185,7 +187,7 @@ const Grammer = ({ data, hideScore }) => {
|
|
|
185
187
|
});
|
|
186
188
|
}}
|
|
187
189
|
>
|
|
188
|
-
<ButtonComponent text="View script" type="secondary" />
|
|
190
|
+
<ButtonComponent text={findText("View script")} type="secondary" />
|
|
189
191
|
</span>
|
|
190
192
|
<span
|
|
191
193
|
onClick={() => {
|
|
@@ -197,16 +199,18 @@ const Grammer = ({ data, hideScore }) => {
|
|
|
197
199
|
});
|
|
198
200
|
}}
|
|
199
201
|
>
|
|
200
|
-
<ButtonComponent
|
|
202
|
+
<ButtonComponent
|
|
203
|
+
text={findText("View corrected version")}
|
|
204
|
+
type="secondary"
|
|
205
|
+
/>
|
|
201
206
|
</span>
|
|
202
207
|
</ButtonWrapper>
|
|
203
208
|
</Container>
|
|
204
209
|
);
|
|
205
210
|
};
|
|
206
|
-
|
|
207
211
|
export default Grammer;
|
|
208
|
-
|
|
209
212
|
const WordsModal = ({ onClose, isCorrect, value }) => {
|
|
213
|
+
const { findText } = useTranslation(wordStore);
|
|
210
214
|
return (
|
|
211
215
|
<ModalWrapper isOpen>
|
|
212
216
|
<ModalComntainer>
|
|
@@ -216,20 +220,21 @@ const WordsModal = ({ onClose, isCorrect, value }) => {
|
|
|
216
220
|
<div className="word_wrapper">
|
|
217
221
|
{isCorrect && (
|
|
218
222
|
<div className="header">
|
|
219
|
-
<h4>Corrected version</h4>
|
|
220
|
-
<p>Introduced words are highlighted in green</p>
|
|
223
|
+
<h4>{findText("Corrected version")}</h4>
|
|
224
|
+
<p>{findText("Introduced words are highlighted in green")}</p>
|
|
221
225
|
</div>
|
|
222
226
|
)}
|
|
223
227
|
<div
|
|
224
228
|
className="content"
|
|
225
|
-
dangerouslySetInnerHTML={{
|
|
229
|
+
dangerouslySetInnerHTML={{
|
|
230
|
+
__html: value,
|
|
231
|
+
}}
|
|
226
232
|
></div>
|
|
227
233
|
</div>
|
|
228
234
|
</ModalComntainer>
|
|
229
235
|
</ModalWrapper>
|
|
230
236
|
);
|
|
231
237
|
};
|
|
232
|
-
|
|
233
238
|
const ModalComntainer = styled.div`
|
|
234
239
|
width: 610px;
|
|
235
240
|
display: flex;
|
|
@@ -290,14 +295,12 @@ const ModalComntainer = styled.div`
|
|
|
290
295
|
}
|
|
291
296
|
}
|
|
292
297
|
`;
|
|
293
|
-
|
|
294
298
|
const Container = styled.div`
|
|
295
299
|
width: 100%;
|
|
296
300
|
display: flex;
|
|
297
301
|
flex-direction: column;
|
|
298
302
|
gap: 20px;
|
|
299
303
|
`;
|
|
300
|
-
|
|
301
304
|
const Header = styled.div`
|
|
302
305
|
display: flex;
|
|
303
306
|
align-items: center;
|
|
@@ -329,7 +332,6 @@ const Header = styled.div`
|
|
|
329
332
|
}
|
|
330
333
|
}
|
|
331
334
|
`;
|
|
332
|
-
|
|
333
335
|
const Content = styled.div`
|
|
334
336
|
border-radius: 20px;
|
|
335
337
|
background: #f9f9f9;
|
|
@@ -409,7 +411,6 @@ const Content = styled.div`
|
|
|
409
411
|
}
|
|
410
412
|
}
|
|
411
413
|
`;
|
|
412
|
-
|
|
413
414
|
const ButtonWrapper = styled.div`
|
|
414
415
|
display: flex;
|
|
415
416
|
align-items: center;
|
|
@@ -426,7 +427,7 @@ const ModalWrapper = styled.div`
|
|
|
426
427
|
left: 0;
|
|
427
428
|
bottom: 0;
|
|
428
429
|
right: 0;
|
|
429
|
-
display: ${({ isOpen }) => (isOpen ?
|
|
430
|
+
display: ${({ isOpen }) => (isOpen ? 'flex' : 'none')};
|
|
430
431
|
align-items: center;
|
|
431
432
|
justify-content: center;
|
|
432
433
|
background-color: rgba(0, 0, 0, 0.6);
|
|
@@ -1,38 +1,48 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import ArrowDown from "./assets/arrowDown";
|
|
4
|
-
|
|
4
|
+
import useTranslation from "../../hooks/useTranslation.jsx";
|
|
5
|
+
import wordStore from "../../mc/wordStore.json";
|
|
5
6
|
const Relevant = ({ data, student_text, hideScore }) => {
|
|
7
|
+
const { findText } = useTranslation(wordStore);
|
|
6
8
|
return (
|
|
7
9
|
<Container>
|
|
8
10
|
<Header>
|
|
9
|
-
<h2 className={data?.Evaluation ===
|
|
11
|
+
<h2 className={data?.Evaluation === 'Not Relevant' ? 'error' : ''}>
|
|
10
12
|
{data?.Evaluation}
|
|
11
13
|
</h2>
|
|
12
14
|
{!hideScore && (
|
|
13
15
|
<p>
|
|
14
|
-
Points:
|
|
16
|
+
{findText("Points:")}
|
|
17
|
+
<span>{data?.Point || 0}</span>
|
|
15
18
|
</p>
|
|
16
19
|
)}
|
|
17
20
|
</Header>
|
|
18
|
-
<Dropdown label="Feedback" isFeedback text={data?.Feedback} />
|
|
19
|
-
{student_text &&
|
|
21
|
+
<Dropdown label={findText("Feedback")} isFeedback text={data?.Feedback} />
|
|
22
|
+
{student_text && (
|
|
23
|
+
<Dropdown label={findText("Student essay")} text={student_text} />
|
|
24
|
+
)}
|
|
20
25
|
</Container>
|
|
21
26
|
);
|
|
22
27
|
};
|
|
23
|
-
|
|
24
28
|
export default Relevant;
|
|
25
|
-
|
|
26
29
|
const Dropdown = ({ isFeedback, text, label }) => {
|
|
30
|
+
const { findText } = useTranslation(wordStore);
|
|
27
31
|
const [toggle, setToggle] = useState(true);
|
|
28
32
|
return (
|
|
29
33
|
<DropdownContainer
|
|
30
|
-
className={
|
|
34
|
+
className={findText("{arg1}", {
|
|
35
|
+
arg1: isFeedback ? "feedback" : undefined,
|
|
36
|
+
})}
|
|
31
37
|
onClick={() => {
|
|
32
38
|
text && setToggle(!toggle);
|
|
33
39
|
}}
|
|
34
40
|
>
|
|
35
|
-
<div
|
|
41
|
+
<div
|
|
42
|
+
className={findText("dd_header {arg1}", {
|
|
43
|
+
arg1: toggle ? "toggle" : "",
|
|
44
|
+
})}
|
|
45
|
+
>
|
|
36
46
|
<p>{label}</p> <ArrowDown />
|
|
37
47
|
</div>
|
|
38
48
|
{toggle && text && (
|
|
@@ -43,14 +53,12 @@ const Dropdown = ({ isFeedback, text, label }) => {
|
|
|
43
53
|
</DropdownContainer>
|
|
44
54
|
);
|
|
45
55
|
};
|
|
46
|
-
|
|
47
56
|
const Container = styled.div`
|
|
48
57
|
width: 100%;
|
|
49
58
|
display: flex;
|
|
50
59
|
flex-direction: column;
|
|
51
60
|
gap: 20px;
|
|
52
61
|
`;
|
|
53
|
-
|
|
54
62
|
const Header = styled.div`
|
|
55
63
|
display: flex;
|
|
56
64
|
align-items: center;
|
|
@@ -81,7 +89,6 @@ const Header = styled.div`
|
|
|
81
89
|
}
|
|
82
90
|
}
|
|
83
91
|
`;
|
|
84
|
-
|
|
85
92
|
const DropdownContainer = styled.div`
|
|
86
93
|
&.feedback {
|
|
87
94
|
.dd_header {
|
|
@@ -2,8 +2,10 @@ import React, { useState } from "react";
|
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import { useSpeechSynthesis } from "react-speech-kit";
|
|
4
4
|
import useAudioPlayer from "../useAudioPlayer";
|
|
5
|
-
|
|
5
|
+
import useTranslation from "../../hooks/useTranslation.jsx";
|
|
6
|
+
import wordStore from "../../mc/wordStore.json";
|
|
6
7
|
const ResponsePlayer = ({ text, audio, small, Label = "You say" }) => {
|
|
8
|
+
const { findText } = useTranslation(wordStore);
|
|
7
9
|
const [isPlaying, setIsPlaying] = useState(false);
|
|
8
10
|
const {
|
|
9
11
|
isPlaying: audioIsPlaying,
|
|
@@ -14,21 +16,21 @@ const ResponsePlayer = ({ text, audio, small, Label = "You say" }) => {
|
|
|
14
16
|
streamSrc: audio?.url,
|
|
15
17
|
src: audio?.uploaded_media_url,
|
|
16
18
|
});
|
|
17
|
-
|
|
18
19
|
const { speak, cancel } = useSpeechSynthesis({
|
|
19
20
|
onEnd: () => {
|
|
20
21
|
setIsPlaying(false);
|
|
21
22
|
},
|
|
22
23
|
});
|
|
23
|
-
|
|
24
24
|
return (
|
|
25
25
|
<Container>
|
|
26
26
|
{text && (
|
|
27
27
|
<Button
|
|
28
|
-
className={small ?
|
|
28
|
+
className={small ? 'small' : ''}
|
|
29
29
|
onClick={() => {
|
|
30
30
|
if (!isPlaying) {
|
|
31
|
-
speak({
|
|
31
|
+
speak({
|
|
32
|
+
text,
|
|
33
|
+
});
|
|
32
34
|
setIsPlaying(true);
|
|
33
35
|
} else {
|
|
34
36
|
cancel();
|
|
@@ -37,12 +39,12 @@ const ResponsePlayer = ({ text, audio, small, Label = "You say" }) => {
|
|
|
37
39
|
}}
|
|
38
40
|
>
|
|
39
41
|
{isPlaying ? <StopIcon /> : <EarIcon />}
|
|
40
|
-
<span>Correct response</span>
|
|
42
|
+
<span>{findText("Correct response")}</span>
|
|
41
43
|
</Button>
|
|
42
44
|
)}
|
|
43
45
|
{audio && isReady && (
|
|
44
46
|
<Button
|
|
45
|
-
className={small ?
|
|
47
|
+
className={small ? 'small' : ''}
|
|
46
48
|
onClick={() => {
|
|
47
49
|
if (!audioIsPlaying) {
|
|
48
50
|
play();
|
|
@@ -58,11 +60,9 @@ const ResponsePlayer = ({ text, audio, small, Label = "You say" }) => {
|
|
|
58
60
|
</Container>
|
|
59
61
|
);
|
|
60
62
|
};
|
|
61
|
-
|
|
62
63
|
const Container = styled.div`
|
|
63
64
|
width: fit-content;
|
|
64
65
|
`;
|
|
65
|
-
|
|
66
66
|
const Button = styled.button`
|
|
67
67
|
display: flex;
|
|
68
68
|
align-items: center;
|
|
@@ -90,9 +90,7 @@ const Button = styled.button`
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
`;
|
|
93
|
-
|
|
94
93
|
export default ResponsePlayer;
|
|
95
|
-
|
|
96
94
|
export const StopIcon = () => (
|
|
97
95
|
<svg
|
|
98
96
|
width="43"
|
|
@@ -161,7 +159,6 @@ const SpeakerIcon = () => (
|
|
|
161
159
|
</defs>
|
|
162
160
|
</svg>
|
|
163
161
|
);
|
|
164
|
-
|
|
165
162
|
const EarIcon = () => (
|
|
166
163
|
<svg
|
|
167
164
|
width="43"
|