l-min-components 1.7.1569 → 1.7.1571
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/Comprehension.jsx +47 -0
- package/src/components/reportsComponents/fullAnalysis/index.jsx +4 -0
- package/src/components/reportsComponents/fullAnalysis/style.jsx +59 -0
- package/src/components/reportsComponents/reportQuestions/index.jsx +37 -8
package/package.json
CHANGED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
ComprehensionContainer,
|
|
4
|
+
ComprehensionContainerResponse,
|
|
5
|
+
ComprehensionFeekback,
|
|
6
|
+
} from "../style";
|
|
7
|
+
|
|
8
|
+
const FeekbackResponsive = ({ title, content, color = "#00C2C2" }) => {
|
|
9
|
+
return (
|
|
10
|
+
<ComprehensionFeekback>
|
|
11
|
+
<h3 style={{ color }}>{title}</h3>
|
|
12
|
+
<p>{content}</p>
|
|
13
|
+
</ComprehensionFeekback>
|
|
14
|
+
);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const Comprehension = ({ Aidata }) => {
|
|
18
|
+
const model = Aidata?.data;
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<ComprehensionContainer>
|
|
22
|
+
<li>
|
|
23
|
+
<ComprehensionContainerResponse>
|
|
24
|
+
<p>Student response</p>
|
|
25
|
+
<div>
|
|
26
|
+
<p>{model?.studentTextAnswers?.[0] || Aidata?.responseText}</p>
|
|
27
|
+
</div>
|
|
28
|
+
</ComprehensionContainerResponse>
|
|
29
|
+
</li>
|
|
30
|
+
<li>
|
|
31
|
+
<FeekbackResponsive
|
|
32
|
+
title="Correct answer"
|
|
33
|
+
content={model?.model_data?.generate?.answers?.[0]?.answer}
|
|
34
|
+
/>
|
|
35
|
+
</li>
|
|
36
|
+
<li>
|
|
37
|
+
<FeekbackResponsive
|
|
38
|
+
title="Feekback"
|
|
39
|
+
color="#30D468"
|
|
40
|
+
content={model?.model_data?.evaluate?.results?.[0]?.feedback}
|
|
41
|
+
/>
|
|
42
|
+
</li>
|
|
43
|
+
</ComprehensionContainer>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export default Comprehension;
|
|
@@ -24,6 +24,7 @@ import useReportUtils from "../hooks/useRreportUtils";
|
|
|
24
24
|
import GrammarV2 from "./components/Grammar.v2";
|
|
25
25
|
import useTranslation from "../../../hooks/useTranslation.jsx";
|
|
26
26
|
import wordStore from "../../../mc/wordStore.json";
|
|
27
|
+
import Comprehension from "./components/Comprehension.jsx";
|
|
27
28
|
const FullAnalysis = ({ data, onClose, accountType }) => {
|
|
28
29
|
const { findText } = useTranslation(wordStore);
|
|
29
30
|
const { setRightLayout, setCenterLayoutStyle } = useContext(OutletContext);
|
|
@@ -241,6 +242,9 @@ const FullAnalysis = ({ data, onClose, accountType }) => {
|
|
|
241
242
|
setCheckingPlayingAudio={setCheckingPlayingAudio}
|
|
242
243
|
/>
|
|
243
244
|
)}
|
|
245
|
+
{selectedModel?.id === "comprehension" && (
|
|
246
|
+
<Comprehension Aidata={selectedModel} />
|
|
247
|
+
)}
|
|
244
248
|
{selectedModel?.id === "grammar" && (
|
|
245
249
|
<>
|
|
246
250
|
{selectedModel?.version === 2 ? (
|
|
@@ -720,3 +720,62 @@ export const GrammarV2FeedbackList = styled.ul`
|
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
722
|
`;
|
|
723
|
+
|
|
724
|
+
export const ComprehensionContainer = styled.ul`
|
|
725
|
+
border-radius: 32px;
|
|
726
|
+
background: #fff;
|
|
727
|
+
padding: 20px;
|
|
728
|
+
list-style: none;
|
|
729
|
+
display: flex;
|
|
730
|
+
flex-direction: column;
|
|
731
|
+
width: 100%;
|
|
732
|
+
gap: 15px;
|
|
733
|
+
li {
|
|
734
|
+
border-bottom: 1px solid #dfe5e5;
|
|
735
|
+
|
|
736
|
+
padding-bottom: 15px;
|
|
737
|
+
&:last-child {
|
|
738
|
+
border-bottom: transparent;
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
`;
|
|
742
|
+
|
|
743
|
+
export const ComprehensionContainerResponse = styled.div`
|
|
744
|
+
display: flex;
|
|
745
|
+
flex-direction: column;
|
|
746
|
+
width: 100%;
|
|
747
|
+
gap: 10px;
|
|
748
|
+
padding-bottom: 5px;
|
|
749
|
+
> p {
|
|
750
|
+
color: #636666;
|
|
751
|
+
font-size: 14px;
|
|
752
|
+
line-height: 24px;
|
|
753
|
+
}
|
|
754
|
+
> div {
|
|
755
|
+
border-radius: 24px;
|
|
756
|
+
background: #f5f7f7;
|
|
757
|
+
min-height: 150px;
|
|
758
|
+
padding: 10px;
|
|
759
|
+
> p {
|
|
760
|
+
color: #4a4d4d;
|
|
761
|
+
|
|
762
|
+
font-size: 16px;
|
|
763
|
+
line-height: 25px;
|
|
764
|
+
&::first-letter {
|
|
765
|
+
text-transform: capitalize;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
`;
|
|
770
|
+
|
|
771
|
+
export const ComprehensionFeekback = styled.div`
|
|
772
|
+
h3 {
|
|
773
|
+
font-size: 16px;
|
|
774
|
+
font-weight: 600;
|
|
775
|
+
margin-bottom: 10px;
|
|
776
|
+
}
|
|
777
|
+
p {
|
|
778
|
+
color: #4a4d4d;
|
|
779
|
+
font-size: 14px;
|
|
780
|
+
}
|
|
781
|
+
`;
|
|
@@ -57,6 +57,7 @@ import { NavBack, NavForword } from "../fullAnalysis/icons/navArrow";
|
|
|
57
57
|
* @param {string} props.testId
|
|
58
58
|
* @param {Array} props.questions
|
|
59
59
|
* @param {string} props.questionActivityID
|
|
60
|
+
* @param {object} props.navControl
|
|
60
61
|
* @returns {React.ReactNode}
|
|
61
62
|
*/
|
|
62
63
|
import useTranslation from "../../../hooks/useTranslation.jsx";
|
|
@@ -72,6 +73,13 @@ const ReportQuestions = ({
|
|
|
72
73
|
onSwitchQuestion,
|
|
73
74
|
loading,
|
|
74
75
|
mainTitle,
|
|
76
|
+
navControl = {
|
|
77
|
+
on: false,
|
|
78
|
+
disablePrev: false,
|
|
79
|
+
disableNext: false,
|
|
80
|
+
onNext: () => {},
|
|
81
|
+
onPrev: () => {},
|
|
82
|
+
},
|
|
75
83
|
}) => {
|
|
76
84
|
const { findText } = useTranslation(wordStore);
|
|
77
85
|
const [questionList, setQuestionList] = useState([]);
|
|
@@ -251,14 +259,35 @@ const ReportQuestions = ({
|
|
|
251
259
|
<InfoIcon2 />
|
|
252
260
|
</ScoreHeader>
|
|
253
261
|
<QuestionNav>
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
+
{navControl?.on ? (
|
|
263
|
+
<>
|
|
264
|
+
<button
|
|
265
|
+
disabled={navControl.disablePrev}
|
|
266
|
+
onClick={navControl.onPrev}
|
|
267
|
+
>
|
|
268
|
+
<NavBack disabled={navControl.disablePrev} />
|
|
269
|
+
{findText("Previous question")}
|
|
270
|
+
</button>
|
|
271
|
+
<button
|
|
272
|
+
disabled={navControl.disableNext}
|
|
273
|
+
onClick={navControl.onNext}
|
|
274
|
+
>
|
|
275
|
+
{findText("Next question")}
|
|
276
|
+
<NavForword disabled={navControl.disableNext} />
|
|
277
|
+
</button>
|
|
278
|
+
</>
|
|
279
|
+
) : (
|
|
280
|
+
<>
|
|
281
|
+
<button disabled={!prevId} onClick={handlePrev}>
|
|
282
|
+
<NavBack disabled={!prevId} />
|
|
283
|
+
{findText("Previous question")}
|
|
284
|
+
</button>
|
|
285
|
+
<button disabled={!nextId} onClick={handleNext}>
|
|
286
|
+
{findText("Next question")}
|
|
287
|
+
<NavForword disabled={!nextId} />
|
|
288
|
+
</button>
|
|
289
|
+
</>
|
|
290
|
+
)}
|
|
262
291
|
</QuestionNav>
|
|
263
292
|
</ScoreHeaderContainer>
|
|
264
293
|
{/* {data && !hasAnswer && <ErrorHeader />} */}
|