l-min-components 1.7.1583 → 1.7.1585

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.1583",
3
+ "version": "1.7.1585",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -40,10 +40,11 @@ import useApi from "./api";
40
40
  import FullPageLoader from "../../fullPageLoader";
41
41
  import { ButtonComponent, OutletContext } from "../..";
42
42
  import useReportUtils from "../hooks/useRreportUtils";
43
- import ErrorHeader from "./components/errorHeader";
44
- import { InfoIcon } from "lucide-react";
45
43
  import InfoIcon2 from "../fullAnalysis/icons/info";
46
44
  import { NavBack, NavForword } from "../fullAnalysis/icons/navArrow";
45
+ import useTranslation from "../../../hooks/useTranslation.jsx";
46
+ import wordStore from "../../../mc/wordStore.json";
47
+ import QuizNewWritten from "./questions/quizNewWritten.jsx";
47
48
 
48
49
  /**
49
50
  * @param {Object} props
@@ -60,9 +61,7 @@ import { NavBack, NavForword } from "../fullAnalysis/icons/navArrow";
60
61
  * @param {object} props.navControl
61
62
  * @returns {React.ReactNode}
62
63
  */
63
- import useTranslation from "../../../hooks/useTranslation.jsx";
64
- import wordStore from "../../../mc/wordStore.json";
65
- import QuizWritten from "./questions/quizWritten.jsx";
64
+
66
65
  const ReportQuestions = ({
67
66
  accountType,
68
67
  AiData,
@@ -387,7 +386,7 @@ const ReportQuestions = ({
387
386
  />
388
387
  )}
389
388
  {questionType === "quiz-written" && (
390
- <QuizWritten
389
+ <QuizNewWritten
391
390
  data={findedQuestion}
392
391
  answerData={answerData}
393
392
  aiData={AiData}
@@ -0,0 +1,54 @@
1
+ import React, { useState } from "react";
2
+ import { QuestionSection } from "../style";
3
+ import Tabs from "../components/tabs";
4
+ import useReportUtils from "../../hooks/useRreportUtils";
5
+ import Response from "../components/response";
6
+ import QuestionDropdown from "../components/questionDropdown";
7
+
8
+ const QuizNewWritten = ({
9
+ data,
10
+ aiData,
11
+ answerData,
12
+ isPersonal,
13
+ defaultSelected = 1,
14
+ }) => {
15
+ const [selected, setSelected] = useState(defaultSelected);
16
+ const { quizResponses } = useReportUtils();
17
+ const quizList = quizResponses({
18
+ responses: answerData?.answer?.data?.data?.responses,
19
+ type: "written",
20
+ });
21
+ const selectionList = quizList?.map((item) => ({
22
+ value: item?.key,
23
+ label: `Reponses ${item?.key}`,
24
+ }));
25
+ const selectedResponse =
26
+ quizList?.find((item) => item?.key === selected) || {};
27
+ return (
28
+ <>
29
+ <QuestionSection>
30
+ <Tabs
31
+ options={selectionList}
32
+ selected={selected}
33
+ onChange={setSelected}
34
+ />
35
+
36
+ <QuestionDropdown>
37
+ <>
38
+ <li>
39
+ <h3>{"Instruction"}</h3>
40
+ <p>{data?.question_data?.instruction}</p>
41
+ </li>
42
+ <li>
43
+ <h3>{"Essay topic"}</h3>
44
+ <p>{data?.question_data?.question_title}</p>
45
+ </li>
46
+ </>
47
+ </QuestionDropdown>
48
+ <Response response={selectedResponse?.text} isPersonal={isPersonal} />
49
+ </QuestionSection>
50
+ </>
51
+ );
52
+ };
53
+
54
+ export default QuizNewWritten;
@@ -8,21 +8,21 @@ import Tabs from "../components/tabs.jsx";
8
8
  import useReportUtils from "../../hooks/useRreportUtils.jsx";
9
9
  // import Response from "../components/response.jsx";
10
10
  // import AnalysisButton from "../components/analysisButton.jsx";
11
- import QuestionDropdown from "../components/questionDropdown.jsx";
12
- import QuizQuestion from "../components/quizQuestion.jsx";
11
+ // import QuestionDropdown from "../components/questionDropdown.jsx";
12
+ // import QuizQuestion from "../components/quizQuestion.jsx";
13
13
 
14
14
  // import useTranslation from "../../../../hooks/useTranslation.jsx";
15
15
  // import wordStore from "../../../../mc/wordStore.json";
16
16
  const QuizWritten = ({
17
- data,
17
+ // data,
18
18
  // aiData,
19
19
  // setToggle,
20
20
  answerData,
21
- // isPersonal,
22
- // defaultSelected = 1,
21
+ isPersonal,
22
+ defaultSelected = 1,
23
23
  }) => {
24
24
  // const { findText } = useTranslation(wordStore);
25
- // const [selected, setSelected] = useState(defaultSelected);
25
+ const [selected, setSelected] = useState(defaultSelected);
26
26
  // const [analysis, setAnalysis] = useState(null);
27
27
  const { quizResponses } = useReportUtils();
28
28
  const quizList = quizResponses({
@@ -34,8 +34,8 @@ const QuizWritten = ({
34
34
  value: item?.key,
35
35
  label: `Reponses ${item?.key}`,
36
36
  }));
37
- // const selectedResponse =
38
- // quizList?.find((item) => item?.key === selected) || {};
37
+ const selectedResponse =
38
+ quizList?.find((item) => item?.key === selected) || {};
39
39
 
40
40
  // const selectedModel = quizWrittenSelectedModel(selectedResponse, aiData);
41
41
 
@@ -68,7 +68,7 @@ const QuizWritten = ({
68
68
  // </>
69
69
  // </QuestionDropdown>
70
70
 
71
- // <Response response={selectedResponse?.text} isPersonal={isPersonal} />
71
+ // <Response response={selectedResponse?.text} isPersonal={isPersonal} />
72
72
 
73
73
  // <QuestionSectionWithAnalysis>
74
74
  // <QuestionSectionAction>
@@ -93,22 +93,7 @@ const QuizWritten = ({
93
93
  selected={selected}
94
94
  onChange={setSelected}
95
95
  />
96
-
97
- <QuestionDropdown>
98
- <>
99
- <li>
100
- <h3>{"Instruction"}</h3>
101
- <p>{data?.question_data?.instruction}</p>
102
- </li>
103
- <li>
104
- <QuizQuestion data={data} />
105
- </li>
106
- <li>
107
- <h3>{"Question"}</h3>
108
- <p>{data?.question_data?.question_data?.question}</p>
109
- </li>
110
- </>
111
- </QuestionDropdown>
96
+ <Response response={selectedResponse?.text} isPersonal={isPersonal} />
112
97
  </QuestionSection>
113
98
  </>
114
99
  );