l-min-components 1.7.1584 → 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.1584",
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;