l-min-components 1.7.1580 → 1.7.1582

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.1580",
3
+ "version": "1.7.1582",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -54,7 +54,13 @@ const quizResponses = ({ responses = [], type = "scripted" }) => {
54
54
  recording: response,
55
55
  };
56
56
  }
57
-
57
+ if (type === "written") {
58
+ return {
59
+ key: index + 1,
60
+ index: index,
61
+ text: response,
62
+ };
63
+ }
58
64
  return {
59
65
  key: index + 1,
60
66
  text: response?.text,
@@ -1,29 +1,29 @@
1
- import React, { useEffect, useState } from "react";
1
+ // import React, { useEffect, useState } from "react";
2
2
  import {
3
3
  QuestionSection,
4
- QuestionSectionAction,
5
- QuestionSectionWithAnalysis,
4
+ // QuestionSectionAction,
5
+ // QuestionSectionWithAnalysis,
6
6
  } from "../style.jsx";
7
7
  import Tabs from "../components/tabs.jsx";
8
8
  import useReportUtils from "../../hooks/useRreportUtils.jsx";
9
- import Response from "../components/response.jsx";
10
- import AnalysisButton from "../components/analysisButton.jsx";
11
- import QuestionDropdown from "../components/questionDropdown.jsx";
12
- import QuizQuestion from "../components/quizQuestion.jsx";
9
+ // import Response from "../components/response.jsx";
10
+ // import AnalysisButton from "../components/analysisButton.jsx";
11
+ // import QuestionDropdown from "../components/questionDropdown.jsx";
12
+ // import QuizQuestion from "../components/quizQuestion.jsx";
13
13
 
14
- import useTranslation from "../../../../hooks/useTranslation.jsx";
15
- import wordStore from "../../../../mc/wordStore.json";
14
+ // import useTranslation from "../../../../hooks/useTranslation.jsx";
15
+ // import wordStore from "../../../../mc/wordStore.json";
16
16
  const QuizWritten = ({
17
- data,
18
- aiData,
19
- setToggle,
17
+ // data,
18
+ // aiData,
19
+ // setToggle,
20
20
  answerData,
21
- isPersonal,
22
- defaultSelected = 1,
21
+ // isPersonal,
22
+ // defaultSelected = 1,
23
23
  }) => {
24
- const { findText } = useTranslation(wordStore);
25
- const [selected, setSelected] = useState(defaultSelected);
26
- const [analysis, setAnalysis] = useState(null);
24
+ // const { findText } = useTranslation(wordStore);
25
+ // const [selected, setSelected] = useState(defaultSelected);
26
+ // const [analysis, setAnalysis] = useState(null);
27
27
  const { quizResponses } = useReportUtils();
28
28
  const quizList = quizResponses({
29
29
  responses: answerData?.answer?.data?.data?.responses,
@@ -34,58 +34,67 @@ 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
 
42
- useEffect(() => {
43
- if (selectedResponse) {
44
- // const models = setupAnalysis(selectedModel, null, data?.ai_score);
45
- // setAnalysis(models);
46
- }
47
- }, [selectedResponse?.key]);
42
+ // useEffect(() => {
43
+ // if (selectedResponse) {
44
+ // // const models = setupAnalysis(selectedModel, null, data?.ai_score);
45
+ // // setAnalysis(models);
46
+ // }
47
+ // }, [selectedResponse?.key]);
48
48
  return (
49
- <QuestionSection>
50
- <Tabs
51
- options={selectionList}
52
- selected={selected}
53
- onChange={setSelected}
54
- />
55
- <QuestionDropdown>
56
- <>
57
- <li>
58
- <h3>{findText("Instruction")}</h3>
59
- <p>{data?.question_data?.instruction}</p>
60
- </li>
61
- <li>
62
- <QuizQuestion data={data} />
63
- </li>
64
- <li>
65
- <h3>{findText("Qyestion")}</h3>
66
- <p>{data?.question_data?.question_data?.question}</p>
67
- </li>
68
- </>
69
- </QuestionDropdown>
49
+ // <QuestionSection>
50
+ // <Tabs
51
+ // options={selectionList}
52
+ // selected={selected}
53
+ // onChange={setSelected}
54
+ // />
55
+ // <QuestionDropdown>
56
+ // <>
57
+ // <li>
58
+ // <h3>{findText("Instruction")}</h3>
59
+ // <p>{data?.question_data?.instruction}</p>
60
+ // </li>
61
+ // <li>
62
+ // <QuizQuestion data={data} />
63
+ // </li>
64
+ // <li>
65
+ // <h3>{findText("Qyestion")}</h3>
66
+ // <p>{data?.question_data?.question_data?.question}</p>
67
+ // </li>
68
+ // </>
69
+ // </QuestionDropdown>
70
70
 
71
- <Response response={selectedResponse?.text} isPersonal={isPersonal} />
71
+ // <Response response={selectedResponse?.text} isPersonal={isPersonal} />
72
72
 
73
- <QuestionSectionWithAnalysis>
74
- <QuestionSectionAction>
75
- {analysis?.models?.length > 0 && (
76
- <AnalysisButton
77
- disabled={!(analysis?.models?.length > 0)}
78
- onClick={() => {
79
- setToggle({
80
- ...analysis,
81
- defaultSelected: selected,
82
- });
83
- }}
84
- />
85
- )}
86
- </QuestionSectionAction>
87
- </QuestionSectionWithAnalysis>
88
- </QuestionSection>
73
+ // <QuestionSectionWithAnalysis>
74
+ // <QuestionSectionAction>
75
+ // {analysis?.models?.length > 0 && (
76
+ // <AnalysisButton
77
+ // disabled={!(analysis?.models?.length > 0)}
78
+ // onClick={() => {
79
+ // setToggle({
80
+ // ...analysis,
81
+ // defaultSelected: selected,
82
+ // });
83
+ // }}
84
+ // />
85
+ // )}
86
+ // </QuestionSectionAction>
87
+ // </QuestionSectionWithAnalysis>
88
+ // </QuestionSection>
89
+ <>
90
+ <QuestionSection>
91
+ <Tabs
92
+ options={selectionList}
93
+ selected={selected}
94
+ onChange={setSelected}
95
+ />
96
+ </QuestionSection>
97
+ </>
89
98
  );
90
99
  };
91
100
  export default QuizWritten;