l-min-components 1.7.1585 → 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "l-min-components",
3
- "version": "1.7.1585",
3
+ "version": "1.7.1587",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -721,6 +721,24 @@ const getQuestionInfo = (question) => {
721
721
 
722
722
  return { type, data: question };
723
723
  };
724
+ const quizWrittenSelectedModel = (response, aiData) => {
725
+ if (!response || !aiData) return null;
726
+ const index = response?.index || 0;
727
+ const objectData = {};
728
+
729
+ if (aiData?.grammar?.[index] && aiData?.grammar?.length) {
730
+ const findData = aiData?.grammar?.[index];
731
+ objectData["grammar"] = [findData];
732
+ }
733
+ if (
734
+ aiData?.comprehension?.length &&
735
+ aiData?.comprehension?.[0] &&
736
+ index === 0
737
+ ) {
738
+ objectData["comprehension"] = aiData?.comprehension;
739
+ }
740
+ return objectData;
741
+ };
724
742
 
725
743
  const useReportUtils = () => {
726
744
  return {
@@ -741,6 +759,7 @@ const useReportUtils = () => {
741
759
  grammarFindOperation,
742
760
  toRGBA,
743
761
  getQuestionInfo,
762
+ quizWrittenSelectedModel,
744
763
  };
745
764
  };
746
765
 
@@ -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,9 +1,14 @@
1
1
  import React, { useState } from "react";
2
- import { QuestionSection } from "../style";
2
+ import {
3
+ QuestionSection,
4
+ QuestionSectionAction,
5
+ QuestionSectionWithAnalysis,
6
+ } from "../style";
3
7
  import Tabs from "../components/tabs";
4
8
  import useReportUtils from "../../hooks/useRreportUtils";
5
9
  import Response from "../components/response";
6
10
  import QuestionDropdown from "../components/questionDropdown";
11
+ import AnalysisButton from "../components/analysisButton";
7
12
 
8
13
  const QuizNewWritten = ({
9
14
  data,
@@ -46,6 +51,20 @@ const QuizNewWritten = ({
46
51
  </>
47
52
  </QuestionDropdown>
48
53
  <Response response={selectedResponse?.text} isPersonal={isPersonal} />
54
+
55
+ <QuestionSectionWithAnalysis>
56
+ <QuestionSectionAction>
57
+ <AnalysisButton
58
+ // disabled={!(analysis?.models?.length > 0)}
59
+ // onClick={() => {
60
+ // setToggle({
61
+ // ...analysis,
62
+ // defaultSelected: selected,
63
+ // });
64
+ // }}
65
+ />
66
+ </QuestionSectionAction>
67
+ </QuestionSectionWithAnalysis>
49
68
  </QuestionSection>
50
69
  </>
51
70
  );