l-min-components 1.7.1530 → 1.7.1532

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.1530",
3
+ "version": "1.7.1532",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -1,13 +1,13 @@
1
- import React from 'react';
1
+ import React from "react";
2
2
  import {
3
3
  ResponseAiWordFlow,
4
4
  ResponseContainer,
5
5
  ResponseContent,
6
6
  FallbackResponse,
7
- } from './style/response.style';
8
- import Redx from '../../../../assets/svg/redX';
9
- import GoodCheck from '../../../../assets/svg/goodCheck';
10
- import classNames from 'classnames';
7
+ } from "./style/response.style";
8
+ import Redx from "../../../../assets/svg/redX";
9
+ import GoodCheck from "../../../../assets/svg/goodCheck";
10
+ import classNames from "classnames";
11
11
 
12
12
  /**
13
13
  * @param {Object} props
@@ -19,26 +19,28 @@ import classNames from 'classnames';
19
19
  * @param {boolean} props.goodFallback
20
20
  * @param {boolean} props.rightIcon
21
21
  * @param {boolean} props.defaultError
22
+ * @param {boolean} props.isPersonal
22
23
  * @returns {React.ReactNode}
23
24
  */
24
25
  const Response = ({
25
- title = 'Student response',
26
+ title = "Student response",
26
27
  response,
27
28
  isAiWordFlow = false,
28
29
  processing = false,
29
- fallbackMessage = '',
30
+ fallbackMessage = "",
30
31
  goodFallback = false,
31
32
  rightIcon,
32
33
  defaultError,
34
+ isPersonal,
33
35
  }) => {
34
36
  const setupAiWordFlow = () => {
35
- if (!response) return '';
36
- if (isAiWordFlow && typeof response !== 'string') {
37
+ if (!response) return "";
38
+ if (isAiWordFlow && typeof response !== "string") {
37
39
  const htmlString = response
38
40
  ?.map((item) => {
39
41
  return `<span style="color: ${item?.color};">${item?.text}</span>`;
40
42
  })
41
- .join(' ');
43
+ .join(" ");
42
44
  return htmlString;
43
45
  }
44
46
  return response;
@@ -70,13 +72,15 @@ const Response = ({
70
72
  ))}
71
73
  <p
72
74
  className={classNames({
73
- 'good-fallback': goodFallback,
75
+ "good-fallback": goodFallback,
74
76
  })}
75
77
  >
76
78
  {fallbackMessage ||
77
79
  (isAiWordFlow && !defaultError
78
- ? 'Analysis unavailable. We couldn’t generate it this time.'
79
- : 'No response was provided by the student for this question.')}
80
+ ? "Analysis unavailable. We couldn’t generate it this time."
81
+ : isPersonal
82
+ ? "No response was provided for this question."
83
+ : "No response was provided by the student for this question.")}
80
84
  </p>
81
85
 
82
86
  {rightIcon && (goodFallback ? <GoodCheck /> : <Redx />)}
@@ -155,6 +155,8 @@ const ReportQuestions = ({
155
155
  const handlePrev = () => {
156
156
  if (prevId) onSwitchQuestion?.(prevId);
157
157
  };
158
+
159
+ const isPersonal = accountType === "personal";
158
160
  return (
159
161
  <Container>
160
162
  {(gradeQuestionData?.loading || loading) && (
@@ -245,6 +247,7 @@ const ReportQuestions = ({
245
247
  answerData={answerData}
246
248
  aiData={AiData}
247
249
  setToggle={setToggle}
250
+ isPersonal={isPersonal}
248
251
  />
249
252
  )}
250
253
  {questionType === "essay-scripted" && (
@@ -253,6 +256,7 @@ const ReportQuestions = ({
253
256
  answerData={answerData}
254
257
  aiData={AiData}
255
258
  setToggle={setToggle}
259
+ isPersonal={isPersonal}
256
260
  />
257
261
  )}
258
262
  {questionType === "essay-unscripted" && (
@@ -261,6 +265,7 @@ const ReportQuestions = ({
261
265
  answerData={answerData}
262
266
  aiData={AiData}
263
267
  setToggle={setToggle}
268
+ isPersonal={isPersonal}
264
269
  />
265
270
  )}
266
271
  {questionType === "sound-play" && (
@@ -269,6 +274,7 @@ const ReportQuestions = ({
269
274
  answerData={answerData}
270
275
  aiData={AiData}
271
276
  setToggle={setToggle}
277
+ isPersonal={isPersonal}
272
278
  />
273
279
  )}
274
280
  {questionType === "reading" && (
@@ -277,22 +283,29 @@ const ReportQuestions = ({
277
283
  answerData={answerData}
278
284
  aiData={AiData}
279
285
  setToggle={setToggle}
286
+ isPersonal={isPersonal}
280
287
  />
281
288
  )}
282
289
  {questionType === "word-play-text" && (
283
290
  <WordPlayText
284
291
  data={findedQuestion}
285
292
  answerData={answerData}
293
+ isPersonal={isPersonal}
286
294
  />
287
295
  )}
288
296
  {questionType === "word-play-multiple-choice" && (
289
297
  <WordPlayMultipleChoice
290
298
  data={findedQuestion}
291
299
  answerData={answerData}
300
+ isPersonal={isPersonal}
292
301
  />
293
302
  )}
294
303
  {questionType === "match-pair" && (
295
- <MatchPair data={findedQuestion} answerData={answerData} />
304
+ <MatchPair
305
+ data={findedQuestion}
306
+ answerData={answerData}
307
+ isPersonal={isPersonal}
308
+ />
296
309
  )}
297
310
  {questionType === "quiz-scripted" && (
298
311
  <QuizScripted
@@ -300,6 +313,7 @@ const ReportQuestions = ({
300
313
  answerData={answerData}
301
314
  aiData={AiData}
302
315
  setToggle={setToggle}
316
+ isPersonal={isPersonal}
303
317
  />
304
318
  )}
305
319
  {questionType === "quiz-unscripted" && (
@@ -308,12 +322,14 @@ const ReportQuestions = ({
308
322
  answerData={answerData}
309
323
  aiData={AiData}
310
324
  setToggle={setToggle}
325
+ isPersonal={isPersonal}
311
326
  />
312
327
  )}
313
328
  {questionType === "quiz-multiple-choice" && (
314
329
  <QuizMultipleChoice
315
330
  data={findedQuestion}
316
331
  answerData={answerData}
332
+ isPersonal={isPersonal}
317
333
  />
318
334
  )}
319
335
 
@@ -323,6 +339,7 @@ const ReportQuestions = ({
323
339
  answerData={answerData}
324
340
  aiData={AiData}
325
341
  setToggle={setToggle}
342
+ isPersonal={isPersonal}
326
343
  />
327
344
  )}
328
345
  {questionType === "dialogue-unscripted" && (
@@ -331,6 +348,7 @@ const ReportQuestions = ({
331
348
  answerData={answerData}
332
349
  aiData={AiData}
333
350
  setToggle={setToggle}
351
+ isPersonal={isPersonal}
334
352
  />
335
353
  )}
336
354
  </>
@@ -1,4 +1,4 @@
1
- import { useEffect, useState } from 'react';
1
+ import { useEffect, useState } from "react";
2
2
  import {
3
3
  QuestionSection,
4
4
  QuestionSectionAction,
@@ -14,7 +14,13 @@ import ResponseAudioV2 from "../components/responseAudio.v2";
14
14
  import QuestionDropdown from "../components/questionDropdown";
15
15
  import useTranslation from "../../../../hooks/useTranslation.jsx";
16
16
  import wordStore from "../../../../mc/wordStore.json";
17
- const DialogueScripted = ({ data, aiData, setToggle, answerData }) => {
17
+ const DialogueScripted = ({
18
+ data,
19
+ aiData,
20
+ setToggle,
21
+ answerData,
22
+ isPersonal,
23
+ }) => {
18
24
  const { findText } = useTranslation(wordStore);
19
25
  const [selected, setSelected] = useState(1);
20
26
  const [analysis, setAnalysis] = useState(null);
@@ -40,7 +46,7 @@ const DialogueScripted = ({ data, aiData, setToggle, answerData }) => {
40
46
  const models = setupAnalysis(
41
47
  selectedModel,
42
48
  selectedResponse?.recording,
43
- answerData?.ai_score,
49
+ answerData?.ai_score
44
50
  );
45
51
  setAnalysis(models);
46
52
  }
@@ -78,6 +84,7 @@ const DialogueScripted = ({ data, aiData, setToggle, answerData }) => {
78
84
  <Response
79
85
  title={findText("Selected option")}
80
86
  response={selectedResponse?.text}
87
+ isPersonal={isPersonal}
81
88
  />
82
89
  </TitleAndSubtitle>
83
90
  <QuestionSectionWithAnalysis>
@@ -1,4 +1,4 @@
1
- import { useEffect, useState } from 'react';
1
+ import { useEffect, useState } from "react";
2
2
  import {
3
3
  QuestionSection,
4
4
  QuestionSectionAction,
@@ -14,7 +14,13 @@ import QuestionDropdown from "../components/questionDropdown";
14
14
  import ResponseAudioV2 from "../components/responseAudio.v2";
15
15
  import useTranslation from "../../../../hooks/useTranslation.jsx";
16
16
  import wordStore from "../../../../mc/wordStore.json";
17
- const DialogueUnscripted = ({ data, aiData, setToggle, answerData }) => {
17
+ const DialogueUnscripted = ({
18
+ data,
19
+ aiData,
20
+ setToggle,
21
+ answerData,
22
+ isPersonal,
23
+ }) => {
18
24
  const { findText } = useTranslation(wordStore);
19
25
  const [selected, setSelected] = useState(1);
20
26
  const [analysis, setAnalysis] = useState(null);
@@ -40,7 +46,7 @@ const DialogueUnscripted = ({ data, aiData, setToggle, answerData }) => {
40
46
  const models = setupAnalysis(
41
47
  selectedModel,
42
48
  selectedResponse?.recording,
43
- data?.ai_score,
49
+ data?.ai_score
44
50
  );
45
51
  setAnalysis(models);
46
52
  }
@@ -84,6 +90,7 @@ const DialogueUnscripted = ({ data, aiData, setToggle, answerData }) => {
84
90
  }
85
91
  isAiWordFlow
86
92
  defaultError={!selectedResponse?.recording?.url}
93
+ isPersonal={isPersonal}
87
94
  />
88
95
  <QuestionSectionAction>
89
96
  {selectedResponse?.recording?.url && (
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import React, { useEffect, useState } from "react";
2
2
  import {
3
3
  QuestionSection,
4
4
  QuestionSectionAction,
@@ -13,7 +13,7 @@ import ResponseAudioV2 from "../components/responseAudio.v2";
13
13
  import QuestionDropdown from "../components/questionDropdown";
14
14
  import useTranslation from "../../../../hooks/useTranslation.jsx";
15
15
  import wordStore from "../../../../mc/wordStore.json";
16
- const EssayScripted = ({ data, aiData, setToggle, answerData }) => {
16
+ const EssayScripted = ({ data, aiData, setToggle, answerData, isPersonal }) => {
17
17
  const { findText } = useTranslation(wordStore);
18
18
  const [analysis, setAnalysis] = useState(null);
19
19
  const { setupAnalysis, getTrabScriptData } = useReportUtils();
@@ -25,7 +25,7 @@ const EssayScripted = ({ data, aiData, setToggle, answerData }) => {
25
25
  const models = setupAnalysis(
26
26
  aiData,
27
27
  answerData?.answer?.data?.data?.recording,
28
- answerData?.ai_score,
28
+ answerData?.ai_score
29
29
  );
30
30
  setAnalysis(models);
31
31
  }
@@ -46,7 +46,10 @@ const EssayScripted = ({ data, aiData, setToggle, answerData }) => {
46
46
  </>
47
47
  </QuestionDropdown>
48
48
  <TitleAndSubtitle className="with-border">
49
- <Response response={answerData?.answer?.data?.data?.text} />
49
+ <Response
50
+ response={answerData?.answer?.data?.data?.text}
51
+ isPersonal={isPersonal}
52
+ />
50
53
  </TitleAndSubtitle>
51
54
 
52
55
  <QuestionSectionWithAnalysis>
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import React, { useEffect, useState } from "react";
2
2
  import {
3
3
  QuestionSection,
4
4
  QuestionSectionAction,
@@ -12,7 +12,13 @@ import QuestionDropdown from "../components/questionDropdown";
12
12
  import ResponseAudioV2 from "../components/responseAudio.v2";
13
13
  import useTranslation from "../../../../hooks/useTranslation.jsx";
14
14
  import wordStore from "../../../../mc/wordStore.json";
15
- const EssayUnscripted = ({ data, aiData, setToggle, answerData }) => {
15
+ const EssayUnscripted = ({
16
+ data,
17
+ aiData,
18
+ setToggle,
19
+ answerData,
20
+ isPersonal,
21
+ }) => {
16
22
  const { findText } = useTranslation(wordStore);
17
23
  const [analysis, setAnalysis] = useState(null);
18
24
  const { setupAnalysis, getTrabScriptData } = useReportUtils();
@@ -21,7 +27,7 @@ const EssayUnscripted = ({ data, aiData, setToggle, answerData }) => {
21
27
  const models = setupAnalysis(
22
28
  aiData,
23
29
  answerData?.answer?.data?.data?.recording,
24
- answerData?.ai_score,
30
+ answerData?.ai_score
25
31
  );
26
32
  setAnalysis(models);
27
33
  }
@@ -51,6 +57,7 @@ const EssayUnscripted = ({ data, aiData, setToggle, answerData }) => {
51
57
  : undefined
52
58
  }
53
59
  isAiWordFlow
60
+ isPersonal={isPersonal}
54
61
  defaultError={!answerData?.answer?.data?.data?.recording}
55
62
  />
56
63
  <QuestionSectionAction>
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import React, { useEffect, useState } from "react";
2
2
  import {
3
3
  QuestionSection,
4
4
  QuestionSectionAction,
@@ -11,7 +11,8 @@ import useReportUtils from "../../hooks/useRreportUtils";
11
11
  import QuestionDropdown from "../components/questionDropdown";
12
12
  import useTranslation from "../../../../hooks/useTranslation.jsx";
13
13
  import wordStore from "../../../../mc/wordStore.json";
14
- const EssayWritten = ({ data, aiData, setToggle, answerData }) => {
14
+
15
+ const EssayWritten = ({ data, aiData, setToggle, answerData, isPersonal }) => {
15
16
  const { findText } = useTranslation(wordStore);
16
17
  const [analysis, setAnalysis] = useState(null);
17
18
  const { setupAnalysis } = useReportUtils();
@@ -37,7 +38,10 @@ const EssayWritten = ({ data, aiData, setToggle, answerData }) => {
37
38
  </QuestionDropdown>
38
39
 
39
40
  <QuestionSectionWithAnalysis>
40
- <Response response={data?.answer?.data?.data?.text} />
41
+ <Response
42
+ response={data?.answer?.data?.data?.text}
43
+ isPersonal={isPersonal}
44
+ />
41
45
  <QuestionSectionAction>
42
46
  {analysis?.models?.length > 0 && (
43
47
  <AnalysisButton
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import React, { useState } from "react";
2
2
  import {
3
3
  QuestionSection,
4
4
  MatchPairGrid,
@@ -14,7 +14,7 @@ import QuestionDropdown from "../components/questionDropdown";
14
14
  import Response from "../components/response";
15
15
  import useTranslation from "../../../../hooks/useTranslation.jsx";
16
16
  import wordStore from "../../../../mc/wordStore.json";
17
- const MatchPair = ({ data, answerData }) => {
17
+ const MatchPair = ({ data, answerData, isPersonal }) => {
18
18
  const { findText } = useTranslation(wordStore);
19
19
  const [pairPreview, setPairPreview] = useState(null);
20
20
  const getMatchAndCorrectPair = () => {
@@ -54,7 +54,7 @@ const MatchPair = ({ data, answerData }) => {
54
54
  </QuestionDropdown>
55
55
  {answerData &&
56
56
  !Object.values(answerData?.answer?.data?.responses || {})?.length >
57
- 0 && <Response title="" />}
57
+ 0 && <Response title="" isPersonal={isPersonal} />}
58
58
  <TitleAndSubtitle>
59
59
  <MatchPairGrid>
60
60
  <h3>Word/Sentence</h3>
@@ -73,8 +73,8 @@ const MatchPair = ({ data, answerData }) => {
73
73
 
74
74
  <MatchPairItem
75
75
  className={classNames({
76
- 'is-correct': item?.isCorrect && item?.answer,
77
- 'is-incorrect': !item?.isCorrect,
76
+ "is-correct": item?.isCorrect && item?.answer,
77
+ "is-incorrect": !item?.isCorrect,
78
78
  })}
79
79
  >
80
80
  <p className="truncate-3">{item?.answer}</p>
@@ -6,7 +6,7 @@ import QuestionDropdown from "../components/questionDropdown";
6
6
  import QuizQuestion from "../components/quizQuestion";
7
7
  import useTranslation from "../../../../hooks/useTranslation.jsx";
8
8
  import wordStore from "../../../../mc/wordStore.json";
9
- const QuizMultipleChoice = ({ data, answerData }) => {
9
+ const QuizMultipleChoice = ({ data, answerData, isPersonal }) => {
10
10
  const { findText } = useTranslation(wordStore);
11
11
  const { choiceListAndAnswer } = useReportUtils();
12
12
  const { options, answer, isCorrect, correctIndex, correctText } =
@@ -36,7 +36,11 @@ const QuizMultipleChoice = ({ data, answerData }) => {
36
36
  </>
37
37
  </QuestionDropdown>
38
38
  <TitleAndSubtitle>
39
- <Response goodFallback={isCorrect} fallbackMessage={answer?.text} />
39
+ <Response
40
+ goodFallback={isCorrect}
41
+ fallbackMessage={answer?.text}
42
+ isPersonal={isPersonal}
43
+ />
40
44
  </TitleAndSubtitle>
41
45
 
42
46
  {answerData?.answer?.data && (
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import React, { useEffect, useState } from "react";
2
2
  import {
3
3
  QuestionSection,
4
4
  QuestionSectionAction,
@@ -15,7 +15,7 @@ import QuizQuestion from "../components/quizQuestion";
15
15
  import ResponseAudioV2 from "../components/responseAudio.v2";
16
16
  import useTranslation from "../../../../hooks/useTranslation.jsx";
17
17
  import wordStore from "../../../../mc/wordStore.json";
18
- const QuizScripted = ({ data, aiData, setToggle, answerData }) => {
18
+ const QuizScripted = ({ data, aiData, setToggle, answerData, isPersonal }) => {
19
19
  const { findText } = useTranslation(wordStore);
20
20
  const [selected, setSelected] = useState(1);
21
21
  const [analysis, setAnalysis] = useState(null);
@@ -36,7 +36,7 @@ const QuizScripted = ({ data, aiData, setToggle, answerData }) => {
36
36
  const models = setupAnalysis(
37
37
  selectedModel,
38
38
  selectedResponse?.recording,
39
- data?.ai_score,
39
+ data?.ai_score
40
40
  );
41
41
  setAnalysis(models);
42
42
  }
@@ -65,7 +65,7 @@ const QuizScripted = ({ data, aiData, setToggle, answerData }) => {
65
65
  </>
66
66
  </QuestionDropdown>
67
67
 
68
- <Response response={selectedResponse?.text} />
68
+ <Response response={selectedResponse?.text} isPersonal={isPersonal} />
69
69
 
70
70
  <QuestionSectionWithAnalysis>
71
71
  {selectedResponse?.recording && (
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import React, { useEffect, useState } from "react";
2
2
  import {
3
3
  QuestionSection,
4
4
  QuestionSectionAction,
@@ -15,7 +15,13 @@ import QuizQuestion from "../components/quizQuestion";
15
15
  import ResponseAudioV2 from "../components/responseAudio.v2";
16
16
  import useTranslation from "../../../../hooks/useTranslation.jsx";
17
17
  import wordStore from "../../../../mc/wordStore.json";
18
- const QuizUnscripted = ({ data, aiData, setToggle, answerData }) => {
18
+ const QuizUnscripted = ({
19
+ data,
20
+ aiData,
21
+ setToggle,
22
+ answerData,
23
+ isPersonal,
24
+ }) => {
19
25
  const { findText } = useTranslation(wordStore);
20
26
  const [selected, setSelected] = useState(1);
21
27
  const { quizResponses, quixSelectedModel, setupAnalysis, getTrabScriptData } =
@@ -23,7 +29,7 @@ const QuizUnscripted = ({ data, aiData, setToggle, answerData }) => {
23
29
  const [analysis, setAnalysis] = useState(null);
24
30
  const quizList = quizResponses({
25
31
  responses: answerData?.answer?.data?.data?.responses,
26
- type: 'unscripted',
32
+ type: "unscripted",
27
33
  });
28
34
  const selectionList = quizList?.map((item) => ({
29
35
  value: item?.key,
@@ -37,7 +43,7 @@ const QuizUnscripted = ({ data, aiData, setToggle, answerData }) => {
37
43
  const models = setupAnalysis(
38
44
  selectedModel,
39
45
  selectedResponse?.recording,
40
- data?.ai_score,
46
+ data?.ai_score
41
47
  );
42
48
  setAnalysis(models);
43
49
  }
@@ -75,6 +81,7 @@ const QuizUnscripted = ({ data, aiData, setToggle, answerData }) => {
75
81
  }
76
82
  isAiWordFlow
77
83
  defaultError={!selectedResponse?.recording}
84
+ isPersonal={isPersonal}
78
85
  />
79
86
  <QuestionSectionAction>
80
87
  {selectedResponse?.recording && (
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import React, { useEffect, useState } from "react";
2
2
  import {
3
3
  QuestionSection,
4
4
  QuestionSectionAction,
@@ -12,7 +12,7 @@ import QuestionDropdown from "../components/questionDropdown";
12
12
  import ResponseAudioV2 from "../components/responseAudio.v2";
13
13
  import useTranslation from "../../../../hooks/useTranslation.jsx";
14
14
  import wordStore from "../../../../mc/wordStore.json";
15
- const Reading = ({ data, aiData, setToggle, answerData }) => {
15
+ const Reading = ({ data, aiData, setToggle, answerData, isPersonal }) => {
16
16
  const { findText } = useTranslation(wordStore);
17
17
  const [analysis, setAnalysis] = useState(null);
18
18
  const { setupAnalysis, getTrabScriptData } = useReportUtils();
@@ -21,13 +21,13 @@ const Reading = ({ data, aiData, setToggle, answerData }) => {
21
21
  const models = setupAnalysis(
22
22
  aiData,
23
23
  answerData?.answer?.data?.recording,
24
- answerData?.ai_score,
24
+ answerData?.ai_score
25
25
  );
26
26
  setAnalysis(models);
27
27
  }
28
28
  }, [data, answerData]);
29
29
  const transcript = getTrabScriptData(analysis?.models);
30
- console.log(data?.question_data, "llll");
30
+
31
31
  return (
32
32
  <QuestionSection>
33
33
  <QuestionDropdown>
@@ -52,6 +52,7 @@ const Reading = ({ data, aiData, setToggle, answerData }) => {
52
52
  }
53
53
  isAiWordFlow
54
54
  defaultError={!answerData?.answer?.data?.recording}
55
+ isPersonal={isPersonal}
55
56
  />
56
57
  <QuestionSectionAction>
57
58
  {answerData?.answer?.data?.recording && (
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import React, { useEffect, useState } from "react";
2
2
  import {
3
3
  QuestionSection,
4
4
  QuestionSectionAction,
@@ -12,7 +12,7 @@ import ResponseAudioV2 from "../components/responseAudio.v2";
12
12
  import QuestionDropdown from "../components/questionDropdown";
13
13
  import useTranslation from "../../../../hooks/useTranslation.jsx";
14
14
  import wordStore from "../../../../mc/wordStore.json";
15
- const SoundPlay = ({ data, aiData, setToggle, answerData }) => {
15
+ const SoundPlay = ({ data, aiData, setToggle, answerData, isPersonal }) => {
16
16
  const { findText } = useTranslation(wordStore);
17
17
  const [analysis, setAnalysis] = useState(null);
18
18
  const { setupAnalysis, getTrabScriptData } = useReportUtils();
@@ -21,7 +21,7 @@ const SoundPlay = ({ data, aiData, setToggle, answerData }) => {
21
21
  const models = setupAnalysis(
22
22
  aiData,
23
23
  answerData?.answer?.data?.audio,
24
- answerData?.ai_score,
24
+ answerData?.ai_score
25
25
  );
26
26
  setAnalysis(models);
27
27
  }
@@ -51,6 +51,7 @@ const SoundPlay = ({ data, aiData, setToggle, answerData }) => {
51
51
  }
52
52
  isAiWordFlow
53
53
  defaultError={!answerData?.answer?.data?.audio}
54
+ isPersonal={isPersonal}
54
55
  />
55
56
  <QuestionSectionAction>
56
57
  {answerData?.answer?.data?.audio && (
@@ -8,7 +8,7 @@ import QuestionDropdown from "../components/questionDropdown";
8
8
  import ResponseAudioV2 from "../components/responseAudio.v2";
9
9
  import useTranslation from "../../../../hooks/useTranslation.jsx";
10
10
  import wordStore from "../../../../mc/wordStore.json";
11
- const WordPlayMultipleChoice = ({ data, answerData }) => {
11
+ const WordPlayMultipleChoice = ({ data, answerData, isPersonal }) => {
12
12
  const { findText } = useTranslation(wordStore);
13
13
  const { choiceListAndAnswer } = useReportUtils();
14
14
  const { options, answer, isCorrect, correctIndex, correctText } =
@@ -42,7 +42,11 @@ const WordPlayMultipleChoice = ({ data, answerData }) => {
42
42
  </QuestionDropdown>
43
43
 
44
44
  <TitleAndSubtitle>
45
- <Response goodFallback={isCorrect} fallbackMessage={answer?.text} />
45
+ <Response
46
+ goodFallback={isCorrect}
47
+ fallbackMessage={answer?.text}
48
+ isPersonal={isPersonal}
49
+ />
46
50
  </TitleAndSubtitle>
47
51
 
48
52
  {answerData?.answer?.data && (
@@ -6,7 +6,7 @@ import QuestionDropdown from "../components/questionDropdown";
6
6
  import ResponseAudioV2 from "../components/responseAudio.v2";
7
7
  import useTranslation from "../../../../hooks/useTranslation.jsx";
8
8
  import wordStore from "../../../../mc/wordStore.json";
9
- const WordPlayText = ({ data, answerData }) => {
9
+ const WordPlayText = ({ data, answerData, isPersonal }) => {
10
10
  const { findText } = useTranslation(wordStore);
11
11
  return (
12
12
  <QuestionSection>
@@ -27,9 +27,11 @@ const WordPlayText = ({ data, answerData }) => {
27
27
  </>
28
28
  </QuestionDropdown>
29
29
 
30
- {answerData?.answer && (
31
- <Response response={answerData?.answer?.data?.answer_text} />
32
- )}
30
+ <Response
31
+ response={answerData?.answer?.data?.answer_text}
32
+ isPersonal={isPersonal}
33
+ />
34
+
33
35
  {data?.question_data?.answer && (
34
36
  <Response
35
37
  title={findText("Correct response")}
@@ -7,8 +7,9 @@ if (!window.translationCache) {
7
7
  }
8
8
 
9
9
  const CACHE_DURATION = 60 * 60 * 1000; // 1 hour in milliseconds
10
- const S3_BASE_URL =
11
- "https://learngual-bucket.sfo3.digitaloceanspaces.com/media/media/";
10
+ const S3_BASE_URL = `https://learngual-bucket.sfo3.digitaloceanspaces.com/${
11
+ window.location.hostname.includes("staging") ? "" : "learngual-production/"
12
+ }media/media/`;
12
13
 
13
14
  const useTranslation = (initialSentences = []) => {
14
15
  const value = localStorage?.getItem("defaultLang");
@@ -82,7 +83,11 @@ const useTranslation = (initialSentences = []) => {
82
83
  try {
83
84
  // Fetch from S3 - master JSON contains all languages
84
85
  const response = await fetch(
85
- `${S3_BASE_URL}qFpINMa05DrgUgzO0PEboReejximpq2r3VL2AmFZAwIq6fTN3A.json`
86
+ `${S3_BASE_URL}${
87
+ window.location.hostname.includes("staging")
88
+ ? "qFpINMa05DrgUgzO0PEboReejximpq2r3VL2AmFZAwIq6fTN3A.json"
89
+ : "qFpINMa05DrgUgzO0PEboReejximpq2r3VL2AmFZAwIq6fTN3A.json"
90
+ }`
86
91
  );
87
92
 
88
93
  if (!response.ok) {