l-min-components 1.7.1429 → 1.7.1430
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "l-min-components",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.1430",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"src/assets",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"classnames": "^2.3.2",
|
|
23
23
|
"dexie": "^4.0.8",
|
|
24
24
|
"dexie-react-hooks": "^1.1.7",
|
|
25
|
+
"dompurify": "^3.2.6",
|
|
25
26
|
"draft-convert": "^2.1.13",
|
|
26
27
|
"draft-js": "^0.11.7",
|
|
27
28
|
"draftjs-to-html": "^0.9.1",
|
|
@@ -15,28 +15,30 @@ import { useState } from "react";
|
|
|
15
15
|
import GoodCheck from "../../../../assets/svg/goodCheck";
|
|
16
16
|
import RedX from "../../../../assets/svg/redX";
|
|
17
17
|
import useReportUtils from "../../hooks/useRreportUtils";
|
|
18
|
-
import WarningGrey from "../../../../assets/svg/warningGrey";
|
|
18
|
+
// import WarningGrey from "../../../../assets/svg/warningGrey";
|
|
19
|
+
|
|
20
|
+
// import DOMPurify from "dompurify";
|
|
19
21
|
|
|
20
22
|
const Grammar = ({ Aidata }) => {
|
|
21
23
|
const [selectedSection, setSelectedSection] = useState(1);
|
|
22
24
|
const [selectedWord, setSelectedWord] = useState(null);
|
|
23
25
|
|
|
24
26
|
const data = Aidata?.data;
|
|
25
|
-
const feedbackCorrection =
|
|
27
|
+
const feedbackCorrection = (
|
|
28
|
+
data?.["Correction Operations (Optional)"] || []
|
|
29
|
+
)?.filter((item) => ["substituted", "formatting"].includes(item?.operation));
|
|
26
30
|
const originalText = data?.["Original Speech"] || "";
|
|
27
31
|
const correctText = data?.["Grammatical Correct Version"] || "";
|
|
28
32
|
const feedbacks = data?.["Feedback"];
|
|
29
|
-
|
|
33
|
+
|
|
34
|
+
const { grammarFeekbackResult } = useReportUtils();
|
|
30
35
|
|
|
31
36
|
const wordsFeedback = grammarFeekbackResult(
|
|
32
37
|
originalText,
|
|
33
38
|
feedbackCorrection,
|
|
34
|
-
feedbacks
|
|
35
|
-
correctText
|
|
39
|
+
feedbacks
|
|
36
40
|
);
|
|
37
41
|
|
|
38
|
-
const sentenceParts = renderCorrectedSentence(wordsFeedback);
|
|
39
|
-
|
|
40
42
|
useEffect(() => {
|
|
41
43
|
if (wordsFeedback?.length) {
|
|
42
44
|
const findWord = wordsFeedback?.find((word) => word?.operation);
|
|
@@ -113,39 +115,16 @@ const Grammar = ({ Aidata }) => {
|
|
|
113
115
|
<GoodCheck />
|
|
114
116
|
<span>{selectedWord?.correct}</span>
|
|
115
117
|
</div>
|
|
116
|
-
<p>{selectedWord?.feedback}</p>
|
|
117
118
|
</div>
|
|
118
119
|
)}
|
|
119
120
|
{selectedSection === 2 && originalText && <p>{originalText}</p>}
|
|
120
121
|
{selectedSection === 3 && (
|
|
121
122
|
<div className="correct_section">
|
|
122
|
-
<div className="warning">
|
|
123
|
+
{/* <div className="warning">
|
|
123
124
|
<WarningGrey />
|
|
124
125
|
<p>Introduced words are highlighted in green</p>
|
|
125
|
-
</div>
|
|
126
|
-
<p>
|
|
127
|
-
{sentenceParts.map((part, index) => {
|
|
128
|
-
const nextPart = sentenceParts[index + 1];
|
|
129
|
-
const needsSpace =
|
|
130
|
-
nextPart && !/^[.,!?;:]/.test(nextPart.text);
|
|
131
|
-
|
|
132
|
-
if (part.highlight) {
|
|
133
|
-
return (
|
|
134
|
-
<span key={index}>
|
|
135
|
-
{part.text}
|
|
136
|
-
{needsSpace ? " " : ""}
|
|
137
|
-
</span>
|
|
138
|
-
);
|
|
139
|
-
} else {
|
|
140
|
-
return (
|
|
141
|
-
<React.Fragment key={index}>
|
|
142
|
-
{part.text}
|
|
143
|
-
{needsSpace ? " " : ""}
|
|
144
|
-
</React.Fragment>
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
})}
|
|
148
|
-
</p>
|
|
126
|
+
</div> */}
|
|
127
|
+
<p>{correctText}</p>
|
|
149
128
|
</div>
|
|
150
129
|
)}
|
|
151
130
|
</GrammarContent>
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import React, { useContext, useEffect, useState } from "react";
|
|
2
|
-
import constants
|
|
3
|
-
aiWordSample,
|
|
4
|
-
sampleResponse,
|
|
5
|
-
sampleResponseAudio,
|
|
6
|
-
} from "./contants";
|
|
2
|
+
import constants from "./contants";
|
|
7
3
|
|
|
8
4
|
import ArrowLeft from "../../../assets/svg/arrowLeft";
|
|
9
5
|
import YellowPen from "../../../assets/svg/yellow-pen";
|
|
@@ -16,10 +12,10 @@ import {
|
|
|
16
12
|
ScoreRight,
|
|
17
13
|
QuestionContent,
|
|
18
14
|
QuestionTitle,
|
|
19
|
-
QuestionFooter,
|
|
15
|
+
// QuestionFooter,
|
|
20
16
|
} from "./style";
|
|
21
17
|
import Comment from "./components/comment";
|
|
22
|
-
import ButtonComponent from "../../button";
|
|
18
|
+
// import ButtonComponent from "../../button";
|
|
23
19
|
import EssayWritten from "./questions/essayWritten";
|
|
24
20
|
import EssayScripted from "./questions/essayScripted";
|
|
25
21
|
import EssayUnscripted from "./questions/essayUnscripted";
|
|
@@ -296,12 +292,12 @@ const ReportQuestions = ({
|
|
|
296
292
|
accountType === "instructor-affiliate"
|
|
297
293
|
}
|
|
298
294
|
/>
|
|
299
|
-
{(accountType === "instructor-personal" ||
|
|
295
|
+
{/* {(accountType === "instructor-personal" ||
|
|
300
296
|
accountType === "instructor-affiliate") && (
|
|
301
297
|
<QuestionFooter>
|
|
302
298
|
<ButtonComponent text="Save" onClick={onClose} />
|
|
303
299
|
</QuestionFooter>
|
|
304
|
-
)}
|
|
300
|
+
)} */}
|
|
305
301
|
</Content>
|
|
306
302
|
</Container>
|
|
307
303
|
);
|