l-min-components 1.7.1574 → 1.7.1576

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.1574",
3
+ "version": "1.7.1576",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -54,14 +54,6 @@ const quizResponses = ({ responses = [], type = "scripted" }) => {
54
54
  recording: response,
55
55
  };
56
56
  }
57
-
58
- if (type === "written") {
59
- return {
60
- key: index + 1,
61
- index,
62
- text: response,
63
- };
64
- }
65
57
  return {
66
58
  key: index + 1,
67
59
  text: response?.text,
@@ -433,25 +425,6 @@ const setupAnalysis = (data, audioData, score) => {
433
425
  };
434
426
  };
435
427
 
436
- const quizWrittenSelectedModel = (response, aiData) => {
437
- if (!response || !aiData) return null;
438
- const index = response?.index || 0;
439
- const objectData = {};
440
-
441
- if (aiData?.grammar?.[index] && aiData?.grammar?.length) {
442
- const findData = aiData?.grammar?.[index];
443
- objectData["grammar"] = [findData];
444
- }
445
- if (
446
- aiData?.comprehension?.length &&
447
- aiData?.comprehension?.[0] &&
448
- index === 0
449
- ) {
450
- objectData["comprehension"] = aiData?.comprehension;
451
- }
452
- return objectData;
453
- };
454
-
455
428
  const quixSelectedModel = (response, aiData) => {
456
429
  if (!response || !aiData) return null;
457
430
 
@@ -474,13 +447,6 @@ const quixSelectedModel = (response, aiData) => {
474
447
  );
475
448
  objectData["grammar"] = [findData];
476
449
  }
477
- if (aiData?.comprehension?.length && aiData?.comprehension) {
478
- const attemptResp = aiData?.comprehension?.[0]?.attempt_data_batch?.[0];
479
-
480
- if (attemptResp?.recording?.id === audioId || attemptResp?.id === audioId) {
481
- objectData["comprehension"] = aiData?.comprehension;
482
- }
483
- }
484
450
 
485
451
  return objectData;
486
452
  };
@@ -726,15 +692,10 @@ const getQuestionInfo = (question) => {
726
692
  type = "word-play-multiple-choice";
727
693
  else type = "word-play-text";
728
694
  } else if (question?.type === "QUIZ") {
729
- if (
730
- question?.question_data?.question_data?.type === "MultipleChoice" ||
731
- question?.question_data?.question_data?.type === "Multiple Choice"
732
- )
695
+ if (question?.question_data?.question_data?.type === "MultipleChoice")
733
696
  type = "quiz-multiple-choice";
734
697
  else if (question?.question_data?.question_data?.type === "UnScripted")
735
698
  type = "quiz-unscripted";
736
- else if (question?.question_data?.question_data?.type === "Written")
737
- type = "quiz-written";
738
699
  else type = "quiz-scripted";
739
700
  } else if (question?.type === "ESSAY") {
740
701
  if (question?.question_data?.config?.type === "Scripted")
@@ -768,7 +729,6 @@ const useReportUtils = () => {
768
729
  grammarFindOperation,
769
730
  toRGBA,
770
731
  getQuestionInfo,
771
- quizWrittenSelectedModel,
772
732
  };
773
733
  };
774
734
 
@@ -62,7 +62,6 @@ import { NavBack, NavForword } from "../fullAnalysis/icons/navArrow";
62
62
  */
63
63
  import useTranslation from "../../../hooks/useTranslation.jsx";
64
64
  import wordStore from "../../../mc/wordStore.json";
65
- import QuizWritten from "./questions/quizWritten";
66
65
  const ReportQuestions = ({
67
66
  accountType,
68
67
  AiData,
@@ -386,17 +385,6 @@ const ReportQuestions = ({
386
385
  defaultSelected={defaultSelected}
387
386
  />
388
387
  )}
389
-
390
- {questionType === "quiz-written" && (
391
- <QuizWritten
392
- data={findedQuestion}
393
- answerData={answerData}
394
- aiData={AiData}
395
- setToggle={setToggle}
396
- isPersonal={isPersonal}
397
- defaultSelected={defaultSelected}
398
- />
399
- )}
400
388
  {questionType === "quiz-multiple-choice" && (
401
389
  <QuizMultipleChoice
402
390
  data={findedQuestion}
@@ -1,92 +0,0 @@
1
- import React, { useEffect, useState } from "react";
2
- import {
3
- QuestionSection,
4
- QuestionSectionAction,
5
- QuestionSectionWithAnalysis,
6
- } from "../style.jsx";
7
- import Tabs from "../components/tabs.jsx";
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";
13
-
14
- import useTranslation from "../../../../hooks/useTranslation.jsx";
15
- import wordStore from "../../../../mc/wordStore.json";
16
- const QuizWritten = ({
17
- data,
18
- aiData,
19
- setToggle,
20
- answerData,
21
- isPersonal,
22
- defaultSelected = 1,
23
- }) => {
24
- const { findText } = useTranslation(wordStore);
25
- const [selected, setSelected] = useState(defaultSelected);
26
- const [analysis, setAnalysis] = useState(null);
27
- const { quizResponses, setupAnalysis, quizWrittenSelectedModel } =
28
- useReportUtils();
29
- const quizList = quizResponses({
30
- responses: answerData?.answer?.data?.data?.responses,
31
- type: "written",
32
- });
33
-
34
- const selectionList = quizList?.map((item) => ({
35
- value: item?.key,
36
- label: `Reponses ${item?.key}`,
37
- }));
38
- const selectedResponse =
39
- 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
- return (
50
- <QuestionSection>
51
- <Tabs
52
- options={selectionList}
53
- selected={selected}
54
- onChange={setSelected}
55
- />
56
- <QuestionDropdown>
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("Qyestion")}</h3>
67
- <p>{data?.question_data?.question_data?.question}</p>
68
- </li>
69
- </>
70
- </QuestionDropdown>
71
-
72
- <Response response={selectedResponse?.text} isPersonal={isPersonal} />
73
-
74
- <QuestionSectionWithAnalysis>
75
- <QuestionSectionAction>
76
- {analysis?.models?.length > 0 && (
77
- <AnalysisButton
78
- disabled={!(analysis?.models?.length > 0)}
79
- onClick={() => {
80
- setToggle({
81
- ...analysis,
82
- defaultSelected: selected,
83
- });
84
- }}
85
- />
86
- )}
87
- </QuestionSectionAction>
88
- </QuestionSectionWithAnalysis>
89
- </QuestionSection>
90
- );
91
- };
92
- export default QuizWritten;