l-min-components 1.7.1586 → 1.7.1587
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
|
@@ -46,22 +46,6 @@ import useTranslation from "../../../hooks/useTranslation.jsx";
|
|
|
46
46
|
import wordStore from "../../../mc/wordStore.json";
|
|
47
47
|
import QuizNewWritten from "./questions/quizNewWritten.jsx";
|
|
48
48
|
|
|
49
|
-
/**
|
|
50
|
-
* @param {Object} props
|
|
51
|
-
|
|
52
|
-
* @param {"personal" | "enterprise" | "instructor-personal" | "instructor-affiliate"} props.accountType
|
|
53
|
-
* @param {Object} props.data
|
|
54
|
-
* @param {Object} props.answerData
|
|
55
|
-
* @param {Object} props.AiData
|
|
56
|
-
* @param {Function} props.onClose
|
|
57
|
-
* @param {Function} props.onSwitchQuestion
|
|
58
|
-
* @param {string} props.testId
|
|
59
|
-
* @param {Array} props.questions
|
|
60
|
-
* @param {string} props.questionActivityID
|
|
61
|
-
* @param {object} props.navControl
|
|
62
|
-
* @returns {React.ReactNode}
|
|
63
|
-
*/
|
|
64
|
-
|
|
65
49
|
const ReportQuestions = ({
|
|
66
50
|
accountType,
|
|
67
51
|
AiData,
|
|
@@ -1,92 +1,73 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useState } from "react";
|
|
2
2
|
import {
|
|
3
3
|
QuestionSection,
|
|
4
4
|
QuestionSectionAction,
|
|
5
5
|
QuestionSectionWithAnalysis,
|
|
6
|
-
} from "../style
|
|
7
|
-
import Tabs from "../components/tabs
|
|
8
|
-
import useReportUtils from "../../hooks/useRreportUtils
|
|
9
|
-
import Response from "../components/response
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import QuizQuestion from "../components/quizQuestion.jsx";
|
|
6
|
+
} from "../style";
|
|
7
|
+
import Tabs from "../components/tabs";
|
|
8
|
+
import useReportUtils from "../../hooks/useRreportUtils";
|
|
9
|
+
import Response from "../components/response";
|
|
10
|
+
import QuestionDropdown from "../components/questionDropdown";
|
|
11
|
+
import AnalysisButton from "../components/analysisButton";
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
import wordStore from "../../../../mc/wordStore.json";
|
|
16
|
-
const QuizWritten = ({
|
|
13
|
+
const QuizNewWritten = ({
|
|
17
14
|
data,
|
|
18
15
|
aiData,
|
|
19
|
-
setToggle,
|
|
20
16
|
answerData,
|
|
21
17
|
isPersonal,
|
|
22
18
|
defaultSelected = 1,
|
|
23
19
|
}) => {
|
|
24
|
-
const { findText } = useTranslation(wordStore);
|
|
25
20
|
const [selected, setSelected] = useState(defaultSelected);
|
|
26
|
-
const
|
|
27
|
-
const { quizResponses, setupAnalysis, quizWrittenSelectedModel } =
|
|
28
|
-
useReportUtils();
|
|
21
|
+
const { quizResponses } = useReportUtils();
|
|
29
22
|
const quizList = quizResponses({
|
|
30
23
|
responses: answerData?.answer?.data?.data?.responses,
|
|
31
24
|
type: "written",
|
|
32
25
|
});
|
|
33
|
-
|
|
34
26
|
const selectionList = quizList?.map((item) => ({
|
|
35
27
|
value: item?.key,
|
|
36
28
|
label: `Reponses ${item?.key}`,
|
|
37
29
|
}));
|
|
38
30
|
const selectedResponse =
|
|
39
31
|
quizList?.find((item) => item?.key === selected) || {};
|
|
40
|
-
|
|
41
|
-
const selectedModel = quizWrittenSelectedModel(selectedResponse, aiData);
|
|
42
|
-
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
if (selectedResponse) {
|
|
45
|
-
const models = setupAnalysis(selectedModel, null, data?.ai_score);
|
|
46
|
-
setAnalysis(models);
|
|
47
|
-
}
|
|
48
|
-
}, [selectedResponse?.key]);
|
|
49
32
|
return (
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<>
|
|
58
|
-
<li>
|
|
59
|
-
<h3>{findText("Instruction")}</h3>
|
|
60
|
-
<p>{data?.question_data?.instruction}</p>
|
|
61
|
-
</li>
|
|
62
|
-
<li>
|
|
63
|
-
<QuizQuestion data={data} />
|
|
64
|
-
</li>
|
|
65
|
-
<li>
|
|
66
|
-
<h3>{findText("Question")}</h3>
|
|
67
|
-
<p>{data?.question_data?.question_data?.question}</p>
|
|
68
|
-
</li>
|
|
69
|
-
</>
|
|
70
|
-
</QuestionDropdown>
|
|
33
|
+
<>
|
|
34
|
+
<QuestionSection>
|
|
35
|
+
<Tabs
|
|
36
|
+
options={selectionList}
|
|
37
|
+
selected={selected}
|
|
38
|
+
onChange={setSelected}
|
|
39
|
+
/>
|
|
71
40
|
|
|
72
|
-
|
|
41
|
+
<QuestionDropdown>
|
|
42
|
+
<>
|
|
43
|
+
<li>
|
|
44
|
+
<h3>{"Instruction"}</h3>
|
|
45
|
+
<p>{data?.question_data?.instruction}</p>
|
|
46
|
+
</li>
|
|
47
|
+
<li>
|
|
48
|
+
<h3>{"Essay topic"}</h3>
|
|
49
|
+
<p>{data?.question_data?.question_title}</p>
|
|
50
|
+
</li>
|
|
51
|
+
</>
|
|
52
|
+
</QuestionDropdown>
|
|
53
|
+
<Response response={selectedResponse?.text} isPersonal={isPersonal} />
|
|
73
54
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
{analysis?.models?.length > 0 && (
|
|
55
|
+
<QuestionSectionWithAnalysis>
|
|
56
|
+
<QuestionSectionAction>
|
|
77
57
|
<AnalysisButton
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
58
|
+
// disabled={!(analysis?.models?.length > 0)}
|
|
59
|
+
// onClick={() => {
|
|
60
|
+
// setToggle({
|
|
61
|
+
// ...analysis,
|
|
62
|
+
// defaultSelected: selected,
|
|
63
|
+
// });
|
|
64
|
+
// }}
|
|
85
65
|
/>
|
|
86
|
-
|
|
87
|
-
</
|
|
88
|
-
</
|
|
89
|
-
|
|
66
|
+
</QuestionSectionAction>
|
|
67
|
+
</QuestionSectionWithAnalysis>
|
|
68
|
+
</QuestionSection>
|
|
69
|
+
</>
|
|
90
70
|
);
|
|
91
71
|
};
|
|
92
|
-
|
|
72
|
+
|
|
73
|
+
export default QuizNewWritten;
|