@nualang/nualang-ui-components 0.1.1245 → 0.1.1248
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/dist/Assignments/AssignmentRoleplaySelection/AssignmentRoleplaySelection.js +1 -1
- package/dist/Exercises/Listener/Listener.js +25 -34
- package/dist/Exercises/Pronouncer/Pronouncer.js +237 -213
- package/dist/Exercises/Translator/Translator.js +25 -34
- package/dist/Forms/FeedbackForm/FeedbackForm.js +2 -1
- package/dist/Lists/Courses/Courses.js +27 -8
- package/dist/Lists/Leaderboard/Leaderboard.js +26 -21
- package/dist/Live/GameControls/GameControls.js +3 -1
- package/dist/Live/GameQuestionResults/GameQuestionResults.js +2 -1
- package/dist/Live/LiveListener/LiveListener.js +1 -2
- package/dist/Live/LiveTranslator/LiveTranslator.js +1 -2
- package/dist/Misc/ExerciseBottomBar/ExerciseBottomBar.js +2 -15
- package/dist/Screens/Classrooms/ViewClassroom/ViewClassroom.js +0 -3
- package/dist/Screens/Courses/SearchCourses/SearchCourses.js +1 -0
- package/dist/Screens/Search/Search.js +1 -0
- package/dist/Tables/Progress/Progress.js +1 -1
- package/package.json +7 -5
|
@@ -366,7 +366,7 @@ function AssignmentRoleplaySelection({
|
|
|
366
366
|
lastClickedExerciseId
|
|
367
367
|
}) {
|
|
368
368
|
const [isRoleplaySelected, setIsRoleplaySelected] = (0, _react.useState)(false);
|
|
369
|
-
const filteredCompletions = memberCourseCompletions.filter(completion => completion.courseSectionTopicId === courseSectionTopicId);
|
|
369
|
+
const filteredCompletions = Array.isArray(memberCourseCompletions) && memberCourseCompletions.length > 0 ? memberCourseCompletions.filter(completion => completion.courseSectionTopicId === courseSectionTopicId) : [];
|
|
370
370
|
return roleplays.map(roleplay => /*#__PURE__*/(0, _jsxRuntime.jsx)(Roleplay, {
|
|
371
371
|
roleplay: roleplay,
|
|
372
372
|
isRoleplaySelected: isRoleplaySelected,
|
|
@@ -42,7 +42,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
42
42
|
|
|
43
43
|
const useStyles = (0, _mui.makeStyles)()(theme => ({
|
|
44
44
|
appBar: {
|
|
45
|
-
position: "
|
|
45
|
+
position: "relative",
|
|
46
46
|
paddingTop: `env(safe-area-inset-top)`,
|
|
47
47
|
paddingRight: `env(safe-area-inset-right)`,
|
|
48
48
|
paddingLeft: `env(safe-area-inset-left)`
|
|
@@ -244,6 +244,7 @@ function Listener({
|
|
|
244
244
|
const {
|
|
245
245
|
classes
|
|
246
246
|
} = useStyles();
|
|
247
|
+
const scrollRef = (0, _react.useRef)(null);
|
|
247
248
|
const [wordBankTooltipOpen, setWordBankTooltipOpen] = (0, _react.useState)(false);
|
|
248
249
|
const initialVoiceSpeed = topicInfo && topicInfo.voiceSpeed ? topicInfo.voiceSpeed : "";
|
|
249
250
|
const exerciseState = (0, _useExerciseState.default)({
|
|
@@ -470,6 +471,14 @@ function Listener({
|
|
|
470
471
|
(0, _react.useEffect)(() => {
|
|
471
472
|
assignment ? setIsAssignmentExercise(true) : setIsAssignmentExercise(false);
|
|
472
473
|
}, [assignment]);
|
|
474
|
+
(0, _react.useEffect)(() => {
|
|
475
|
+
if (scrollRef.current && useWordBank) {
|
|
476
|
+
scrollRef.current.scroll({
|
|
477
|
+
top: scrollRef.current.scrollHeight,
|
|
478
|
+
behavior: "smooth"
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
}, [useWordBank]);
|
|
473
482
|
(0, _react.useEffect)(() => {
|
|
474
483
|
if (open && !run && !localStorage.getItem(`listening-exercise-tour-completed`)) {
|
|
475
484
|
setJoyrideState(prevState => ({
|
|
@@ -535,6 +544,9 @@ function Listener({
|
|
|
535
544
|
const goBackToAssignment = () => {
|
|
536
545
|
navigate(`/classrooms/${classroomId}#Assignments`);
|
|
537
546
|
};
|
|
547
|
+
const noListeningWords = !listeningWords || listeningWords.length === 0;
|
|
548
|
+
const isWordBankMode = useWordBank && isWordBankEnabled;
|
|
549
|
+
const isSubmitAnswerDisabled = isWordBankMode ? !isWordBankAttemptChanged || noListeningWords : !listeningText && noListeningWords;
|
|
538
550
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Dialog, {
|
|
539
551
|
fullScreen: true,
|
|
540
552
|
open: open,
|
|
@@ -644,9 +656,13 @@ function Listener({
|
|
|
644
656
|
})
|
|
645
657
|
})]
|
|
646
658
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
659
|
+
ref: scrollRef,
|
|
647
660
|
sx: {
|
|
661
|
+
overflowY: 'auto',
|
|
648
662
|
flexGrow: 1,
|
|
649
|
-
|
|
663
|
+
display: 'flex',
|
|
664
|
+
justifyContent: 'center',
|
|
665
|
+
alignItems: 'center'
|
|
650
666
|
},
|
|
651
667
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Grid, {
|
|
652
668
|
container: true,
|
|
@@ -927,38 +943,13 @@ function Listener({
|
|
|
927
943
|
exercise: exerciseName,
|
|
928
944
|
languageInformation: languageInformation,
|
|
929
945
|
nualaCelebratingImage: getNualaCelebratingImage()
|
|
930
|
-
}),
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExerciseBottomBar.default, {
|
|
938
|
-
t: t,
|
|
939
|
-
listeningWords: listeningWords,
|
|
940
|
-
handleSubmit: () => handleContinue(false),
|
|
941
|
-
handleSkip: () => handleContinue(true),
|
|
942
|
-
isSubmitAnswerAllowed: true,
|
|
943
|
-
isSubmitAnswerDisabled: !isWordBankAttemptChanged || !listeningWords || listeningWords.length === 0,
|
|
944
|
-
useWordBank: useWordBank
|
|
945
|
-
})
|
|
946
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
947
|
-
sx: {
|
|
948
|
-
position: 'sticky',
|
|
949
|
-
bottom: 0,
|
|
950
|
-
zIndex: 1100,
|
|
951
|
-
backgroundColor: theme => theme.palette.background.paper
|
|
952
|
-
},
|
|
953
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExerciseBottomBar.default, {
|
|
954
|
-
t: t,
|
|
955
|
-
listeningWords: listeningWords,
|
|
956
|
-
handleSubmit: () => handleContinue(false),
|
|
957
|
-
handleSkip: () => handleContinue(true),
|
|
958
|
-
isSubmitAnswerAllowed: true,
|
|
959
|
-
isSubmitAnswerDisabled: !listeningText && (!listeningWords || listeningWords.length === 0),
|
|
960
|
-
useWordBank: useWordBank
|
|
961
|
-
})
|
|
946
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExerciseBottomBar.default, {
|
|
947
|
+
t: t,
|
|
948
|
+
listeningWords: listeningWords,
|
|
949
|
+
handleSubmit: () => handleContinue(false),
|
|
950
|
+
handleSkip: () => handleContinue(true),
|
|
951
|
+
isSubmitAnswerAllowed: true,
|
|
952
|
+
isSubmitAnswerDisabled: isSubmitAnswerDisabled
|
|
962
953
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CompletedExcercise.default, {
|
|
963
954
|
open: isCompletionModalOpen,
|
|
964
955
|
restartExcercise: handleRestartExercise,
|
|
@@ -176,6 +176,7 @@ function Pronouncer({
|
|
|
176
176
|
classes,
|
|
177
177
|
cx
|
|
178
178
|
} = useStyles();
|
|
179
|
+
const scrollRef = (0, _react.useRef)(null);
|
|
179
180
|
const [viewMoreTranslations, setViewMoreTranslations] = (0, _react.useState)(false);
|
|
180
181
|
const [currentPhraseText, setCurrentPhraseText] = (0, _react.useState)("");
|
|
181
182
|
const {
|
|
@@ -222,6 +223,12 @@ function Pronouncer({
|
|
|
222
223
|
}, [open, recognizing, finalTranscript]);
|
|
223
224
|
(0, _react.useEffect)(() => {
|
|
224
225
|
let timer;
|
|
226
|
+
if (scrollRef.current && (interimTranscript || finalTranscript)) {
|
|
227
|
+
scrollRef.current.scroll({
|
|
228
|
+
top: scrollRef.current.scrollHeight,
|
|
229
|
+
behavior: "smooth"
|
|
230
|
+
});
|
|
231
|
+
}
|
|
225
232
|
if (recognizing && interimTranscript === "" && finalTranscript === "") {
|
|
226
233
|
// Set a timer to stop listening if no audio is detected after 10 seconds
|
|
227
234
|
timer = setTimeout(() => {
|
|
@@ -479,6 +486,13 @@ function Pronouncer({
|
|
|
479
486
|
onClose: handleClose,
|
|
480
487
|
TransitionComponent: Transition,
|
|
481
488
|
"aria-labelledby": "pronunciation-exercise-dialog",
|
|
489
|
+
PaperProps: {
|
|
490
|
+
sx: {
|
|
491
|
+
display: 'flex',
|
|
492
|
+
flexDirection: 'column',
|
|
493
|
+
height: '100%'
|
|
494
|
+
}
|
|
495
|
+
},
|
|
482
496
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.AppBar, {
|
|
483
497
|
className: classes.appBar,
|
|
484
498
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Toolbar, {
|
|
@@ -574,240 +588,250 @@ function Pronouncer({
|
|
|
574
588
|
exercise: "Pronunciation"
|
|
575
589
|
})
|
|
576
590
|
})]
|
|
577
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
578
|
-
|
|
579
|
-
className: classes.root,
|
|
580
|
-
direction: "column",
|
|
581
|
-
justifyContent: "center",
|
|
582
|
-
alignItems: "center",
|
|
583
|
-
spacing: 2,
|
|
591
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
592
|
+
ref: scrollRef,
|
|
584
593
|
sx: {
|
|
585
|
-
|
|
586
|
-
|
|
594
|
+
overflowY: 'auto',
|
|
595
|
+
flexGrow: 1,
|
|
596
|
+
display: 'flex',
|
|
597
|
+
justifyContent: 'center',
|
|
598
|
+
alignItems: 'center'
|
|
587
599
|
},
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
600
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Grid, {
|
|
601
|
+
container: true,
|
|
602
|
+
className: classes.root,
|
|
603
|
+
direction: "column",
|
|
604
|
+
justifyContent: "center",
|
|
605
|
+
alignItems: "center",
|
|
606
|
+
spacing: 2,
|
|
607
|
+
sx: {
|
|
608
|
+
maxWidth: "lg",
|
|
609
|
+
mx: "auto"
|
|
610
|
+
},
|
|
611
|
+
component: "main",
|
|
612
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
613
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
614
|
+
title: t("pronounce_this_phrase"),
|
|
615
|
+
placement: "top",
|
|
616
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
617
|
+
variant: "h6",
|
|
618
|
+
component: "h2",
|
|
619
|
+
color: "inherit",
|
|
620
|
+
children: t("pronounce_this_phrase", {
|
|
621
|
+
lng: languageTag
|
|
622
|
+
})
|
|
599
623
|
})
|
|
600
624
|
})
|
|
601
|
-
})
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
alt: ""
|
|
612
|
-
})
|
|
613
|
-
})
|
|
614
|
-
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
615
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Grid, {
|
|
616
|
-
container: true,
|
|
617
|
-
direction: "row",
|
|
618
|
-
justifyContent: "center",
|
|
619
|
-
alignItems: "center",
|
|
620
|
-
spacing: "1",
|
|
621
|
-
children: [question && question.pronunciations && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
622
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
623
|
-
variant: "body1",
|
|
624
|
-
color: "textSecondary",
|
|
625
|
-
gutterBottom: true,
|
|
626
|
-
children: question && question.pronunciations[0]
|
|
625
|
+
}), image ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
626
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
627
|
+
sx: {
|
|
628
|
+
textAlign: "center",
|
|
629
|
+
mx: "auto"
|
|
630
|
+
},
|
|
631
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
632
|
+
src: image,
|
|
633
|
+
className: classes.image,
|
|
634
|
+
alt: ""
|
|
627
635
|
})
|
|
628
|
-
})
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
636
|
+
})
|
|
637
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
638
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Grid, {
|
|
639
|
+
container: true,
|
|
640
|
+
direction: "row",
|
|
641
|
+
justifyContent: "center",
|
|
642
|
+
alignItems: "center",
|
|
643
|
+
spacing: "1",
|
|
644
|
+
children: [question && question.pronunciations && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
645
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
646
|
+
variant: "body1",
|
|
632
647
|
color: "textSecondary",
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
onClick: () => handleMoreTranslations(),
|
|
636
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MoreHoriz.default, {})
|
|
648
|
+
gutterBottom: true,
|
|
649
|
+
children: question && question.pronunciations[0]
|
|
637
650
|
})
|
|
638
|
-
})
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
} else {
|
|
643
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
644
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Typography, {
|
|
645
|
-
variant: "body1",
|
|
651
|
+
}), question && question.pronunciations && question.pronunciations[1] && !viewMoreTranslations && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
652
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
653
|
+
title: t("see_more_pronunciations"),
|
|
654
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
646
655
|
color: "textSecondary",
|
|
647
|
-
|
|
648
|
-
|
|
656
|
+
edge: "end",
|
|
657
|
+
size: "small",
|
|
658
|
+
onClick: () => handleMoreTranslations(),
|
|
659
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MoreHoriz.default, {})
|
|
649
660
|
})
|
|
650
|
-
});
|
|
651
|
-
}
|
|
652
|
-
})]
|
|
653
|
-
})
|
|
654
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
655
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
656
|
-
container: true,
|
|
657
|
-
spacing: 1,
|
|
658
|
-
justifyContent: "center",
|
|
659
|
-
alignItems: "center",
|
|
660
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
661
|
-
sx: {
|
|
662
|
-
display: "flex",
|
|
663
|
-
justifyContent: "center",
|
|
664
|
-
flexDirection: "row",
|
|
665
|
-
spacing: "5px"
|
|
666
|
-
},
|
|
667
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
668
|
-
sx: {
|
|
669
|
-
display: "flex",
|
|
670
|
-
justifyContent: "center"
|
|
671
|
-
},
|
|
672
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
673
|
-
src: getVoiceImage(),
|
|
674
|
-
className: classes.nualaSpeaking,
|
|
675
|
-
alt: ""
|
|
676
661
|
})
|
|
677
|
-
}),
|
|
662
|
+
}), viewMoreTranslations && question.pronunciations && question.pronunciations[1] && question.pronunciations.map((t, index) => {
|
|
663
|
+
if (index === 0) {
|
|
664
|
+
return null;
|
|
665
|
+
} else {
|
|
666
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
667
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Typography, {
|
|
668
|
+
variant: "body1",
|
|
669
|
+
color: "textSecondary",
|
|
670
|
+
gutterBottom: true,
|
|
671
|
+
children: ["| ", t]
|
|
672
|
+
})
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
})]
|
|
676
|
+
})
|
|
677
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
678
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
679
|
+
container: true,
|
|
680
|
+
spacing: 1,
|
|
681
|
+
justifyContent: "center",
|
|
682
|
+
alignItems: "center",
|
|
683
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
678
684
|
sx: {
|
|
679
|
-
display: "
|
|
680
|
-
justifyContent: "
|
|
681
|
-
|
|
685
|
+
display: "flex",
|
|
686
|
+
justifyContent: "center",
|
|
687
|
+
flexDirection: "row",
|
|
688
|
+
spacing: "5px"
|
|
682
689
|
},
|
|
683
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
voiceSpeed: voiceSpeed,
|
|
693
|
-
forLang: forLang,
|
|
694
|
-
wordList: currentPhrase ? (0, _utils.removeExtraWhiteSpaces)(currentPhrase.phrase).split(" ") : [],
|
|
695
|
-
disableTranslation: false,
|
|
696
|
-
isMessage: false,
|
|
697
|
-
muteSound: muteSound,
|
|
698
|
-
t: t
|
|
699
|
-
}), learnLang !== "irish" && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
700
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_WaveFormLite.default, {
|
|
701
|
-
src: pollyResult ? pollyResult : "",
|
|
702
|
-
controls: false,
|
|
703
|
-
isSpeaking: isSpeaking,
|
|
704
|
-
recognizing: recognizing,
|
|
705
|
-
muteAudio: true,
|
|
706
|
-
handleSpeak: () => {
|
|
707
|
-
speak(currentPhrase.phrase, voice, false, "#currentPhrase", voiceLanguageCode, false, voicePitch);
|
|
708
|
-
},
|
|
709
|
-
theme: theme
|
|
690
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
691
|
+
sx: {
|
|
692
|
+
display: "flex",
|
|
693
|
+
justifyContent: "center"
|
|
694
|
+
},
|
|
695
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
696
|
+
src: getVoiceImage(),
|
|
697
|
+
className: classes.nualaSpeaking,
|
|
698
|
+
alt: ""
|
|
710
699
|
})
|
|
700
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
701
|
+
sx: {
|
|
702
|
+
display: "grid",
|
|
703
|
+
justifyContent: "flex-end",
|
|
704
|
+
marginLeft: 1
|
|
705
|
+
},
|
|
706
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChatBubble.default, {
|
|
707
|
+
id: "currentPhrase",
|
|
708
|
+
handleTranslate: handleTranslate,
|
|
709
|
+
handleSpeak: handleSpeak,
|
|
710
|
+
clearQueue: clearQueue,
|
|
711
|
+
stopAudio: stopAudio,
|
|
712
|
+
learnLang: learnLang,
|
|
713
|
+
voice: voice || null,
|
|
714
|
+
voicePitch: voicePitch || null,
|
|
715
|
+
voiceSpeed: voiceSpeed,
|
|
716
|
+
forLang: forLang,
|
|
717
|
+
wordList: currentPhrase ? (0, _utils.removeExtraWhiteSpaces)(currentPhrase.phrase).split(" ") : [],
|
|
718
|
+
disableTranslation: false,
|
|
719
|
+
isMessage: false,
|
|
720
|
+
muteSound: muteSound,
|
|
721
|
+
t: t
|
|
722
|
+
}), learnLang !== "irish" && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
723
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_WaveFormLite.default, {
|
|
724
|
+
src: pollyResult ? pollyResult : "",
|
|
725
|
+
controls: false,
|
|
726
|
+
isSpeaking: isSpeaking,
|
|
727
|
+
recognizing: recognizing,
|
|
728
|
+
muteAudio: true,
|
|
729
|
+
handleSpeak: () => {
|
|
730
|
+
speak(currentPhrase.phrase, voice, false, "#currentPhrase", voiceLanguageCode, false, voicePitch);
|
|
731
|
+
},
|
|
732
|
+
theme: theme
|
|
733
|
+
})
|
|
734
|
+
})]
|
|
711
735
|
})]
|
|
712
|
-
})
|
|
736
|
+
})
|
|
713
737
|
})
|
|
714
|
-
})
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
738
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
739
|
+
sx: {
|
|
740
|
+
marginTop: 1
|
|
741
|
+
},
|
|
742
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
743
|
+
sx: theme => ({
|
|
744
|
+
[theme.breakpoints.down("md")]: {
|
|
745
|
+
height: "50px",
|
|
746
|
+
width: "200px",
|
|
747
|
+
color: "white",
|
|
748
|
+
padding: 2,
|
|
749
|
+
fontSize: "16px",
|
|
750
|
+
borderRadius: 3
|
|
751
|
+
},
|
|
752
|
+
height: "70px",
|
|
753
|
+
width: "250px",
|
|
724
754
|
color: "white",
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
755
|
+
backgroundColor: recognizing ? "#d32f2f" : "#2d7b30",
|
|
756
|
+
padding: 1,
|
|
757
|
+
fontSize: "20px",
|
|
758
|
+
borderRadius: 5,
|
|
759
|
+
border: "1.5px solid transparent",
|
|
760
|
+
"&:hover": {
|
|
761
|
+
backgroundColor: recognizing ? "#d32f2f" : "#2d7b30",
|
|
762
|
+
border: "1.5px solid black"
|
|
763
|
+
}
|
|
764
|
+
}),
|
|
765
|
+
onClick: () => handleMic(currentPhrase ? currentPhrase.phrase : ""),
|
|
766
|
+
startIcon: recognizing ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_MicOff.default, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Mic.default, {}),
|
|
767
|
+
color: recognizing ? "error" : "success",
|
|
768
|
+
disabled: isSpeaking || !isSocketConnected || isRecognizingDisabled,
|
|
769
|
+
id: "voiceInput",
|
|
770
|
+
variant: "contained",
|
|
771
|
+
ref: btnRef,
|
|
772
|
+
children: recognizing ? t("click_to_stop") : t("click_to_start")
|
|
773
|
+
})
|
|
774
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
775
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
776
|
+
role: "status",
|
|
777
|
+
sx: {
|
|
778
|
+
mt: isListeningIndicatorTextVisible ? 3 : 0
|
|
728
779
|
},
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
color: "white",
|
|
732
|
-
backgroundColor: recognizing ? "#d32f2f" : "#2d7b30",
|
|
733
|
-
padding: 1,
|
|
780
|
+
textAlign: "center",
|
|
781
|
+
fontWeight: "bolder",
|
|
734
782
|
fontSize: "20px",
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
"
|
|
738
|
-
backgroundColor: recognizing ? "#d32f2f" : "#2d7b30",
|
|
739
|
-
border: "1.5px solid black"
|
|
740
|
-
}
|
|
741
|
-
}),
|
|
742
|
-
onClick: () => handleMic(currentPhrase ? currentPhrase.phrase : ""),
|
|
743
|
-
startIcon: recognizing ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_MicOff.default, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Mic.default, {}),
|
|
744
|
-
color: recognizing ? "error" : "success",
|
|
745
|
-
disabled: isSpeaking || !isSocketConnected || isRecognizingDisabled,
|
|
746
|
-
id: "voiceInput",
|
|
747
|
-
variant: "contained",
|
|
748
|
-
ref: btnRef,
|
|
749
|
-
children: recognizing ? t("click_to_stop") : t("click_to_start")
|
|
750
|
-
})
|
|
751
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
752
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
753
|
-
role: "status",
|
|
754
|
-
sx: {
|
|
755
|
-
mt: isListeningIndicatorTextVisible ? 3 : 0
|
|
756
|
-
},
|
|
757
|
-
textAlign: "center",
|
|
758
|
-
fontWeight: "bolder",
|
|
759
|
-
fontSize: "20px",
|
|
760
|
-
"aria-label": "Mic is",
|
|
761
|
-
"aria-live": "polite",
|
|
762
|
-
children: isListeningIndicatorTextVisible ? t("listening_indicator") : ""
|
|
763
|
-
})
|
|
764
|
-
}), finalTranscript || interimTranscript ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Grid, {
|
|
765
|
-
alignItems: "center",
|
|
766
|
-
className: classes.setWidth,
|
|
767
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
768
|
-
title: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
769
|
-
children: `Confidence: ${((transcriptConfidence || 0) * 100).toFixed(0)}%`
|
|
770
|
-
}),
|
|
771
|
-
open: isConfidenceOpen,
|
|
772
|
-
onClose: handleCloseConfidence,
|
|
773
|
-
onOpen: handleOpenConfidence,
|
|
774
|
-
role: "status",
|
|
775
|
-
"aria-live": "assertive",
|
|
776
|
-
"aria-label": `Confidence: ${(transcriptConfidence * 100).toFixed(0)}%`,
|
|
777
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
778
|
-
children: (finalTranscript || interimTranscript).split(" ").map((word, i) => {
|
|
779
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
780
|
-
className: classes.finalTranscript,
|
|
781
|
-
variant: "h5",
|
|
782
|
-
color: phraseWordList[i] && checkIsPronunciationCorrect(word.trim(), {
|
|
783
|
-
phrase: phraseWordList[i].trim(),
|
|
784
|
-
alternativeVersions: currentPhrase.alternativeVersions ? currentPhrase.alternativeVersions.map(altAns => {
|
|
785
|
-
return altAns ? (0, _utils.removeExtraWhiteSpaces)(altAns).split(" ")[i] : "";
|
|
786
|
-
}) : []
|
|
787
|
-
}) ? "secondary" : "",
|
|
788
|
-
component: "span",
|
|
789
|
-
children: word
|
|
790
|
-
});
|
|
791
|
-
})
|
|
783
|
+
"aria-label": "Mic is",
|
|
784
|
+
"aria-live": "polite",
|
|
785
|
+
children: isListeningIndicatorTextVisible ? t("listening_indicator") : ""
|
|
792
786
|
})
|
|
793
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
787
|
+
}), finalTranscript || interimTranscript ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Grid, {
|
|
788
|
+
alignItems: "center",
|
|
789
|
+
className: classes.setWidth,
|
|
790
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
791
|
+
title: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
792
|
+
children: `Confidence: ${((transcriptConfidence || 0) * 100).toFixed(0)}%`
|
|
793
|
+
}),
|
|
794
|
+
open: isConfidenceOpen,
|
|
795
|
+
onClose: handleCloseConfidence,
|
|
796
|
+
onOpen: handleOpenConfidence,
|
|
797
|
+
role: "status",
|
|
798
|
+
"aria-live": "assertive",
|
|
799
|
+
"aria-label": `Confidence: ${(transcriptConfidence * 100).toFixed(0)}%`,
|
|
800
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
801
|
+
children: (finalTranscript || interimTranscript).split(" ").map((word, i) => {
|
|
802
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
803
|
+
className: classes.finalTranscript,
|
|
804
|
+
variant: "h5",
|
|
805
|
+
color: phraseWordList[i] && checkIsPronunciationCorrect(word.trim(), {
|
|
806
|
+
phrase: phraseWordList[i].trim(),
|
|
807
|
+
alternativeVersions: currentPhrase.alternativeVersions ? currentPhrase.alternativeVersions.map(altAns => {
|
|
808
|
+
return altAns ? (0, _utils.removeExtraWhiteSpaces)(altAns).split(" ")[i] : "";
|
|
809
|
+
}) : []
|
|
810
|
+
}) ? "secondary" : "",
|
|
811
|
+
component: "span",
|
|
812
|
+
children: word
|
|
813
|
+
});
|
|
814
|
+
})
|
|
815
|
+
})
|
|
816
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
817
|
+
onClick: handleReset,
|
|
818
|
+
size: "small",
|
|
819
|
+
className: classes.listenButton,
|
|
820
|
+
"aria-label": "Clear",
|
|
821
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Clear.default, {
|
|
822
|
+
className: cx(classes.iconSmall)
|
|
823
|
+
})
|
|
824
|
+
})]
|
|
825
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
826
|
+
className: classes.waveform,
|
|
827
|
+
"aria-labelledby": finalTranscript,
|
|
828
|
+
children: attemptAudioURL && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Waveform.default, {
|
|
829
|
+
src: attemptAudioURL,
|
|
830
|
+
theme: theme,
|
|
831
|
+
controls: true
|
|
800
832
|
})
|
|
801
833
|
})]
|
|
802
|
-
})
|
|
803
|
-
className: classes.waveform,
|
|
804
|
-
"aria-labelledby": finalTranscript,
|
|
805
|
-
children: attemptAudioURL && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Waveform.default, {
|
|
806
|
-
src: attemptAudioURL,
|
|
807
|
-
theme: theme,
|
|
808
|
-
controls: true
|
|
809
|
-
})
|
|
810
|
-
})]
|
|
834
|
+
})
|
|
811
835
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExerciseBottomBar.default, {
|
|
812
836
|
t: t,
|
|
813
837
|
handleSubmit: () => handleContinue(false, currentPhrase),
|
|
@@ -44,7 +44,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
44
44
|
|
|
45
45
|
const useStyles = (0, _mui.makeStyles)()(theme => ({
|
|
46
46
|
appBar: {
|
|
47
|
-
position: "
|
|
47
|
+
position: "relative",
|
|
48
48
|
paddingTop: `env(safe-area-inset-top)`,
|
|
49
49
|
paddingRight: `env(safe-area-inset-right)`,
|
|
50
50
|
paddingLeft: `env(safe-area-inset-left)`
|
|
@@ -252,6 +252,7 @@ function Translator({
|
|
|
252
252
|
const {
|
|
253
253
|
classes
|
|
254
254
|
} = useStyles();
|
|
255
|
+
const scrollRef = (0, _react.useRef)(null);
|
|
255
256
|
const [wordBankTooltipOpen, setWordBankTooltipOpen] = (0, _react.useState)(false);
|
|
256
257
|
const initialVoiceSpeed = topicInfo && topicInfo.voiceSpeed ? topicInfo.voiceSpeed : "";
|
|
257
258
|
const exerciseState = (0, _useExerciseState.default)({
|
|
@@ -464,6 +465,14 @@ function Translator({
|
|
|
464
465
|
(0, _react.useEffect)(() => {
|
|
465
466
|
checkAnswer && checkCompletionAndNotify();
|
|
466
467
|
}, [checkAnswer]);
|
|
468
|
+
(0, _react.useEffect)(() => {
|
|
469
|
+
if (scrollRef.current && useWordBank) {
|
|
470
|
+
scrollRef.current.scroll({
|
|
471
|
+
top: scrollRef.current.scrollHeight,
|
|
472
|
+
behavior: "smooth"
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
}, [useWordBank]);
|
|
467
476
|
(0, _react.useEffect)(() => {
|
|
468
477
|
if (open && !run && !localStorage.getItem(`translation-exercise-tour-completed`)) {
|
|
469
478
|
setJoyrideState(prevState => ({
|
|
@@ -542,6 +551,9 @@ function Translator({
|
|
|
542
551
|
const goBackToAssignment = () => {
|
|
543
552
|
navigate(`/classrooms/${classroomId}#Assignments`);
|
|
544
553
|
};
|
|
554
|
+
const noTranslationWords = !translationWords || translationWords.length === 0;
|
|
555
|
+
const isWordBankMode = useWordBank && isWordBankEnabled;
|
|
556
|
+
const isSubmitAnswerDisabled = isWordBankMode ? !isWordBankAttemptChanged || noTranslationWords : !translationText && noTranslationWords;
|
|
545
557
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Dialog, {
|
|
546
558
|
fullScreen: true,
|
|
547
559
|
open: open,
|
|
@@ -652,9 +664,13 @@ function Translator({
|
|
|
652
664
|
})
|
|
653
665
|
})]
|
|
654
666
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
667
|
+
ref: scrollRef,
|
|
655
668
|
sx: {
|
|
669
|
+
overflowY: 'auto',
|
|
656
670
|
flexGrow: 1,
|
|
657
|
-
|
|
671
|
+
display: 'flex',
|
|
672
|
+
justifyContent: 'center',
|
|
673
|
+
alignItems: 'center'
|
|
658
674
|
},
|
|
659
675
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Grid, {
|
|
660
676
|
container: true,
|
|
@@ -907,38 +923,13 @@ function Translator({
|
|
|
907
923
|
})]
|
|
908
924
|
})]
|
|
909
925
|
})
|
|
910
|
-
}),
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExerciseBottomBar.default, {
|
|
918
|
-
t: t,
|
|
919
|
-
translationWords: translationWords,
|
|
920
|
-
handleSubmit: () => handleContinue(false),
|
|
921
|
-
handleSkip: () => handleContinue(true),
|
|
922
|
-
isSubmitAnswerAllowed: true,
|
|
923
|
-
isSubmitAnswerDisabled: !isWordBankAttemptChanged || !translationWords || translationWords.length === 0,
|
|
924
|
-
useWordBank: useWordBank
|
|
925
|
-
})
|
|
926
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
927
|
-
sx: {
|
|
928
|
-
position: 'sticky',
|
|
929
|
-
bottom: 0,
|
|
930
|
-
zIndex: 1100,
|
|
931
|
-
backgroundColor: theme => theme.palette.background.paper
|
|
932
|
-
},
|
|
933
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExerciseBottomBar.default, {
|
|
934
|
-
t: t,
|
|
935
|
-
translationWords: translationWords,
|
|
936
|
-
handleSubmit: () => handleContinue(false),
|
|
937
|
-
handleSkip: () => handleContinue(true),
|
|
938
|
-
isSubmitAnswerAllowed: true,
|
|
939
|
-
isSubmitAnswerDisabled: !translationText && (!translationWords || translationWords.length === 0),
|
|
940
|
-
useWordBank: useWordBank
|
|
941
|
-
})
|
|
926
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExerciseBottomBar.default, {
|
|
927
|
+
t: t,
|
|
928
|
+
translationWords: translationWords,
|
|
929
|
+
handleSubmit: () => handleContinue(false),
|
|
930
|
+
handleSkip: () => handleContinue(true),
|
|
931
|
+
isSubmitAnswerAllowed: true,
|
|
932
|
+
isSubmitAnswerDisabled: isSubmitAnswerDisabled
|
|
942
933
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_AnswerResult.default, {
|
|
943
934
|
t: t,
|
|
944
935
|
open: isCorrectResultOpen,
|
|
@@ -27,19 +27,19 @@ const useStyles = (0, _mui.makeStyles)()(theme => ({
|
|
|
27
27
|
gridAutoFlow: "column"
|
|
28
28
|
},
|
|
29
29
|
gridListTileRoot: {
|
|
30
|
-
[theme.breakpoints.up("sm")]: {
|
|
31
|
-
minWidth: 380
|
|
32
|
-
},
|
|
33
30
|
height: "auto",
|
|
34
|
-
minWidth:
|
|
31
|
+
minWidth: {
|
|
32
|
+
xs: 330,
|
|
33
|
+
sm: 380
|
|
34
|
+
},
|
|
35
35
|
padding: theme.spacing(0.75, 0.75, 2, 0.75)
|
|
36
36
|
},
|
|
37
37
|
gridListItemRoot: {
|
|
38
|
-
[theme.breakpoints.up("sm")]: {
|
|
39
|
-
minWidth: 380
|
|
40
|
-
},
|
|
41
38
|
height: "auto",
|
|
42
|
-
minWidth:
|
|
39
|
+
minWidth: {
|
|
40
|
+
xs: 330,
|
|
41
|
+
sm: 380
|
|
42
|
+
}
|
|
43
43
|
}
|
|
44
44
|
}));
|
|
45
45
|
function CourseList({
|
|
@@ -111,10 +111,22 @@ function CourseList({
|
|
|
111
111
|
cols: singleLineGridCols,
|
|
112
112
|
rowHeight: "auto",
|
|
113
113
|
gap: 0,
|
|
114
|
+
sx: {
|
|
115
|
+
display: 'flex',
|
|
116
|
+
gridAutoFlow: 'column',
|
|
117
|
+
justifyContent: 'flex-start'
|
|
118
|
+
},
|
|
114
119
|
children: [items.map(course => {
|
|
115
120
|
const selected = selectedCourses.includes(course.courseId);
|
|
116
121
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ImageListItem, {
|
|
117
122
|
className: classes.gridListTileRoot,
|
|
123
|
+
sx: {
|
|
124
|
+
flex: '0 0 auto',
|
|
125
|
+
width: {
|
|
126
|
+
xs: 330,
|
|
127
|
+
sm: 380
|
|
128
|
+
} // Stop flex overwriting
|
|
129
|
+
},
|
|
118
130
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Course.default, {
|
|
119
131
|
t: t,
|
|
120
132
|
course: course,
|
|
@@ -139,6 +151,13 @@ function CourseList({
|
|
|
139
151
|
}), (items || []).length < (courses || []).length && new Array(3).fill(null).map((_, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ImageListItem, {
|
|
140
152
|
className: classes.gridListTileRoot,
|
|
141
153
|
ref: index === 0 ? ref : null,
|
|
154
|
+
sx: {
|
|
155
|
+
flex: '0 0 auto',
|
|
156
|
+
width: {
|
|
157
|
+
xs: 330,
|
|
158
|
+
sm: 380
|
|
159
|
+
}
|
|
160
|
+
},
|
|
142
161
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Course.default, {
|
|
143
162
|
t: t
|
|
144
163
|
})
|
|
@@ -10,7 +10,7 @@ var _material = require("@mui/material");
|
|
|
10
10
|
var _Person = _interopRequireDefault(require("@mui/icons-material/Person"));
|
|
11
11
|
var _Skeleton = _interopRequireDefault(require("@mui/material/Skeleton"));
|
|
12
12
|
var _Members = _interopRequireDefault(require("../../Misc/NotFound/Members"));
|
|
13
|
-
var
|
|
13
|
+
var _reactFlipToolkit = require("react-flip-toolkit");
|
|
14
14
|
var _system = require("@mui/system");
|
|
15
15
|
var _TrendingUp = _interopRequireDefault(require("@mui/icons-material/TrendingUp"));
|
|
16
16
|
var _TrendingDown = _interopRequireDefault(require("@mui/icons-material/TrendingDown"));
|
|
@@ -293,25 +293,30 @@ function MemberList(props) {
|
|
|
293
293
|
children: [members.length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Members.default, {
|
|
294
294
|
t: t,
|
|
295
295
|
placeholderImageUrl: placeholderImageUrl
|
|
296
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
297
|
-
|
|
298
|
-
children:
|
|
299
|
-
|
|
300
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
296
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFlipToolkit.Flipper, {
|
|
297
|
+
flipKey: members.map(m => m.memberId).join(','),
|
|
298
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
299
|
+
className: "member-list",
|
|
300
|
+
children: members.map(member => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFlipToolkit.Flipped, {
|
|
301
|
+
flipId: member.memberId,
|
|
302
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
303
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Member, {
|
|
304
|
+
member: member,
|
|
305
|
+
isCreator: isCreator,
|
|
306
|
+
isCourseMember: isCourseMember,
|
|
307
|
+
t: t,
|
|
308
|
+
lastTwoIndexes: gameMembersHistory.slice(-2).map(members => members.find(m => m.memberId === member.memberId)?.index),
|
|
309
|
+
lastFourScores: gameMembersHistory.slice(-4).map(members => members.find(m => m.memberId === member.memberId)?.score),
|
|
310
|
+
topThreeScores: topThreeScores,
|
|
311
|
+
remainingQuestions: remainingQuestions,
|
|
312
|
+
numOfCorrectAnswers: numOfCorrectAnswers,
|
|
313
|
+
isIconsVisible: isIconsVisible,
|
|
314
|
+
showRoleplayLeaderboardIcons: showRoleplayLeaderboardIcons,
|
|
315
|
+
lastThreeAnswerResults: gameMembersHistory.slice(-3).map(members => members.find(m => m.memberId === member.memberId)?.isCorrect)
|
|
316
|
+
})
|
|
317
|
+
})
|
|
318
|
+
}, member.memberId))
|
|
319
|
+
})
|
|
315
320
|
})]
|
|
316
321
|
});
|
|
317
322
|
}
|
|
@@ -330,7 +335,7 @@ function Leaderboard({
|
|
|
330
335
|
numOfCorrectAnswers,
|
|
331
336
|
isIconsVisible,
|
|
332
337
|
showRoleplayLeaderboardIcons,
|
|
333
|
-
exercise,
|
|
338
|
+
exercise = '',
|
|
334
339
|
handleNext,
|
|
335
340
|
nextScriptLine,
|
|
336
341
|
setIsIconsVisible
|
|
@@ -35,7 +35,8 @@ function GameControls({
|
|
|
35
35
|
}),
|
|
36
36
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Grid, {
|
|
37
37
|
sx: {
|
|
38
|
-
ml: 2
|
|
38
|
+
ml: 2,
|
|
39
|
+
mt: 1
|
|
39
40
|
},
|
|
40
41
|
component: _material.Typography,
|
|
41
42
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Typography, {
|
|
@@ -56,6 +57,7 @@ function GameControls({
|
|
|
56
57
|
}
|
|
57
58
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
58
59
|
mr: 2,
|
|
60
|
+
mt: 1,
|
|
59
61
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
60
62
|
color: "primary",
|
|
61
63
|
onClick: handleTimeUp,
|
|
@@ -12,10 +12,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
const useStyles = (0, _mui.makeStyles)()(theme => ({
|
|
14
14
|
footer: {
|
|
15
|
-
|
|
16
|
-
padding: theme.spacing(2)
|
|
17
|
-
},
|
|
18
|
-
padding: theme.spacing(3),
|
|
15
|
+
padding: theme.spacing(2),
|
|
19
16
|
borderTop: `2px solid ${theme.palette.grey[300]}`
|
|
20
17
|
}
|
|
21
18
|
}));
|
|
@@ -34,26 +31,17 @@ function ExerciseBottomBar({
|
|
|
34
31
|
setCurrentAnswer,
|
|
35
32
|
translationText,
|
|
36
33
|
translationWords,
|
|
37
|
-
exercise
|
|
38
|
-
useWordBank
|
|
34
|
+
exercise
|
|
39
35
|
}) {
|
|
40
36
|
const {
|
|
41
37
|
classes
|
|
42
38
|
} = useStyles();
|
|
43
|
-
const submitButtonRef = (0, _react.useRef)(null);
|
|
44
39
|
(0, _react.useEffect)(() => {
|
|
45
40
|
if (isTimeUp) {
|
|
46
41
|
handleSubmit();
|
|
47
42
|
setIsAnswered(true);
|
|
48
43
|
}
|
|
49
44
|
}, [isTimeUp]);
|
|
50
|
-
(0, _react.useEffect)(() => {
|
|
51
|
-
if (submitButtonRef.current && useWordBank) {
|
|
52
|
-
submitButtonRef.current.scrollIntoView({
|
|
53
|
-
behavior: "smooth"
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}, [useWordBank]);
|
|
57
45
|
const handleAnswerButtonClick = () => {
|
|
58
46
|
if (isLive && isAnswered) {
|
|
59
47
|
setIsAnswered(false);
|
|
@@ -85,7 +73,6 @@ function ExerciseBottomBar({
|
|
|
85
73
|
})
|
|
86
74
|
}), (isLive || isSubmitAnswerAllowed) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
87
75
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
88
|
-
ref: submitButtonRef,
|
|
89
76
|
color: isLive && isAnswered ? "primary" : "secondary",
|
|
90
77
|
variant: isAnswered ? "outlined" : "contained",
|
|
91
78
|
onClick: handleAnswerButtonClick,
|
|
@@ -499,9 +499,6 @@ function Classroom({
|
|
|
499
499
|
(0, _react.useEffect)(() => {
|
|
500
500
|
if (!condition || !cId) return;
|
|
501
501
|
const lastFetched = initialStored.current[cId] || 0;
|
|
502
|
-
console.log({
|
|
503
|
-
lastFetched
|
|
504
|
-
});
|
|
505
502
|
const hasNew = assignments.some(item => item.updatedAt && Number(item.updatedAt) > lastFetched);
|
|
506
503
|
setHasNewAssignments(hasNew);
|
|
507
504
|
if (hasNew) {
|
|
@@ -216,7 +216,7 @@ function Progress({
|
|
|
216
216
|
} else {
|
|
217
217
|
return [];
|
|
218
218
|
}
|
|
219
|
-
}, [
|
|
219
|
+
}, [currentCourses, courseSectionsQueriesIsLoading]);
|
|
220
220
|
const deleteCourseId = () => {
|
|
221
221
|
if ("URLSearchParams" in window) {
|
|
222
222
|
const searchParams = (0, _utils2.searchStringToObj)(window.location.search);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nualang/nualang-ui-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1248",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@dnd-kit/core": "6.3.1",
|
|
15
|
+
"@dnd-kit/modifiers": "9.0.0",
|
|
15
16
|
"@dnd-kit/sortable": "10.0.0",
|
|
16
17
|
"@dnd-kit/utilities": "3.2.2",
|
|
17
|
-
"@dnd-kit/modifiers": "9.0.0",
|
|
18
18
|
"@emotion/react": "^11.13",
|
|
19
19
|
"@emotion/styled": "^11.13",
|
|
20
20
|
"@hookform/resolvers": "^3.6.0",
|
|
@@ -67,7 +67,6 @@
|
|
|
67
67
|
"react-dropzone": "^14.2.3",
|
|
68
68
|
"react-easy-crop": "^5.0.0",
|
|
69
69
|
"react-feather": "^2.0",
|
|
70
|
-
"react-flip-move": "^3.0.5",
|
|
71
70
|
"react-flip-toolkit": "^7.1.0",
|
|
72
71
|
"react-hook-form": "^7.52.0",
|
|
73
72
|
"react-i18next": "^15.4.1",
|
|
@@ -111,7 +110,6 @@
|
|
|
111
110
|
"@mui/x-date-pickers": "^7.28.3",
|
|
112
111
|
"@nualang/eslint-config-nualang": "0.2.0-alpha-4",
|
|
113
112
|
"@react-theming/storybook-addon": "^1.1.10",
|
|
114
|
-
"react-router-dom": "^6.30.0",
|
|
115
113
|
"@storybook/addon-actions": "^8.6.12",
|
|
116
114
|
"@storybook/addon-essentials": "^8.6.12",
|
|
117
115
|
"@storybook/addon-links": "^8.6.12",
|
|
@@ -129,11 +127,13 @@
|
|
|
129
127
|
"@testing-library/dom": "^10.4.0",
|
|
130
128
|
"@testing-library/react": "^16.3.0",
|
|
131
129
|
"babel-plugin-macros": "^3.1.0",
|
|
130
|
+
"chalk": "^5.4.1",
|
|
132
131
|
"clsx": "^2.0.0",
|
|
133
132
|
"cross-env": "^7.0.3",
|
|
134
133
|
"eslint": "^9.24.0",
|
|
135
134
|
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
136
135
|
"eslint-plugin-react-hooks": "^5.1.0",
|
|
136
|
+
"glob": "^11.0.2",
|
|
137
137
|
"globals": "^16.0.0",
|
|
138
138
|
"intersection-observer": "^0.12.0",
|
|
139
139
|
"jsdom": "^26.1.0",
|
|
@@ -141,9 +141,11 @@
|
|
|
141
141
|
"prettier": "^3.2.5",
|
|
142
142
|
"react": "19.1.0",
|
|
143
143
|
"react-dom": "19.1.0",
|
|
144
|
+
"react-router-dom": "^6.30.0",
|
|
144
145
|
"react-scripts": "^5.0.1",
|
|
145
146
|
"storybook": "^8.6.12",
|
|
146
|
-
"vitest": "^3.1.1"
|
|
147
|
+
"vitest": "^3.1.1",
|
|
148
|
+
"zx": "^8.5.4"
|
|
147
149
|
},
|
|
148
150
|
"scripts": {
|
|
149
151
|
"postinstall": "patch-package",
|