@nualang/nualang-ui-components 0.1.1283 → 0.1.1285
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/Chat/BottomBar/BottomBar.js +5 -5
- package/dist/Chat/Chat.js +2 -2
- package/dist/Editors/Bot/Editor/BotDesigner/VarList.js +9 -1
- package/dist/Exercises/Bot/Bot.js +1 -1
- package/dist/Exercises/Listener/Listener.js +33 -25
- package/dist/Exercises/Translator/Translator.js +44 -35
- package/dist/Forms/CreateBot/CreateBot.js +1 -1
- package/dist/Forms/CreateBot/Steps/BotSettings/BotSettings.js +8 -9
- package/dist/Forms/CreateBot/Steps/Confirmation/Confirmation.js +6 -7
- package/dist/Forms/UpdateBot/UpdateBot.js +3 -3
- package/dist/Lists/Exercises/Exercises.js +22 -22
- package/dist/Lists/Members/Members.js +17 -17
- package/dist/Misc/ExerciseBottomBar/ExerciseBottomBar.js +3 -1
- package/dist/Navigation/ResponsiveTabs/ResponsiveTabs.js +1 -24
- package/dist/Screens/Classrooms/SearchClassrooms/SearchClassrooms.js +1 -0
- package/dist/Screens/Courses/ViewCourse/ViewTopic/ViewTopic.js +5 -5
- package/dist/hooks/useClassroomState.js +4 -4
- package/dist/utils/index.js +7 -5
- package/package.json +2 -2
|
@@ -100,7 +100,7 @@ function BottomBar({
|
|
|
100
100
|
finalTranscript,
|
|
101
101
|
inputRef,
|
|
102
102
|
authenticated,
|
|
103
|
-
|
|
103
|
+
isChallengeBot = false
|
|
104
104
|
}) {
|
|
105
105
|
const {
|
|
106
106
|
classes
|
|
@@ -133,7 +133,7 @@ function BottomBar({
|
|
|
133
133
|
onKeyPress: handleKeyPress,
|
|
134
134
|
placeholder: placeholder,
|
|
135
135
|
inputProps: {
|
|
136
|
-
maxLength:
|
|
136
|
+
maxLength: isChallengeBot ? 600 : 200,
|
|
137
137
|
sx: theme => ({
|
|
138
138
|
"&::placeholder": {
|
|
139
139
|
color: theme.palette.mode === "light" ? _colors.grey[200] : _colors.grey[800],
|
|
@@ -143,7 +143,7 @@ function BottomBar({
|
|
|
143
143
|
},
|
|
144
144
|
disableUnderline: true,
|
|
145
145
|
multiline: true,
|
|
146
|
-
rows:
|
|
146
|
+
rows: isChallengeBot ? 3 : 1,
|
|
147
147
|
autoComplete: autoComplete,
|
|
148
148
|
inputRef: activeRef,
|
|
149
149
|
onClick: handleSelectCurrentInput,
|
|
@@ -158,12 +158,12 @@ function BottomBar({
|
|
|
158
158
|
variant: "caption",
|
|
159
159
|
sx: {
|
|
160
160
|
color: "inherit",
|
|
161
|
-
opacity: inputValue.length >= (
|
|
161
|
+
opacity: inputValue.length >= (isChallengeBot ? 600 : 200) ? 1 : 0.7,
|
|
162
162
|
marginRight: 1,
|
|
163
163
|
fontWeight: 700,
|
|
164
164
|
fontSize: "0.75rem"
|
|
165
165
|
},
|
|
166
|
-
children: `${inputValue.length}/${
|
|
166
|
+
children: `${inputValue.length}/${isChallengeBot ? 600 : 200}`
|
|
167
167
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputHelper.Adornment, {
|
|
168
168
|
t: t,
|
|
169
169
|
emoji: true,
|
package/dist/Chat/Chat.js
CHANGED
|
@@ -100,7 +100,7 @@ function Chat({
|
|
|
100
100
|
noAnswerCounts,
|
|
101
101
|
isDynamicResponsesEnabled,
|
|
102
102
|
isUserInternal,
|
|
103
|
-
|
|
103
|
+
isChallengeBot = false
|
|
104
104
|
}) {
|
|
105
105
|
const {
|
|
106
106
|
classes
|
|
@@ -202,7 +202,7 @@ function Chat({
|
|
|
202
202
|
inputRef: inputRef,
|
|
203
203
|
authenticated: authenticated,
|
|
204
204
|
placeholder: placeholder,
|
|
205
|
-
|
|
205
|
+
isChallengeBot: isChallengeBot
|
|
206
206
|
})]
|
|
207
207
|
});
|
|
208
208
|
}
|
|
@@ -203,7 +203,15 @@ function VarListItem({
|
|
|
203
203
|
type: "text",
|
|
204
204
|
multiline: true,
|
|
205
205
|
fullWidth: true,
|
|
206
|
-
onChange:
|
|
206
|
+
onChange: e => {
|
|
207
|
+
const cleaned = e.target.value.replace(/\s+/g, " ").trim();
|
|
208
|
+
handleUpdateVariable({
|
|
209
|
+
target: {
|
|
210
|
+
name: varName,
|
|
211
|
+
value: cleaned
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
},
|
|
207
215
|
onBlur: handleOnBlur,
|
|
208
216
|
onFocus: handleSelectCurrentInput,
|
|
209
217
|
inputProps: {
|
|
@@ -648,7 +648,7 @@ function Bot({
|
|
|
648
648
|
isSpeakingTextContainer: isSpeakingTextContainer,
|
|
649
649
|
isDynamicResponsesEnabled: isDynamicResponsesClassroomEnabled,
|
|
650
650
|
isUserInternal: isUserInternal,
|
|
651
|
-
|
|
651
|
+
isChallengeBot: bot.isChallengeBot
|
|
652
652
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ResponsiveDialog.default, {
|
|
653
653
|
open: instructionDialogOpen,
|
|
654
654
|
handleClose: handleCloseInstructions,
|
|
@@ -400,7 +400,7 @@ function Listener({
|
|
|
400
400
|
})]
|
|
401
401
|
}),
|
|
402
402
|
spotlightPadding: 8,
|
|
403
|
-
target: "#
|
|
403
|
+
target: "#listeningTextAnchor"
|
|
404
404
|
}, {
|
|
405
405
|
content: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
406
406
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
|
|
@@ -420,7 +420,8 @@ function Listener({
|
|
|
420
420
|
})]
|
|
421
421
|
}),
|
|
422
422
|
spotlightPadding: 8,
|
|
423
|
-
target: "#skipButton"
|
|
423
|
+
target: "#skipButton",
|
|
424
|
+
disableScrollParentFix: false
|
|
424
425
|
}, {
|
|
425
426
|
content: /*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
|
|
426
427
|
children: t("change_voice_speed")
|
|
@@ -842,30 +843,36 @@ function Listener({
|
|
|
842
843
|
width: "100%",
|
|
843
844
|
maxWidth: `250px !important`
|
|
844
845
|
},
|
|
845
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
onKeyDown: e => {
|
|
850
|
-
if (e.key === "Enter") {
|
|
851
|
-
handleContinue(false);
|
|
852
|
-
e.stopPropagation();
|
|
853
|
-
}
|
|
846
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
847
|
+
id: "listeningTextAnchor",
|
|
848
|
+
style: {
|
|
849
|
+
position: "relative"
|
|
854
850
|
},
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
851
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputHelper.default, {
|
|
852
|
+
t: t,
|
|
853
|
+
value: listeningText,
|
|
854
|
+
onChange: handleInputChange,
|
|
855
|
+
onKeyDown: e => {
|
|
856
|
+
if (e.key === "Enter") {
|
|
857
|
+
handleContinue(false);
|
|
858
|
+
e.stopPropagation();
|
|
859
|
+
}
|
|
860
|
+
},
|
|
861
|
+
id: "listeningText",
|
|
862
|
+
name: "listeningText",
|
|
863
|
+
label: t("language_phrase", {
|
|
864
|
+
language: (0, _index.capitalize)(t(learnLang.toLowerCase()))
|
|
865
|
+
}),
|
|
866
|
+
type: "text",
|
|
867
|
+
role: "textbox",
|
|
868
|
+
"aria-multiline": "true",
|
|
869
|
+
"aria-labelledby": "what-do-you-hear",
|
|
870
|
+
variant: "outlined",
|
|
871
|
+
fullWidth: true,
|
|
872
|
+
multiline: true,
|
|
873
|
+
autoComplete: "off",
|
|
874
|
+
characters: learnLangCharacters ? learnLangCharacters : null
|
|
875
|
+
})
|
|
869
876
|
})
|
|
870
877
|
}), isWordBankEnabled && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
871
878
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
@@ -989,6 +996,7 @@ function Listener({
|
|
|
989
996
|
showSkipButton: true,
|
|
990
997
|
steps: steps,
|
|
991
998
|
scrollOffset: 100,
|
|
999
|
+
disableScrollParentFix: true,
|
|
992
1000
|
styles: {
|
|
993
1001
|
options: {
|
|
994
1002
|
zIndex: 10000,
|
|
@@ -61,7 +61,8 @@ const useStyles = (0, _mui.makeStyles)()(theme => ({
|
|
|
61
61
|
},
|
|
62
62
|
flexGrow: 1,
|
|
63
63
|
width: "100%",
|
|
64
|
-
padding: theme.spacing(4)
|
|
64
|
+
padding: theme.spacing(4),
|
|
65
|
+
boxSizing: "border-box"
|
|
65
66
|
},
|
|
66
67
|
progress: {
|
|
67
68
|
width: "100%",
|
|
@@ -383,7 +384,7 @@ function Translator({
|
|
|
383
384
|
})]
|
|
384
385
|
}),
|
|
385
386
|
spotlightPadding: 8,
|
|
386
|
-
target: "#
|
|
387
|
+
target: "#translationTextAnchor"
|
|
387
388
|
}, {
|
|
388
389
|
content: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
389
390
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
|
|
@@ -403,7 +404,8 @@ function Translator({
|
|
|
403
404
|
})]
|
|
404
405
|
}),
|
|
405
406
|
spotlightPadding: 8,
|
|
406
|
-
target: "#skipButton"
|
|
407
|
+
target: "#skipButton",
|
|
408
|
+
disableScrollParentFix: false
|
|
407
409
|
}, {
|
|
408
410
|
content: /*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
|
|
409
411
|
children: t("change_voice_speed")
|
|
@@ -862,43 +864,49 @@ function Translator({
|
|
|
862
864
|
})]
|
|
863
865
|
})]
|
|
864
866
|
}), !isKeyboardHidden && !useWordBank && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
865
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
867
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
866
868
|
sx: {
|
|
867
869
|
width: "100%",
|
|
868
870
|
maxWidth: `250px !important`
|
|
869
871
|
},
|
|
870
|
-
children:
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
t: t,
|
|
875
|
-
value: translationText,
|
|
876
|
-
onChange: handleInputChange,
|
|
877
|
-
onKeyDown: e => {
|
|
878
|
-
if (e.key === "Enter") {
|
|
879
|
-
handleContinue(false);
|
|
880
|
-
e.stopPropagation();
|
|
881
|
-
}
|
|
872
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
873
|
+
id: "translationTextAnchor",
|
|
874
|
+
style: {
|
|
875
|
+
position: "relative"
|
|
882
876
|
},
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
877
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
878
|
+
className: classes.srOnly,
|
|
879
|
+
children: translationText
|
|
880
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputHelper.default, {
|
|
881
|
+
t: t,
|
|
882
|
+
value: translationText,
|
|
883
|
+
onChange: handleInputChange,
|
|
884
|
+
onKeyDown: e => {
|
|
885
|
+
if (e.key === "Enter") {
|
|
886
|
+
handleContinue(false);
|
|
887
|
+
e.stopPropagation();
|
|
888
|
+
}
|
|
889
|
+
},
|
|
890
|
+
id: "translationText",
|
|
891
|
+
name: "translationText",
|
|
892
|
+
"aria-label": t("language_translation", {
|
|
893
|
+
language: (0, _index.capitalize)(t(forLang.toLowerCase()))
|
|
894
|
+
}),
|
|
895
|
+
"data-cy": "translationText",
|
|
896
|
+
label: t("language_translation", {
|
|
897
|
+
language: (0, _index.capitalize)(t(forLang.toLowerCase()))
|
|
898
|
+
}),
|
|
899
|
+
type: "text",
|
|
900
|
+
role: "textbox",
|
|
901
|
+
"aria-multiline": "true",
|
|
902
|
+
"aria-autocomplete": "none",
|
|
903
|
+
variant: "outlined",
|
|
904
|
+
multiline: true,
|
|
905
|
+
fullWidth: true,
|
|
906
|
+
autoComplete: "off",
|
|
907
|
+
characters: forLangCharacters ? forLangCharacters : null
|
|
908
|
+
})]
|
|
909
|
+
})
|
|
902
910
|
}), isWordBankEnabled && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
903
911
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
904
912
|
title: t("use_wordbank_if_stuck"),
|
|
@@ -995,6 +1003,7 @@ function Translator({
|
|
|
995
1003
|
showSkipButton: true,
|
|
996
1004
|
steps: steps,
|
|
997
1005
|
scrollOffset: 100,
|
|
1006
|
+
disableScrollParentFix: true,
|
|
998
1007
|
styles: {
|
|
999
1008
|
options: {
|
|
1000
1009
|
zIndex: 10000,
|
|
@@ -32,7 +32,7 @@ function BotSettings({
|
|
|
32
32
|
const {
|
|
33
33
|
visibility,
|
|
34
34
|
translationEnabled,
|
|
35
|
-
|
|
35
|
+
isChallengeBot,
|
|
36
36
|
isDynamicResponsesEnabled
|
|
37
37
|
} = values;
|
|
38
38
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
@@ -113,26 +113,25 @@ function BotSettings({
|
|
|
113
113
|
})]
|
|
114
114
|
})]
|
|
115
115
|
})
|
|
116
|
-
}),
|
|
116
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
117
117
|
size: 12,
|
|
118
118
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.FormControl, {
|
|
119
119
|
component: "fieldset",
|
|
120
120
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormLabel, {
|
|
121
121
|
component: "legend",
|
|
122
|
-
children: t("
|
|
122
|
+
children: t("challenge_bot")
|
|
123
123
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
124
124
|
color: "textSecondary",
|
|
125
|
-
children: t("
|
|
125
|
+
children: t("challenge_bot_desc")
|
|
126
126
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.RadioGroup, {
|
|
127
127
|
row: true,
|
|
128
128
|
className: classes.group,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
value: isAdvancedBot,
|
|
129
|
+
name: "isChallengeBot",
|
|
130
|
+
value: isChallengeBot,
|
|
132
131
|
onChange: handleChange,
|
|
133
132
|
onBlur: handleBlur,
|
|
134
|
-
helperText: touched.
|
|
135
|
-
error: touched.
|
|
133
|
+
helperText: touched.isChallengeBot ? errors.isChallengeBot : "",
|
|
134
|
+
error: touched.isChallengeBot && Boolean(errors.isChallengeBot),
|
|
136
135
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
137
136
|
value: true,
|
|
138
137
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
@@ -59,7 +59,7 @@ function Confirmation({
|
|
|
59
59
|
visibility,
|
|
60
60
|
translationEnabled,
|
|
61
61
|
studentInstructions,
|
|
62
|
-
|
|
62
|
+
isChallengeBot,
|
|
63
63
|
isDynamicResponsesEnabled
|
|
64
64
|
} = values;
|
|
65
65
|
const [open, setOpen] = (0, _react.useState)(false);
|
|
@@ -151,17 +151,16 @@ function Confirmation({
|
|
|
151
151
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
152
152
|
gutterBottom: true,
|
|
153
153
|
display: "block",
|
|
154
|
-
children: t("
|
|
155
|
-
}),
|
|
154
|
+
children: t("challenge_bot_desc")
|
|
155
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.FormControl, {
|
|
156
156
|
component: "fieldset",
|
|
157
157
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormLabel, {
|
|
158
158
|
component: "legend",
|
|
159
|
-
children: t("
|
|
159
|
+
children: t("challenge_bot")
|
|
160
160
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.RadioGroup, {
|
|
161
161
|
className: classes.group,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
value: isAdvancedBot,
|
|
162
|
+
name: "isChallengeBot",
|
|
163
|
+
value: isChallengeBot,
|
|
165
164
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
166
165
|
disabled: true,
|
|
167
166
|
value: true,
|
|
@@ -45,7 +45,7 @@ function UpdateBot({
|
|
|
45
45
|
tags: [],
|
|
46
46
|
phrasesToBoost: [],
|
|
47
47
|
isDynamicResponsesEnabled: "enable",
|
|
48
|
-
|
|
48
|
+
isChallengeBot: false
|
|
49
49
|
},
|
|
50
50
|
verificationStatus,
|
|
51
51
|
onSubmit,
|
|
@@ -83,7 +83,7 @@ function UpdateBot({
|
|
|
83
83
|
tags,
|
|
84
84
|
phrasesToBoost,
|
|
85
85
|
isDynamicResponsesEnabled,
|
|
86
|
-
|
|
86
|
+
isChallengeBot
|
|
87
87
|
} = initialValues;
|
|
88
88
|
const difficultyOptions = difficulties.map((d, idx) => {
|
|
89
89
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_MenuItem.default, {
|
|
@@ -178,7 +178,7 @@ function UpdateBot({
|
|
|
178
178
|
translationEnabled,
|
|
179
179
|
picture,
|
|
180
180
|
isDynamicResponsesEnabled,
|
|
181
|
-
|
|
181
|
+
isChallengeBot
|
|
182
182
|
},
|
|
183
183
|
enableReinitialize: enableReinitialize,
|
|
184
184
|
validationSchema: _Steps.BotSettings.validationSchema,
|
|
@@ -509,11 +509,11 @@ function BotListItem({
|
|
|
509
509
|
} = params;
|
|
510
510
|
const [anchorEl, setAnchorEl] = (0, _react.useState)(null);
|
|
511
511
|
const [isBotHiddenState, setIsBotHiddenState] = (0, _react.useState)(bot.isBotHidden);
|
|
512
|
-
const [
|
|
512
|
+
const [isBotChallenge, setIsBotChallenge] = (0, _react.useState)(bot.isChallengeBot || false);
|
|
513
513
|
const [isSelectClassroomDialogOpen, setIsSelectClassroomDialogOpen] = (0, _react.useState)(false);
|
|
514
514
|
(0, _react.useEffect)(() => {
|
|
515
|
-
|
|
516
|
-
}, [bot.
|
|
515
|
+
setIsBotChallenge(bot.isChallengeBot);
|
|
516
|
+
}, [bot.isChallengeBot]);
|
|
517
517
|
const ref = (0, _react.useRef)(null);
|
|
518
518
|
const [{
|
|
519
519
|
handlerId
|
|
@@ -608,15 +608,15 @@ function BotListItem({
|
|
|
608
608
|
isBotHidden: !isBotHidden
|
|
609
609
|
});
|
|
610
610
|
};
|
|
611
|
-
const
|
|
611
|
+
const markBotAsChallenge = async () => {
|
|
612
612
|
await handleUpdateBot(bot, {
|
|
613
|
-
|
|
613
|
+
isChallengeBot: !isBotChallenge
|
|
614
614
|
});
|
|
615
|
-
|
|
615
|
+
setIsBotChallenge(!isBotChallenge);
|
|
616
616
|
};
|
|
617
617
|
const botCompletions = numberOfBotCompletions(completions, bot.botId);
|
|
618
618
|
const navigate = (0, _reactRouterDom.useNavigate)();
|
|
619
|
-
const
|
|
619
|
+
const ChallengeBotHtmlTooltip = (0, _system.styled)(({
|
|
620
620
|
className,
|
|
621
621
|
...props
|
|
622
622
|
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
@@ -635,7 +635,7 @@ function BotListItem({
|
|
|
635
635
|
style: {
|
|
636
636
|
marginBottom: "8px"
|
|
637
637
|
},
|
|
638
|
-
children: t("
|
|
638
|
+
children: t("challenge_bot_desc")
|
|
639
639
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
640
640
|
style: {
|
|
641
641
|
fontSize: "12px"
|
|
@@ -712,14 +712,14 @@ function BotListItem({
|
|
|
712
712
|
children: isBotHiddenState ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_VisibilityOff.default, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Visibility.default, {})
|
|
713
713
|
})
|
|
714
714
|
})
|
|
715
|
-
}), isCreator && isLargeScreen
|
|
716
|
-
title:
|
|
715
|
+
}), isCreator && isLargeScreen ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
716
|
+
title: isBotChallenge ? t("unmark_as_challenge_bot") : t("mark_as_challenge_bot"),
|
|
717
717
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
718
|
-
"data-cy": "
|
|
719
|
-
onClick:
|
|
720
|
-
"aria-label":
|
|
718
|
+
"data-cy": "mark_challenge_bot",
|
|
719
|
+
onClick: markBotAsChallenge,
|
|
720
|
+
"aria-label": isBotChallenge ? t("unmark_as_challenge_bot") : t("mark_as_challenge_bot"),
|
|
721
721
|
disabled: isCreator ? false : true,
|
|
722
|
-
children:
|
|
722
|
+
children: isBotChallenge ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_FlashOn.default, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_FlashOff.default, {})
|
|
723
723
|
})
|
|
724
724
|
}) : null, isCreator && isLargeScreen && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
725
725
|
title: t("move_bot"),
|
|
@@ -757,11 +757,11 @@ function BotListItem({
|
|
|
757
757
|
alt: ""
|
|
758
758
|
})
|
|
759
759
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemText, {
|
|
760
|
-
primary: isLargeScreen ? !
|
|
760
|
+
primary: isLargeScreen ? !isBotChallenge ? bot.botName || "" : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
761
761
|
display: "flex",
|
|
762
762
|
alignItems: "center",
|
|
763
763
|
gap: "8px",
|
|
764
|
-
children: [bot.botName || "", /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
764
|
+
children: [bot.botName || "", /*#__PURE__*/(0, _jsxRuntime.jsx)(ChallengeBotHtmlTooltip, {
|
|
765
765
|
placement: "right",
|
|
766
766
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Chip, {
|
|
767
767
|
label: t("challenge_mode"),
|
|
@@ -770,7 +770,7 @@ function BotListItem({
|
|
|
770
770
|
color: "primary"
|
|
771
771
|
})
|
|
772
772
|
})]
|
|
773
|
-
}) : !
|
|
773
|
+
}) : !isBotChallenge ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
774
774
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
775
775
|
mb: 1,
|
|
776
776
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Avatar, {
|
|
@@ -791,7 +791,7 @@ function BotListItem({
|
|
|
791
791
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
792
792
|
variant: "body1",
|
|
793
793
|
children: bot.botName || ""
|
|
794
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
794
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ChallengeBotHtmlTooltip, {
|
|
795
795
|
placement: "right",
|
|
796
796
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Chip, {
|
|
797
797
|
label: t("challenge_mode"),
|
|
@@ -954,7 +954,7 @@ function Exercises(props) {
|
|
|
954
954
|
trackRecommendedEvent,
|
|
955
955
|
parentClassroom,
|
|
956
956
|
isHeritageSpeaker,
|
|
957
|
-
|
|
957
|
+
isChallengeModeStudent
|
|
958
958
|
} = props;
|
|
959
959
|
const params = (0, _reactRouterDom.useParams)();
|
|
960
960
|
const {
|
|
@@ -1140,10 +1140,10 @@ function Exercises(props) {
|
|
|
1140
1140
|
}
|
|
1141
1141
|
}, [bots, botsStringified]);
|
|
1142
1142
|
(0, _react.useEffect)(() => {
|
|
1143
|
-
if (!
|
|
1144
|
-
setBotsArray(bots.filter(bot => !bot.
|
|
1143
|
+
if (!isChallengeModeStudent && !isCreator) {
|
|
1144
|
+
setBotsArray(bots.filter(bot => !bot.isChallengeBot || bot.isChallengeBot === false));
|
|
1145
1145
|
}
|
|
1146
|
-
}, [bots,
|
|
1146
|
+
}, [bots, isChallengeModeStudent, isCreator]);
|
|
1147
1147
|
const moveBot = (0, _react.useCallback)((dragIndex, hoverIndex) => {
|
|
1148
1148
|
const dragBot = botsArray[dragIndex];
|
|
1149
1149
|
const newBots = (0, _immutabilityHelper.default)(botsArray, {
|
|
@@ -137,7 +137,7 @@ function Member(props) {
|
|
|
137
137
|
marginBottom: theme.spacing(0.5)
|
|
138
138
|
}
|
|
139
139
|
}));
|
|
140
|
-
const
|
|
140
|
+
const ChallengeModeHtmlTooltip = (0, _styles.styled)(({
|
|
141
141
|
className,
|
|
142
142
|
...props
|
|
143
143
|
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
@@ -151,12 +151,12 @@ function Member(props) {
|
|
|
151
151
|
fontWeight: "bold",
|
|
152
152
|
marginBottom: "8px"
|
|
153
153
|
},
|
|
154
|
-
children: t("
|
|
154
|
+
children: t("challenge_student")
|
|
155
155
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
156
156
|
style: {
|
|
157
157
|
marginBottom: "8px"
|
|
158
158
|
},
|
|
159
|
-
children: t("
|
|
159
|
+
children: t("challenge_student_desc")
|
|
160
160
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
161
161
|
style: {
|
|
162
162
|
fontSize: "12px"
|
|
@@ -213,14 +213,14 @@ function Member(props) {
|
|
|
213
213
|
})
|
|
214
214
|
})
|
|
215
215
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemText, {
|
|
216
|
-
primary: featureFlags.classroomModes.readWrite && featureFlags.classroomModes.challenge && member.isHeritageSpeaker && member.assignedLabels?.
|
|
216
|
+
primary: featureFlags.classroomModes.readWrite && featureFlags.classroomModes.challenge && member.isHeritageSpeaker && member.assignedLabels?.isChallengeModeStudent ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
217
217
|
display: "flex",
|
|
218
218
|
alignItems: "center",
|
|
219
219
|
gap: "8px",
|
|
220
|
-
children: [member.username, /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
220
|
+
children: [member.username, /*#__PURE__*/(0, _jsxRuntime.jsx)(ChallengeModeHtmlTooltip, {
|
|
221
221
|
placement: "right",
|
|
222
222
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Chip, {
|
|
223
|
-
label: t("
|
|
223
|
+
label: t("challenge_student"),
|
|
224
224
|
size: "small",
|
|
225
225
|
variant: "outlined",
|
|
226
226
|
color: "primary"
|
|
@@ -247,14 +247,14 @@ function Member(props) {
|
|
|
247
247
|
color: "primary"
|
|
248
248
|
})
|
|
249
249
|
})]
|
|
250
|
-
}) : featureFlags.classroomModes.challenge && member.assignedLabels?.
|
|
250
|
+
}) : featureFlags.classroomModes.challenge && member.assignedLabels?.isChallengeModeStudent ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
251
251
|
display: "flex",
|
|
252
252
|
alignItems: "center",
|
|
253
253
|
gap: "8px",
|
|
254
|
-
children: [member.username, /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
254
|
+
children: [member.username, /*#__PURE__*/(0, _jsxRuntime.jsx)(ChallengeModeHtmlTooltip, {
|
|
255
255
|
placement: "right",
|
|
256
256
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Chip, {
|
|
257
|
-
label: t("
|
|
257
|
+
label: t("challenge_student"),
|
|
258
258
|
size: "small",
|
|
259
259
|
variant: "outlined",
|
|
260
260
|
color: "primary"
|
|
@@ -299,31 +299,31 @@ function Member(props) {
|
|
|
299
299
|
primary: t("mark_as_heritage_speaker")
|
|
300
300
|
})
|
|
301
301
|
})
|
|
302
|
-
})), featureFlags.classroomModes.challenge && (member.assignedLabels?.
|
|
302
|
+
})), featureFlags.classroomModes.challenge && (member.assignedLabels?.isChallengeModeStudent ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MenuItem, {
|
|
303
303
|
onClick: () => {
|
|
304
304
|
handleUpdateClassroomMember(member.classroomId, member.memberId, {
|
|
305
305
|
assignedLabels: {
|
|
306
|
-
|
|
306
|
+
isChallengeModeStudent: false
|
|
307
307
|
}
|
|
308
308
|
});
|
|
309
309
|
},
|
|
310
|
-
"aria-label": `Unmark as
|
|
310
|
+
"aria-label": `Unmark as challenge student: ${member.username}`,
|
|
311
311
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemText, {
|
|
312
|
-
primary: t("
|
|
312
|
+
primary: t("unmark_as_challenge_student")
|
|
313
313
|
})
|
|
314
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
314
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(ChallengeModeHtmlTooltip, {
|
|
315
315
|
placement: "right",
|
|
316
316
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MenuItem, {
|
|
317
317
|
onClick: () => {
|
|
318
318
|
handleUpdateClassroomMember(member.classroomId, member.memberId, {
|
|
319
319
|
assignedLabels: {
|
|
320
|
-
|
|
320
|
+
isChallengeModeStudent: true
|
|
321
321
|
}
|
|
322
322
|
});
|
|
323
323
|
},
|
|
324
|
-
"aria-label": `Mark as
|
|
324
|
+
"aria-label": `Mark as challenge student: ${member.username}`,
|
|
325
325
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemText, {
|
|
326
|
-
primary: t("
|
|
326
|
+
primary: t("mark_as_challenge_student")
|
|
327
327
|
})
|
|
328
328
|
})
|
|
329
329
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.MenuItem, {
|
|
@@ -14,7 +14,9 @@ const useStyles = (0, _mui.makeStyles)()(theme => ({
|
|
|
14
14
|
footer: {
|
|
15
15
|
padding: theme.spacing(2),
|
|
16
16
|
borderTop: `2px solid ${theme.palette.grey[300]}`,
|
|
17
|
-
width: "100%"
|
|
17
|
+
width: "100%",
|
|
18
|
+
position: "sticky",
|
|
19
|
+
bottom: 0
|
|
18
20
|
}
|
|
19
21
|
}));
|
|
20
22
|
function ExerciseBottomBar({
|
|
@@ -112,30 +112,7 @@ function ResponsiveTabs({
|
|
|
112
112
|
label,
|
|
113
113
|
disabled,
|
|
114
114
|
id
|
|
115
|
-
}) => id === "
|
|
116
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
117
|
-
src: _NewText.default,
|
|
118
|
-
style: {
|
|
119
|
-
width: "45px",
|
|
120
|
-
marginTop: "-20px",
|
|
121
|
-
marginLeft: "-5px"
|
|
122
|
-
},
|
|
123
|
-
alt: "New Text"
|
|
124
|
-
}),
|
|
125
|
-
iconPosition: "end",
|
|
126
|
-
id: id,
|
|
127
|
-
label: label,
|
|
128
|
-
disabled: disabled,
|
|
129
|
-
onClick: () => {
|
|
130
|
-
if (!disableHashParams) {
|
|
131
|
-
window.history.replaceState(null, null, `#${id}`);
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
sx: {
|
|
135
|
-
paddingLeft: "45px"
|
|
136
|
-
},
|
|
137
|
-
"data-cy": `${id}-tab`
|
|
138
|
-
}, `responsivetabs_${id}`) : id === "Assignments" && hasNewAssignments && !isCreator && !localStorage.getItem("remove-assignment-new-tag") ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tab.default, {
|
|
115
|
+
}) => id === "Assignments" && hasNewAssignments && !isCreator && !localStorage.getItem("remove-assignment-new-tag") ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tab.default, {
|
|
139
116
|
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
140
117
|
src: _NewText.default,
|
|
141
118
|
style: {
|
|
@@ -578,7 +578,7 @@ function Topic({
|
|
|
578
578
|
topicGoal,
|
|
579
579
|
isUserInternal,
|
|
580
580
|
isHeritageSpeaker = false,
|
|
581
|
-
|
|
581
|
+
isChallengeModeStudent = false,
|
|
582
582
|
...otherProps
|
|
583
583
|
}) {
|
|
584
584
|
const {
|
|
@@ -769,7 +769,7 @@ function Topic({
|
|
|
769
769
|
courseSettings: courseSettings,
|
|
770
770
|
trackRecommendedEvent: trackRecommendedEvent,
|
|
771
771
|
isHeritageSpeaker: isHeritageSpeaker,
|
|
772
|
-
|
|
772
|
+
isChallengeModeStudent: isChallengeModeStudent
|
|
773
773
|
})
|
|
774
774
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
775
775
|
py: 1,
|
|
@@ -1106,7 +1106,7 @@ function Topic({
|
|
|
1106
1106
|
handleDuplicateRoleplay: handleDuplicateRoleplay,
|
|
1107
1107
|
isCreator: isCreator,
|
|
1108
1108
|
isMember: isMember,
|
|
1109
|
-
|
|
1109
|
+
isChallengeModeStudent: isChallengeModeStudent,
|
|
1110
1110
|
phrases: phrases,
|
|
1111
1111
|
completions: completions,
|
|
1112
1112
|
roleplays: roleplays,
|
|
@@ -1395,7 +1395,7 @@ function ViewTopic({
|
|
|
1395
1395
|
topicGoal,
|
|
1396
1396
|
isUserInternal,
|
|
1397
1397
|
isHeritageSpeaker,
|
|
1398
|
-
|
|
1398
|
+
isChallengeModeStudent,
|
|
1399
1399
|
...otherProps
|
|
1400
1400
|
}) {
|
|
1401
1401
|
const {
|
|
@@ -1431,7 +1431,7 @@ function ViewTopic({
|
|
|
1431
1431
|
topicGoal: topicGoal,
|
|
1432
1432
|
isUserInternal: isUserInternal,
|
|
1433
1433
|
isHeritageSpeaker: isHeritageSpeaker,
|
|
1434
|
-
|
|
1434
|
+
isChallengeModeStudent: isChallengeModeStudent,
|
|
1435
1435
|
...otherProps
|
|
1436
1436
|
})
|
|
1437
1437
|
}), !isLoading && !topic && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Topic.default, {
|
|
@@ -21,7 +21,7 @@ function useClassroomState({
|
|
|
21
21
|
const queryClient = useQueryClient();
|
|
22
22
|
const classroomMemberData = queryClient.getQueryData(_Queries.classrooms.classroomKeys.itemMember(classroomId, username, memberId));
|
|
23
23
|
const [isMember, setIsMember] = (0, _react.useState)(classroomMemberData?.Item ? true : false);
|
|
24
|
-
const [
|
|
24
|
+
const [isChallengeModeStudent, setisChallengeModeStudent] = (0, _react.useState)(classroomMemberData?.Item?.assignedLabels && classroomMemberData?.Item?.assignedLabels.isChallengeModeStudent === true);
|
|
25
25
|
let filters = {
|
|
26
26
|
limit: _config.config.limits.classroomMembers
|
|
27
27
|
};
|
|
@@ -42,15 +42,15 @@ function useClassroomState({
|
|
|
42
42
|
(0, _react.useEffect)(() => {
|
|
43
43
|
if (memberQuery.isSuccess) {
|
|
44
44
|
const isClassroomMember = memberQuery.data && memberQuery.data.Item ? true : false;
|
|
45
|
-
const
|
|
45
|
+
const isChallengeModeStudent = memberQuery.data?.Item?.assignedLabels && memberQuery.data?.Item?.assignedLabels.isChallengeModeStudent === true;
|
|
46
46
|
setIsMember(isClassroomMember);
|
|
47
|
-
|
|
47
|
+
setisChallengeModeStudent(isChallengeModeStudent);
|
|
48
48
|
}
|
|
49
49
|
}, [memberQuery.data, memberQuery.isSuccess, memberId]);
|
|
50
50
|
return {
|
|
51
51
|
isMember,
|
|
52
52
|
membersQuery,
|
|
53
53
|
memberQuery,
|
|
54
|
-
|
|
54
|
+
isChallengeModeStudent
|
|
55
55
|
};
|
|
56
56
|
}
|
package/dist/utils/index.js
CHANGED
|
@@ -230,17 +230,19 @@ const calcTopicCompletions = (topic, completions = [], isSectionHidden, assignme
|
|
|
230
230
|
let completedBots = 0;
|
|
231
231
|
const roleplays = topic.roleplays.map(roleplay => {
|
|
232
232
|
const {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
233
|
+
isFillInTheBlanksHidden = "false",
|
|
234
|
+
isActItOutHidden = "false",
|
|
235
|
+
isActItOutListeningHidden = "false",
|
|
236
|
+
isActItOutListeningSpeakingHidden = "false",
|
|
237
|
+
isActItOutSpeakingHidden = "false"
|
|
237
238
|
} = roleplay;
|
|
238
239
|
const trueCount = Object.values({
|
|
240
|
+
isFillInTheBlanksHidden,
|
|
239
241
|
isActItOutHidden,
|
|
240
242
|
isActItOutListeningHidden,
|
|
241
243
|
isActItOutListeningSpeakingHidden,
|
|
242
244
|
isActItOutSpeakingHidden
|
|
243
|
-
}).filter(
|
|
245
|
+
}).filter(value => value === "true").length;
|
|
244
246
|
const numberOfUnhiddenGames = 6 - trueCount;
|
|
245
247
|
const isUnassignedRoleplay = assignmentExercises ? assignmentExercises && !assignmentExercises.some(e => e.roleplayId === roleplay.roleplayId) : false;
|
|
246
248
|
if (isRoleplaysHidden || roleplay.isRoleplayHidden || isSectionHidden || topic.isTopicHidden || isUnassignedRoleplay) {
|
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.1285",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@hookform/resolvers": "^3.6.0",
|
|
21
21
|
"@json2csv/plainjs": "^7.0.1",
|
|
22
22
|
"@nualang/avatars": "2.0.3",
|
|
23
|
-
"@nualang/nualang-api-and-queries": "^1.1.
|
|
23
|
+
"@nualang/nualang-api-and-queries": "^1.1.16",
|
|
24
24
|
"@storybook/theming": "^8.6.12",
|
|
25
25
|
"@stripe/react-stripe-js": "^2.1.1",
|
|
26
26
|
"@stripe/stripe-js": "^1.54.2",
|