l-min-components 1.7.1431 → 1.7.1433
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 +1 -1
- package/src/components/reportsComponents/fullAnalysis/components/Grammar.jsx +32 -21
- package/src/components/reportsComponents/fullAnalysis/style.jsx +2 -4
- package/src/components/reportsComponents/reportQuestions/components/response.jsx +1 -0
- package/src/components/reportsComponents/reportQuestions/components/style/errorHeader.style.jsx +1 -0
- package/src/components/reportsComponents/reportQuestions/index.jsx +3 -0
- package/src/components/reportsComponents/reportQuestions/questions/dialogueUnscripted.jsx +7 -1
- package/src/components/reportsComponents/reportQuestions/questions/matchPair.jsx +1 -1
package/package.json
CHANGED
|
@@ -15,9 +15,6 @@ import { useState } from "react";
|
|
|
15
15
|
import GoodCheck from "../../../../assets/svg/goodCheck";
|
|
16
16
|
import RedX from "../../../../assets/svg/redX";
|
|
17
17
|
import useReportUtils from "../../hooks/useRreportUtils";
|
|
18
|
-
// import WarningGrey from "../../../../assets/svg/warningGrey";
|
|
19
|
-
|
|
20
|
-
// import DOMPurify from "dompurify";
|
|
21
18
|
|
|
22
19
|
const Grammar = ({ Aidata }) => {
|
|
23
20
|
const [selectedSection, setSelectedSection] = useState(1);
|
|
@@ -63,24 +60,38 @@ const Grammar = ({ Aidata }) => {
|
|
|
63
60
|
<p>Click on the words to see detailed feedback</p>
|
|
64
61
|
</div>
|
|
65
62
|
<GrammarHeaderContent>
|
|
66
|
-
{wordsFeedback?.map((word, idx) =>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
63
|
+
{wordsFeedback?.map((word, idx) => {
|
|
64
|
+
const isWord = /^\w+$/.test(word.text);
|
|
65
|
+
const isSymbol = /^[^\w\s]+$/.test(word.text);
|
|
66
|
+
const next = wordsFeedback[idx + 1];
|
|
67
|
+
const nextIsWord = /^\w+$/.test(next?.text || "");
|
|
68
|
+
const isCorrected = !!word.operation;
|
|
69
|
+
const showFeedback = !!word.feedbackPosition;
|
|
70
|
+
|
|
71
|
+
const shouldAddSpace =
|
|
72
|
+
(isWord && nextIsWord) || // word → word
|
|
73
|
+
(isSymbol && nextIsWord); // symbol → word
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<span
|
|
77
|
+
className={classNames("inline", {
|
|
78
|
+
"error-text": isCorrected,
|
|
79
|
+
})}
|
|
80
|
+
key={idx}
|
|
81
|
+
style={{ whiteSpace: "pre" }}
|
|
82
|
+
onClick={() => {
|
|
83
|
+
if (!isCorrected) return;
|
|
84
|
+
setSelectedWord(word);
|
|
85
|
+
setSelectedSection(1);
|
|
86
|
+
}}
|
|
87
|
+
>
|
|
88
|
+
{/* This will only be true for words with a correction (and a position) */}
|
|
89
|
+
{showFeedback && <sup>{word.feedbackPosition}</sup>}
|
|
90
|
+
{word.text}
|
|
91
|
+
{shouldAddSpace && " "}
|
|
92
|
+
</span>
|
|
93
|
+
);
|
|
94
|
+
})}
|
|
84
95
|
</GrammarHeaderContent>
|
|
85
96
|
<ul className="no-border ul_tabs">
|
|
86
97
|
{tabs.map((tab) => (
|
|
@@ -438,9 +438,7 @@ export const GrammarHeaderContent = styled.div`
|
|
|
438
438
|
span {
|
|
439
439
|
line-height: 22px;
|
|
440
440
|
font-size: 16px;
|
|
441
|
-
|
|
442
|
-
content: " ";
|
|
443
|
-
}
|
|
441
|
+
|
|
444
442
|
&.error-text {
|
|
445
443
|
display: inline-flex;
|
|
446
444
|
padding-right: 4px;
|
|
@@ -448,7 +446,7 @@ export const GrammarHeaderContent = styled.div`
|
|
|
448
446
|
align-items: center;
|
|
449
447
|
gap: 2px;
|
|
450
448
|
cursor: pointer;
|
|
451
|
-
>
|
|
449
|
+
> sup {
|
|
452
450
|
display: inline-flex;
|
|
453
451
|
justify-content: center;
|
|
454
452
|
align-items: center;
|
|
@@ -37,6 +37,7 @@ import useApi from "./api";
|
|
|
37
37
|
import FullPageLoader from "../../fullPageLoader";
|
|
38
38
|
import { OutletContext } from "../..";
|
|
39
39
|
import useReportUtils from "../hooks/useRreportUtils";
|
|
40
|
+
import ErrorHeader from "./components/errorHeader";
|
|
40
41
|
|
|
41
42
|
/**
|
|
42
43
|
* @param {Object} props
|
|
@@ -67,6 +68,7 @@ const ReportQuestions = ({
|
|
|
67
68
|
(question) => question.value === questionType
|
|
68
69
|
);
|
|
69
70
|
const commentData = data?.answer?.comments;
|
|
71
|
+
const hasAnswer = data?.answer?.data;
|
|
70
72
|
|
|
71
73
|
useEffect(() => {
|
|
72
74
|
if (commentData?.length) setComment(commentData?.[0]);
|
|
@@ -201,6 +203,7 @@ const ReportQuestions = ({
|
|
|
201
203
|
</>
|
|
202
204
|
)}
|
|
203
205
|
</ScoreHeader>
|
|
206
|
+
{data && !hasAnswer && <ErrorHeader />}
|
|
204
207
|
<QuestionContent>
|
|
205
208
|
{(questionType === "quiz-scripted" ||
|
|
206
209
|
questionType === "quiz-unscripted" ||
|
|
@@ -71,7 +71,13 @@ const DialogueUnscripted = ({ data, aiData, setToggle }) => {
|
|
|
71
71
|
|
|
72
72
|
<QuestionSectionWithAnalysis>
|
|
73
73
|
{analysis?.models?.length > 0 && transcript?.length > 0 && (
|
|
74
|
-
<Response
|
|
74
|
+
<Response
|
|
75
|
+
title=""
|
|
76
|
+
response={
|
|
77
|
+
!selectedResponse?.recording?.url ? undefined : transcript
|
|
78
|
+
}
|
|
79
|
+
isAiWordFlow
|
|
80
|
+
/>
|
|
75
81
|
)}
|
|
76
82
|
<QuestionSectionAction>
|
|
77
83
|
<ResponseAudio
|