l-min-components 1.7.1429 → 1.7.1431
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 +2 -1
- package/src/components/reportsComponents/fullAnalysis/components/Grammar.jsx +14 -34
- package/src/components/reportsComponents/fullAnalysis/index.jsx +1 -1
- package/src/components/reportsComponents/reportQuestions/components/modals/gradingModal.jsx +1 -2
- package/src/components/reportsComponents/reportQuestions/index.jsx +6 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "l-min-components",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.1431",
|
|
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,31 @@ 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));
|
|
30
|
+
|
|
26
31
|
const originalText = data?.["Original Speech"] || "";
|
|
27
32
|
const correctText = data?.["Grammatical Correct Version"] || "";
|
|
28
33
|
const feedbacks = data?.["Feedback"];
|
|
29
|
-
|
|
34
|
+
|
|
35
|
+
const { grammarFeekbackResult } = useReportUtils();
|
|
30
36
|
|
|
31
37
|
const wordsFeedback = grammarFeekbackResult(
|
|
32
38
|
originalText,
|
|
33
39
|
feedbackCorrection,
|
|
34
|
-
feedbacks
|
|
35
|
-
correctText
|
|
40
|
+
feedbacks
|
|
36
41
|
);
|
|
37
42
|
|
|
38
|
-
const sentenceParts = renderCorrectedSentence(wordsFeedback);
|
|
39
|
-
|
|
40
43
|
useEffect(() => {
|
|
41
44
|
if (wordsFeedback?.length) {
|
|
42
45
|
const findWord = wordsFeedback?.find((word) => word?.operation);
|
|
@@ -49,7 +52,7 @@ const Grammar = ({ Aidata }) => {
|
|
|
49
52
|
{ label: "Feedback", value: 1, icon: ChatIcon },
|
|
50
53
|
{ label: "View script", value: 2, icon: AIcon },
|
|
51
54
|
{ label: "Corrected version", value: 3, icon: MarsIcon },
|
|
52
|
-
];
|
|
55
|
+
].filter((item) => !(item?.value === 3 && Aidata?.score >= 100));
|
|
53
56
|
|
|
54
57
|
return (
|
|
55
58
|
<ModelComtainer>
|
|
@@ -113,39 +116,16 @@ const Grammar = ({ Aidata }) => {
|
|
|
113
116
|
<GoodCheck />
|
|
114
117
|
<span>{selectedWord?.correct}</span>
|
|
115
118
|
</div>
|
|
116
|
-
<p>{selectedWord?.feedback}</p>
|
|
117
119
|
</div>
|
|
118
120
|
)}
|
|
119
121
|
{selectedSection === 2 && originalText && <p>{originalText}</p>}
|
|
120
122
|
{selectedSection === 3 && (
|
|
121
123
|
<div className="correct_section">
|
|
122
|
-
<div className="warning">
|
|
124
|
+
{/* <div className="warning">
|
|
123
125
|
<WarningGrey />
|
|
124
126
|
<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>
|
|
127
|
+
</div> */}
|
|
128
|
+
<p>{correctText}</p>
|
|
149
129
|
</div>
|
|
150
130
|
)}
|
|
151
131
|
</GrammarContent>
|
|
@@ -153,7 +153,7 @@ const FullAnalysis = ({ data, onClose, accountType }) => {
|
|
|
153
153
|
className="progress-section"
|
|
154
154
|
>
|
|
155
155
|
<span style={{ color: model?.primaryColor }}>
|
|
156
|
-
{model?.score || 0}%
|
|
156
|
+
{Math.floor(model?.score) || 0}%
|
|
157
157
|
</span>
|
|
158
158
|
<Progress.Line
|
|
159
159
|
percent={model?.score || 0}
|
|
@@ -17,7 +17,6 @@ const GradingModal = ({
|
|
|
17
17
|
const [value, setValue] = useState(defaultScore || "");
|
|
18
18
|
|
|
19
19
|
const numberValue = parseFloat(value || 0);
|
|
20
|
-
const disable = selected === "manually" && (numberValue > 100 || !value);
|
|
21
20
|
|
|
22
21
|
const isNumbter = parseFloat(aiValue) || 0;
|
|
23
22
|
const isSuggestionNumber = parseFloat(suggestionValue) || 0;
|
|
@@ -111,7 +110,7 @@ const GradingModal = ({
|
|
|
111
110
|
</TopSection>
|
|
112
111
|
<ButtonComponent
|
|
113
112
|
text="Save score"
|
|
114
|
-
disabled={disable}
|
|
113
|
+
// disabled={disable}
|
|
115
114
|
onClick={handleSetValue}
|
|
116
115
|
/>
|
|
117
116
|
</Content>
|
|
@@ -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";
|
|
@@ -132,7 +128,7 @@ const ReportQuestions = ({
|
|
|
132
128
|
{toggleGrade && (
|
|
133
129
|
<GradingModal
|
|
134
130
|
aiValue={formatNumber(data?.ai_score)}
|
|
135
|
-
suggestionValue={formatNumber(
|
|
131
|
+
suggestionValue={formatNumber(data?.suggested_score)}
|
|
136
132
|
noAi={noAi}
|
|
137
133
|
setScore={handleScore}
|
|
138
134
|
defaultScore={formatNumber(intructorScore)}
|
|
@@ -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
|
);
|