l-min-components 1.7.1434 → 1.7.1436

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.1434",
3
+ "version": "1.7.1436",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -15,11 +15,10 @@ import { useState } from "react";
15
15
  import GoodCheck from "../../../../assets/svg/goodCheck";
16
16
  import RedX from "../../../../assets/svg/redX";
17
17
  import DOMPurify from "dompurify";
18
- import useReportUtils from "../../hooks/useRreportUtils";
18
+ // import useReportUtils from "../../hooks/useRreportUtils";
19
19
 
20
20
  const Grammar = ({ Aidata }) => {
21
21
  const [selectedSection, setSelectedSection] = useState(1);
22
- const [selectedWord, setSelectedWord] = useState(null);
23
22
 
24
23
  const [formattedCopy, setFormattedCopy] = useState("");
25
24
  const [operationIndex, setOperationIndex] = useState(null);
@@ -28,9 +27,6 @@ const Grammar = ({ Aidata }) => {
28
27
 
29
28
  const originalText = data?.["Original Speech"] || "";
30
29
  const correctText = data?.["Grammatical Correct Version"] || "";
31
- const feedbacks = data?.["Feedback"];
32
-
33
- const { grammarFeekbackResult } = useReportUtils();
34
30
 
35
31
  const feedbackCorrection = (
36
32
  data?.["Correction Operations (Optional)"] || []
@@ -79,20 +75,6 @@ const Grammar = ({ Aidata }) => {
79
75
  []
80
76
  );
81
77
 
82
- const wordsFeedback = grammarFeekbackResult(
83
- originalText,
84
- feedbackCorrection,
85
- feedbacks
86
- );
87
-
88
- useEffect(() => {
89
- if (wordsFeedback?.length) {
90
- const findWord = wordsFeedback?.find((word) => word?.operation);
91
-
92
- setSelectedWord(findWord);
93
- }
94
- }, [wordsFeedback?.length]);
95
-
96
78
  useEffect(() => {
97
79
  const substitutedCorrections = feedbackCorrection?.filter((correction) =>
98
80
  ["substituted", "formatting"].includes(correction.operation)
@@ -124,8 +106,6 @@ const Grammar = ({ Aidata }) => {
124
106
 
125
107
  const operation = findOperation();
126
108
 
127
- console.log(operation);
128
-
129
109
  return (
130
110
  <ModelComtainer>
131
111
  <ModelContent>
@@ -293,7 +293,7 @@ const ReportQuestions = ({
293
293
  testId={testId}
294
294
  questionData={data}
295
295
  setData={setComment}
296
- disabledAdd={true}
296
+ disabledAdd={!hasAnswer}
297
297
  editMode={
298
298
  accountType === "instructor-personal" ||
299
299
  accountType === "instructor-affiliate"
@@ -73,7 +73,13 @@ const DialogueScripted = ({ data, aiData, setToggle }) => {
73
73
  <Response response={selectedResponse?.text} />
74
74
  <QuestionSectionWithAnalysis>
75
75
  {analysis?.models?.length > 0 && transcript?.length > 0 && (
76
- <Response title="" response={transcript} isAiWordFlow />
76
+ <Response
77
+ title=""
78
+ response={
79
+ !selectedResponse?.recording?.url ? undefined : transcript
80
+ }
81
+ isAiWordFlow
82
+ />
77
83
  )}
78
84
  <QuestionSectionAction>
79
85
  <ResponseAudio
@@ -83,7 +89,10 @@ const DialogueScripted = ({ data, aiData, setToggle }) => {
83
89
  />
84
90
  <div className="right">
85
91
  <AnalysisButton
86
- disabled={!analysis?.models?.length > 0}
92
+ disabled={
93
+ !analysis?.models?.length > 0 ||
94
+ !selectedResponse?.recording?.url
95
+ }
87
96
  onClick={() => {
88
97
  setToggle(analysis);
89
98
  }}
@@ -87,7 +87,10 @@ const DialogueUnscripted = ({ data, aiData, setToggle }) => {
87
87
  />
88
88
  <div className="right">
89
89
  <AnalysisButton
90
- disabled={!analysis?.models?.length > 0}
90
+ disabled={
91
+ !analysis?.models?.length > 0 ||
92
+ !selectedResponse?.recording?.url
93
+ }
91
94
  onClick={() => {
92
95
  setToggle(analysis);
93
96
  }}