@nualang/nualang-ui-components 0.1.1290 → 0.1.1291
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/AssignmentBotSelection/AssignmentBotSelection.js +101 -10
- package/dist/Assignments/AssignmentCard/AssignmentCard.js +4 -2
- package/dist/Assignments/AssignmentCardsList/AssignmentCardsList.js +5 -3
- package/dist/Assignments/AssignmentCourseSelection/AssignmentCourseSelection.js +9 -4
- package/dist/Assignments/AssignmentExerciseSelection/AssignmentExerciseSelection.js +17 -5
- package/dist/Assignments/AssignmentExerciseSelector/AssignmentExerciseSelector.js +4 -2
- package/dist/Assignments/AssignmentSelectExercise/AssignmentSelectExercise.js +4 -2
- package/dist/Chat/BottomBar/BottomBar.js +92 -40
- package/dist/Chat/Chat.js +4 -0
- package/dist/Dialogs/PDFViewer/PDFViewer.js +1 -0
- package/dist/Dialogs/SelectExercise/SelectExercise.js +4 -2
- package/dist/Exercises/Bot/Bot.js +4 -1
- package/dist/Exercises/Pronouncer/Pronouncer.js +1 -1
- package/dist/Exercises/Roleplay/Games/ActItOutGameListeningAndSpeaking/ActItOutGame.js +1 -1
- package/dist/Exercises/Roleplay/Games/ActItOutGameSpeaking/ActItOutGame.js +1 -1
- package/dist/Forms/CreateBot/Steps/BotInformation/BotInformation.js +2 -2
- package/dist/Forms/CreateCourse/CreateCourse.js +3 -2
- package/dist/Forms/CreateMeetingMultiStepForm/GroupAssignment.js +8 -4
- package/dist/Forms/CreateRoleplay/Steps/RoleplayInformation/RoleplayInformation.js +2 -2
- package/dist/Forms/CreateTopic/Steps/TopicSettings/TopicSettings.js +2 -2
- package/dist/Forms/DiscussMultiStepFormDialog/MultiStepFormDialog.js +3 -3
- package/dist/Lists/CourseSelection/CourseSelection.js +14 -5
- package/dist/Lists/ExerciseSelection/ExerciseSelection.js +33 -2
- package/dist/Lists/Exercises/Exercises.js +7 -44
- package/dist/Lists/Members/Members.js +22 -97
- package/dist/Live/Game/Game.js +2 -0
- package/dist/Misc/HtmlTooltipComponent/HtmlTooltipComponent.js +69 -0
- package/dist/Misc/HtmlTooltipComponent/package.json +7 -0
- package/dist/Screens/Bots/Bots.js +4 -2
- package/dist/Screens/Classrooms/ViewClassroom/ViewClassroom.js +19 -3
- package/dist/Screens/Courses/ViewCourse/ViewCourse.js +3 -1
- package/dist/Screens/Courses/ViewCourse/ViewTopic/ViewTopic.js +39 -3
- package/dist/Tables/MeetingPrompstList/MeetingPromptsList.js +4 -2
- package/dist/Tables/Progress/ProgressTable.js +84 -10
- package/dist/hooks/useExerciseState.js +1 -1
- package/package.json +6 -7
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { useState, useEffect } from "react";
|
|
2
|
-
import { Box, ListItemText, ListItemButton, Avatar, Checkbox, ListItemIcon, Badge, IconButton } from "@mui/material";
|
|
1
|
+
import { useState, useEffect, Fragment } from "react";
|
|
2
|
+
import { Box, ListItemText, ListItemButton, Avatar, Checkbox, ListItemIcon, Badge, IconButton, Chip, Typography } from "@mui/material";
|
|
3
3
|
import ClearIcon from "@mui/icons-material/Clear";
|
|
4
4
|
import { Done, Timelapse } from "@mui/icons-material";
|
|
5
5
|
import { useNavigate, useParams } from "react-router-dom";
|
|
6
|
-
import
|
|
6
|
+
import Tooltip, { tooltipClasses } from "@mui/material/Tooltip";
|
|
7
|
+
import { styled } from "@mui/material/styles";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
7
9
|
const sxGreenColor = theme => ({
|
|
8
10
|
color: theme.palette.success ? theme.palette.success.dark : ""
|
|
9
11
|
});
|
|
@@ -44,7 +46,8 @@ function Bot({
|
|
|
44
46
|
topicProgress,
|
|
45
47
|
isCreator,
|
|
46
48
|
handleRemoveExercise,
|
|
47
|
-
isPreview
|
|
49
|
+
isPreview,
|
|
50
|
+
isCreateMode
|
|
48
51
|
}) {
|
|
49
52
|
const navigate = useNavigate();
|
|
50
53
|
const params = useParams();
|
|
@@ -90,6 +93,53 @@ function Bot({
|
|
|
90
93
|
const progress = topicProgress?.filter(progress => progress.botId === bot.botId && progress.existingMessages && progress.existingMessages !== null);
|
|
91
94
|
return progress?.length || 0;
|
|
92
95
|
};
|
|
96
|
+
const ChallengeModeHtmlTooltip = styled(({
|
|
97
|
+
className,
|
|
98
|
+
...props
|
|
99
|
+
}) => /*#__PURE__*/_jsx(Tooltip, {
|
|
100
|
+
...props,
|
|
101
|
+
classes: {
|
|
102
|
+
popper: className
|
|
103
|
+
},
|
|
104
|
+
title: /*#__PURE__*/_jsxs(Fragment, {
|
|
105
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
106
|
+
style: {
|
|
107
|
+
fontWeight: "bold",
|
|
108
|
+
marginBottom: "8px"
|
|
109
|
+
},
|
|
110
|
+
children: t("challenge_bot")
|
|
111
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
112
|
+
style: {
|
|
113
|
+
marginBottom: "8px"
|
|
114
|
+
},
|
|
115
|
+
children: t("challenge_bot_desc")
|
|
116
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
117
|
+
style: {
|
|
118
|
+
fontSize: "12px"
|
|
119
|
+
},
|
|
120
|
+
children: t("freely_changed")
|
|
121
|
+
})]
|
|
122
|
+
})
|
|
123
|
+
}))(({
|
|
124
|
+
theme
|
|
125
|
+
}) => ({
|
|
126
|
+
[`& .${tooltipClasses.tooltip}`]: {
|
|
127
|
+
padding: theme.spacing(2),
|
|
128
|
+
backgroundColor: theme.palette.background.paper,
|
|
129
|
+
color: theme.palette.text.primary,
|
|
130
|
+
fontSize: theme.typography.pxToRem(12),
|
|
131
|
+
border: `1px solid ${theme.palette.divider}`
|
|
132
|
+
},
|
|
133
|
+
[`& ul`]: {
|
|
134
|
+
listStyleType: "disc",
|
|
135
|
+
paddingLeft: theme.spacing(2),
|
|
136
|
+
margin: 0
|
|
137
|
+
},
|
|
138
|
+
[`& li`]: {
|
|
139
|
+
display: "list-item",
|
|
140
|
+
marginBottom: theme.spacing(0.5)
|
|
141
|
+
}
|
|
142
|
+
}));
|
|
93
143
|
return /*#__PURE__*/_jsx("div", {
|
|
94
144
|
children: /*#__PURE__*/_jsx("div", {
|
|
95
145
|
children: /*#__PURE__*/_jsxs(ListItemButton, {
|
|
@@ -120,11 +170,40 @@ function Bot({
|
|
|
120
170
|
children: [/*#__PURE__*/_jsx(Avatar, {
|
|
121
171
|
src: bot.picture
|
|
122
172
|
}), /*#__PURE__*/_jsx(ListItemText, {
|
|
123
|
-
primary: bot.botName,
|
|
124
|
-
secondary: bot.description,
|
|
125
173
|
sx: {
|
|
126
174
|
marginLeft: 2
|
|
127
|
-
}
|
|
175
|
+
},
|
|
176
|
+
primary: /*#__PURE__*/_jsxs(Box, {
|
|
177
|
+
display: "flex",
|
|
178
|
+
alignItems: "center",
|
|
179
|
+
gap: 1,
|
|
180
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
181
|
+
variant: "body1",
|
|
182
|
+
children: bot.botName
|
|
183
|
+
}), bot?.isChallengeBot && /*#__PURE__*/_jsx(_Fragment, {
|
|
184
|
+
children: isCreator || isCreateMode ? /*#__PURE__*/_jsx(ChallengeModeHtmlTooltip, {
|
|
185
|
+
placement: "right",
|
|
186
|
+
children: /*#__PURE__*/_jsx(Chip, {
|
|
187
|
+
label: t("challenge_bot"),
|
|
188
|
+
size: "small",
|
|
189
|
+
variant: "outlined",
|
|
190
|
+
color: "primary",
|
|
191
|
+
sx: {
|
|
192
|
+
fontWeight: "normal"
|
|
193
|
+
}
|
|
194
|
+
})
|
|
195
|
+
}) : /*#__PURE__*/_jsx(Chip, {
|
|
196
|
+
label: t("challenge_bot"),
|
|
197
|
+
size: "small",
|
|
198
|
+
variant: "outlined",
|
|
199
|
+
color: "primary",
|
|
200
|
+
sx: {
|
|
201
|
+
fontWeight: "normal"
|
|
202
|
+
}
|
|
203
|
+
})
|
|
204
|
+
})]
|
|
205
|
+
}),
|
|
206
|
+
secondary: bot.description
|
|
128
207
|
})]
|
|
129
208
|
}), useCase === "assignment-select" && /*#__PURE__*/_jsx(Checkbox, {
|
|
130
209
|
sx: {
|
|
@@ -174,9 +253,18 @@ function AssignmentBotSelection({
|
|
|
174
253
|
memberCourseCompletions,
|
|
175
254
|
topicProgress,
|
|
176
255
|
handleRemoveExercise,
|
|
177
|
-
isPreview
|
|
256
|
+
isPreview,
|
|
257
|
+
isChallengeModeStudent,
|
|
258
|
+
isCreator
|
|
178
259
|
}) {
|
|
179
|
-
const
|
|
260
|
+
const isCreateMode = location.pathname.includes("/assignments/create");
|
|
261
|
+
const visibleBots = bots.filter(bot => {
|
|
262
|
+
if (bot.isChallengeBot) {
|
|
263
|
+
return isCreateMode || isCreator || isChallengeModeStudent;
|
|
264
|
+
}
|
|
265
|
+
return true;
|
|
266
|
+
});
|
|
267
|
+
const filteredBots = useCase === "assignment-view" || useCase === "assignment-start" ? visibleBots.filter(bot => selectedExercises.some(ex => ex.botId === bot.botId && ex.courseSectionTopicId === courseSectionTopicId)) : visibleBots;
|
|
180
268
|
return filteredBots.map((bot, index) => /*#__PURE__*/_jsx(Bot, {
|
|
181
269
|
bot: bot,
|
|
182
270
|
courseSectionTopicId: courseSectionTopicId,
|
|
@@ -190,7 +278,10 @@ function AssignmentBotSelection({
|
|
|
190
278
|
memberCourseCompletions: memberCourseCompletions,
|
|
191
279
|
topicProgress: topicProgress,
|
|
192
280
|
handleRemoveExercise: handleRemoveExercise,
|
|
193
|
-
isPreview: isPreview
|
|
281
|
+
isPreview: isPreview,
|
|
282
|
+
isChallengeModeStudent: isChallengeModeStudent,
|
|
283
|
+
isCreator: isCreator,
|
|
284
|
+
isCreateMode: isCreateMode
|
|
194
285
|
}, index));
|
|
195
286
|
}
|
|
196
287
|
export default AssignmentBotSelection;
|
|
@@ -27,7 +27,8 @@ export default function AssignmentCard({
|
|
|
27
27
|
lastClickedExerciseId,
|
|
28
28
|
handleViewProgress,
|
|
29
29
|
lastAssignmentFetch,
|
|
30
|
-
assignedStudents = []
|
|
30
|
+
assignedStudents = [],
|
|
31
|
+
isChallengeModeStudent
|
|
31
32
|
}) {
|
|
32
33
|
const [confirm] = useConfirm(t);
|
|
33
34
|
const {
|
|
@@ -203,7 +204,8 @@ export default function AssignmentCard({
|
|
|
203
204
|
preferred_username: preferred_username,
|
|
204
205
|
progressHelpers: progressHelpers,
|
|
205
206
|
memberCourseCompletions: memberCourseCompletions,
|
|
206
|
-
lastClickedExerciseId: lastClickedExerciseId
|
|
207
|
+
lastClickedExerciseId: lastClickedExerciseId,
|
|
208
|
+
isChallengeModeStudent: isChallengeModeStudent
|
|
207
209
|
})
|
|
208
210
|
})]
|
|
209
211
|
}), /*#__PURE__*/_jsx(Grid, {
|
|
@@ -25,7 +25,8 @@ const AssignmentCardsList = ({
|
|
|
25
25
|
handleViewProgress,
|
|
26
26
|
lastAssignmentFetch,
|
|
27
27
|
assignmentMembersById = {},
|
|
28
|
-
isLoadingAssignments
|
|
28
|
+
isLoadingAssignments,
|
|
29
|
+
isChallengeModeStudent
|
|
29
30
|
}) => {
|
|
30
31
|
const [lastClickedExerciseId, setLastClickedExerciseId] = useState(null);
|
|
31
32
|
useEffect(() => {
|
|
@@ -222,7 +223,7 @@ const AssignmentCardsList = ({
|
|
|
222
223
|
}
|
|
223
224
|
if (!assignment.scheduleDate) return true;
|
|
224
225
|
return new Date(assignment.scheduleDate) <= new Date();
|
|
225
|
-
}).map((assignment, index) => /*#__PURE__*/_jsx(AssignmentCard, {
|
|
226
|
+
}).sort((a, b) => new Date(b.createdAt) - new Date(a.createdAt)).map((assignment, index) => /*#__PURE__*/_jsx(AssignmentCard, {
|
|
226
227
|
index: index,
|
|
227
228
|
lastAssignmentFetch: lastAssignmentFetch,
|
|
228
229
|
assignment: assignment,
|
|
@@ -240,7 +241,8 @@ const AssignmentCardsList = ({
|
|
|
240
241
|
preferred_username: preferred_username,
|
|
241
242
|
memberId: memberId,
|
|
242
243
|
handleViewProgress: handleViewProgress,
|
|
243
|
-
assignedStudents: assignmentMembersById[assignment.assignmentId] || []
|
|
244
|
+
assignedStudents: assignmentMembersById[assignment.assignmentId] || [],
|
|
245
|
+
isChallengeModeStudent: isChallengeModeStudent
|
|
244
246
|
}, assignment.assignmentId))]
|
|
245
247
|
});
|
|
246
248
|
};
|
|
@@ -30,7 +30,8 @@ function Course({
|
|
|
30
30
|
memberCourseCompletions,
|
|
31
31
|
lastClickedExerciseId,
|
|
32
32
|
handleRemoveExercise,
|
|
33
|
-
isPreview
|
|
33
|
+
isPreview,
|
|
34
|
+
isChallengeModeStudent
|
|
34
35
|
}) {
|
|
35
36
|
const numOfIds = lastClickedExerciseId ? lastClickedExerciseId.split("|") : [];
|
|
36
37
|
const [open, setOpen] = useState(lastClickedExerciseId && (numOfIds.length === 4 && lastClickedExerciseId.endsWith(`|${assignment.assignmentId}`) || numOfIds.length === 5 && lastClickedExerciseId.split("|")[3] === assignment.assignmentId));
|
|
@@ -166,7 +167,8 @@ function Course({
|
|
|
166
167
|
preferred_username: preferred_username,
|
|
167
168
|
progressHelpers: progressHelpers,
|
|
168
169
|
memberCourseCompletions: memberCourseCompletions,
|
|
169
|
-
lastClickedExerciseId: lastClickedExerciseId
|
|
170
|
+
lastClickedExerciseId: lastClickedExerciseId,
|
|
171
|
+
isChallengeModeStudent: isChallengeModeStudent
|
|
170
172
|
})
|
|
171
173
|
})
|
|
172
174
|
})]
|
|
@@ -195,7 +197,8 @@ function Course({
|
|
|
195
197
|
lastClickedExerciseId: lastClickedExerciseId,
|
|
196
198
|
course: course,
|
|
197
199
|
handleRemoveExercise: handleRemoveExercise,
|
|
198
|
-
isPreview: isPreview
|
|
200
|
+
isPreview: isPreview,
|
|
201
|
+
isChallengeModeStudent: isChallengeModeStudent
|
|
199
202
|
})
|
|
200
203
|
})
|
|
201
204
|
});
|
|
@@ -222,6 +225,7 @@ function AssignmentCourseSelection({
|
|
|
222
225
|
lastClickedExerciseId,
|
|
223
226
|
handleRemoveExercise,
|
|
224
227
|
isPreview,
|
|
228
|
+
isChallengeModeStudent,
|
|
225
229
|
...otherProps
|
|
226
230
|
}) {
|
|
227
231
|
return /*#__PURE__*/_jsx("div", {
|
|
@@ -247,7 +251,8 @@ function AssignmentCourseSelection({
|
|
|
247
251
|
progressHelpers: progressHelpers,
|
|
248
252
|
lastClickedExerciseId: lastClickedExerciseId,
|
|
249
253
|
handleRemoveExercise: handleRemoveExercise,
|
|
250
|
-
isPreview: isPreview
|
|
254
|
+
isPreview: isPreview,
|
|
255
|
+
isChallengeModeStudent: isChallengeModeStudent
|
|
251
256
|
}, course.courseId || index))
|
|
252
257
|
});
|
|
253
258
|
}
|
|
@@ -48,7 +48,8 @@ function Exercise({
|
|
|
48
48
|
completion,
|
|
49
49
|
lastClickedExerciseId,
|
|
50
50
|
isPreview,
|
|
51
|
-
handleRemoveExercise = null
|
|
51
|
+
handleRemoveExercise = null,
|
|
52
|
+
isChallengeModeStudent
|
|
52
53
|
}) {
|
|
53
54
|
const [listeningHidden, setListeningHidden] = useState(false);
|
|
54
55
|
const [translationHidden, setTranslationHidden] = useState(false);
|
|
@@ -288,7 +289,8 @@ function Exercise({
|
|
|
288
289
|
isCreator: isCreator,
|
|
289
290
|
lastClickedExerciseId: lastClickedExerciseId,
|
|
290
291
|
handleRemoveExercise: handleRemoveExercise,
|
|
291
|
-
isPreview: isPreview
|
|
292
|
+
isPreview: isPreview,
|
|
293
|
+
isChallengeModeStudent: isChallengeModeStudent
|
|
292
294
|
})
|
|
293
295
|
})
|
|
294
296
|
})]
|
|
@@ -398,6 +400,7 @@ function Topic({
|
|
|
398
400
|
getBots,
|
|
399
401
|
handleRemoveExercise,
|
|
400
402
|
isPreview,
|
|
403
|
+
isChallengeModeStudent,
|
|
401
404
|
...otherProps
|
|
402
405
|
}) {
|
|
403
406
|
const theme = useTheme();
|
|
@@ -705,7 +708,8 @@ function Topic({
|
|
|
705
708
|
...otherProps,
|
|
706
709
|
completion: completion,
|
|
707
710
|
handleRemoveExercise: handleRemoveExercise,
|
|
708
|
-
isPreview: isPreview
|
|
711
|
+
isPreview: isPreview,
|
|
712
|
+
isChallengeModeStudent: isChallengeModeStudent
|
|
709
713
|
})
|
|
710
714
|
})]
|
|
711
715
|
})
|
|
@@ -739,6 +743,7 @@ function Section({
|
|
|
739
743
|
course,
|
|
740
744
|
handleRemoveExercise,
|
|
741
745
|
isPreview,
|
|
746
|
+
isChallengeModeStudent,
|
|
742
747
|
...otherProps
|
|
743
748
|
}) {
|
|
744
749
|
const root = {
|
|
@@ -816,7 +821,8 @@ function Section({
|
|
|
816
821
|
progressHelpers: progressHelpers,
|
|
817
822
|
handleRemoveExercise: handleRemoveExercise,
|
|
818
823
|
isPreview: isPreview,
|
|
819
|
-
memberCourseCompletions: memberCourseCompletions
|
|
824
|
+
memberCourseCompletions: memberCourseCompletions,
|
|
825
|
+
isChallengeModeStudent: isChallengeModeStudent
|
|
820
826
|
}, `${sectionId}-${topic.topicId}`)) : topics.map((topic, i) => /*#__PURE__*/_jsx(Topic, {
|
|
821
827
|
viewOnly: viewOnly,
|
|
822
828
|
index: i,
|
|
@@ -844,7 +850,8 @@ function Section({
|
|
|
844
850
|
username: username,
|
|
845
851
|
preferred_username: preferred_username,
|
|
846
852
|
progressHelpers: progressHelpers,
|
|
847
|
-
memberCourseCompletions: memberCourseCompletions
|
|
853
|
+
memberCourseCompletions: memberCourseCompletions,
|
|
854
|
+
isChallengeModeStudent: isChallengeModeStudent
|
|
848
855
|
}, `${sectionId}-${topic.topicId}`))
|
|
849
856
|
})
|
|
850
857
|
});
|
|
@@ -874,6 +881,7 @@ function SectionList({
|
|
|
874
881
|
course,
|
|
875
882
|
handleRemoveExercise,
|
|
876
883
|
isPreview,
|
|
884
|
+
isChallengeModeStudent,
|
|
877
885
|
...otherProps
|
|
878
886
|
}) {
|
|
879
887
|
const [courseSectionWithProgress, setCourseSectionWithProgress] = useState([]);
|
|
@@ -913,6 +921,7 @@ function SectionList({
|
|
|
913
921
|
course: course,
|
|
914
922
|
handleRemoveExercise: handleRemoveExercise,
|
|
915
923
|
isPreview: isPreview,
|
|
924
|
+
isChallengeModeStudent: isChallengeModeStudent,
|
|
916
925
|
...otherProps
|
|
917
926
|
}, section.sectionId);
|
|
918
927
|
}) : /*#__PURE__*/_jsx(Typography, {
|
|
@@ -949,6 +958,7 @@ function AssignmentExerciseSelection({
|
|
|
949
958
|
course,
|
|
950
959
|
handleRemoveExercise,
|
|
951
960
|
isPreview,
|
|
961
|
+
isChallengeModeStudent,
|
|
952
962
|
...otherProps
|
|
953
963
|
}) {
|
|
954
964
|
if (isLoading) {
|
|
@@ -978,6 +988,7 @@ function AssignmentExerciseSelection({
|
|
|
978
988
|
course: course,
|
|
979
989
|
handleRemoveExercise: handleRemoveExercise,
|
|
980
990
|
isPreview: isPreview,
|
|
991
|
+
isChallengeModeStudent: isChallengeModeStudent,
|
|
981
992
|
...otherProps
|
|
982
993
|
})
|
|
983
994
|
});
|
|
@@ -1008,6 +1019,7 @@ function AssignmentExerciseSelection({
|
|
|
1008
1019
|
course: course,
|
|
1009
1020
|
handleRemoveExercise: handleRemoveExercise,
|
|
1010
1021
|
isPreview: isPreview,
|
|
1022
|
+
isChallengeModeStudent: isChallengeModeStudent,
|
|
1011
1023
|
...otherProps
|
|
1012
1024
|
})
|
|
1013
1025
|
});
|
|
@@ -19,7 +19,8 @@ function AssignmentExerciseSelector({
|
|
|
19
19
|
memberCourseCompletions,
|
|
20
20
|
lastClickedExerciseId,
|
|
21
21
|
handleRemoveExercise,
|
|
22
|
-
isPreview
|
|
22
|
+
isPreview,
|
|
23
|
+
isChallengeModeStudent
|
|
23
24
|
}) {
|
|
24
25
|
return /*#__PURE__*/_jsx(Box, {
|
|
25
26
|
children: /*#__PURE__*/_jsx(AssignmentCourseSelection, {
|
|
@@ -40,7 +41,8 @@ function AssignmentExerciseSelector({
|
|
|
40
41
|
memberCourseCompletions: memberCourseCompletions,
|
|
41
42
|
lastClickedExerciseId: lastClickedExerciseId,
|
|
42
43
|
handleRemoveExercise: handleRemoveExercise,
|
|
43
|
-
isPreview: isPreview
|
|
44
|
+
isPreview: isPreview,
|
|
45
|
+
isChallengeModeStudent: isChallengeModeStudent
|
|
44
46
|
})
|
|
45
47
|
});
|
|
46
48
|
}
|
|
@@ -19,7 +19,8 @@ function AssignmentSelectExercise({
|
|
|
19
19
|
completions,
|
|
20
20
|
preferred_username,
|
|
21
21
|
progressHelpers,
|
|
22
|
-
memberCourseCompletions
|
|
22
|
+
memberCourseCompletions,
|
|
23
|
+
isChallengeModeStudent
|
|
23
24
|
}) {
|
|
24
25
|
const [isExerciseSelected, setIsExerciseSelected] = useState(false);
|
|
25
26
|
const handleSelectExercise = (exercises = []) => {
|
|
@@ -91,7 +92,8 @@ function AssignmentSelectExercise({
|
|
|
91
92
|
completions: completions,
|
|
92
93
|
preferred_username: preferred_username,
|
|
93
94
|
progressHelpers: progressHelpers,
|
|
94
|
-
memberCourseCompletions: memberCourseCompletions
|
|
95
|
+
memberCourseCompletions: memberCourseCompletions,
|
|
96
|
+
isChallengeModeStudent: isChallengeModeStudent
|
|
95
97
|
})
|
|
96
98
|
})]
|
|
97
99
|
});
|
|
@@ -33,7 +33,7 @@ const useStyles = makeStyles()((theme, {
|
|
|
33
33
|
},
|
|
34
34
|
root: {
|
|
35
35
|
flexShrink: 0,
|
|
36
|
-
alignItems: "
|
|
36
|
+
alignItems: "center",
|
|
37
37
|
minHeight: "auto",
|
|
38
38
|
paddingTop: theme.spacing(1),
|
|
39
39
|
paddingBottom: theme.spacing(1)
|
|
@@ -93,6 +93,8 @@ export default function BottomBar({
|
|
|
93
93
|
handleOpenConfidence,
|
|
94
94
|
finalTranscript,
|
|
95
95
|
inputRef,
|
|
96
|
+
isAdvancedBot = false,
|
|
97
|
+
username,
|
|
96
98
|
authenticated,
|
|
97
99
|
isChallengeBot = false
|
|
98
100
|
}) {
|
|
@@ -108,6 +110,22 @@ export default function BottomBar({
|
|
|
108
110
|
// although unused changing the state onclick of input helps keep cursor position accurate
|
|
109
111
|
// eslint-disable-next-line no-unused-vars
|
|
110
112
|
const [currentInput, setCurrentInput] = useState(null);
|
|
113
|
+
const [showMicReminder, setShowMicReminder] = useState(false);
|
|
114
|
+
const reminderTime = 14 * 24 * 60 * 60 * 1000; // 14 days, can be adjusted
|
|
115
|
+
const reminderKey = `voice-reminder-timestamp-${username}`; // add username so students on shared devices can receive individual reminders
|
|
116
|
+
|
|
117
|
+
useEffect(() => {
|
|
118
|
+
if (!browserSupportsSpeechRecognition || disableInput || isListening) return;
|
|
119
|
+
const nextReminder = parseInt(localStorage.getItem(reminderKey) || "0");
|
|
120
|
+
if (!Number.isFinite(nextReminder) || nextReminder <= 0 || Date.now() > nextReminder) {
|
|
121
|
+
setShowMicReminder(true);
|
|
122
|
+
}
|
|
123
|
+
}, [browserSupportsSpeechRecognition, disableInput, isListening, reminderKey]);
|
|
124
|
+
const onClickRecord = e => {
|
|
125
|
+
localStorage.setItem(`voice-reminder-timestamp-${username}`, String(Date.now() + reminderTime)); // Dont show reminder animation for another 2 weeks
|
|
126
|
+
setShowMicReminder(false);
|
|
127
|
+
handleRecord(e);
|
|
128
|
+
};
|
|
111
129
|
const handleSelectCurrentInput = event => {
|
|
112
130
|
setCurrentInput(event.target);
|
|
113
131
|
};
|
|
@@ -125,7 +143,7 @@ export default function BottomBar({
|
|
|
125
143
|
disabled: disableInput || isListening,
|
|
126
144
|
onChange: handleInputChange,
|
|
127
145
|
onKeyPress: handleKeyPress,
|
|
128
|
-
placeholder: placeholder,
|
|
146
|
+
placeholder: browserSupportsSpeechRecognition && handleRecord ? isSmallScreen ? t("bot_input_mobile_placeholder") : t("bot_input_placeholder") : placeholder,
|
|
129
147
|
inputProps: {
|
|
130
148
|
maxLength: isChallengeBot ? 600 : 200,
|
|
131
149
|
sx: theme => ({
|
|
@@ -213,46 +231,80 @@ export default function BottomBar({
|
|
|
213
231
|
size: "large",
|
|
214
232
|
children: /*#__PURE__*/_jsx(AttachFileIcon, {})
|
|
215
233
|
})
|
|
216
|
-
}), browserSupportsSpeechRecognition && handleRecord && /*#__PURE__*/
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
children: /*#__PURE__*/_jsx(
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
234
|
+
}), browserSupportsSpeechRecognition && handleRecord && /*#__PURE__*/_jsxs(_Fragment, {
|
|
235
|
+
children: [/*#__PURE__*/_jsx(Tooltip, {
|
|
236
|
+
title: t("record_message"),
|
|
237
|
+
children: isSmallScreen ? /*#__PURE__*/_jsx(_Fragment, {
|
|
238
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
|
239
|
+
sx: {
|
|
240
|
+
color: isListening ? "red" : "inherit",
|
|
241
|
+
animation: showMicReminder ? "reminder 1.6s ease-in-out infinite" : "none",
|
|
242
|
+
"@keyframes reminder": {
|
|
243
|
+
"0%": {
|
|
244
|
+
boxShadow: "0 0 0 0 rgba(255, 255, 255, 1)"
|
|
245
|
+
},
|
|
246
|
+
"70%": {
|
|
247
|
+
boxShadow: "0 0 0 2px rgba(255, 255, 255, 0.5)"
|
|
248
|
+
},
|
|
249
|
+
"100%": {
|
|
250
|
+
boxShadow: "0 0 0 0 rgba(255, 255, 255, 0)"
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
onClick: onClickRecord,
|
|
255
|
+
edge: "start",
|
|
256
|
+
id: "voiceInput",
|
|
257
|
+
disabled: disableInput,
|
|
258
|
+
size: "large",
|
|
259
|
+
ref: buttonRef,
|
|
260
|
+
children: isListening ? /*#__PURE__*/_jsx(MicOffIcon, {}) : /*#__PURE__*/_jsx(MicIcon, {})
|
|
261
|
+
})
|
|
262
|
+
}) : /*#__PURE__*/_jsx(_Fragment, {
|
|
263
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
264
|
+
sx: {
|
|
265
|
+
color: "white",
|
|
242
266
|
backgroundColor: isListening ? "#d32f2f" : "#2d7b30",
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
267
|
+
padding: 1,
|
|
268
|
+
paddingLeft: 2,
|
|
269
|
+
paddingRight: 2,
|
|
270
|
+
borderRadius: 3,
|
|
271
|
+
border: "1.5px solid black",
|
|
272
|
+
"&:hover": {
|
|
273
|
+
backgroundColor: isListening ? "#d32f2f" : "#2d7b30",
|
|
274
|
+
border: "1.5px solid white"
|
|
275
|
+
},
|
|
276
|
+
animation: showMicReminder ? "reminder 1.6s ease-in-out infinite" : "none",
|
|
277
|
+
"@keyframes reminder": {
|
|
278
|
+
"0%": {
|
|
279
|
+
transform: "scale(1)"
|
|
280
|
+
},
|
|
281
|
+
"50%": {
|
|
282
|
+
transform: "scale(1.05)"
|
|
283
|
+
},
|
|
284
|
+
"100%": {
|
|
285
|
+
transform: "scale(1)"
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
onClick: onClickRecord,
|
|
290
|
+
startIcon: isListening ? /*#__PURE__*/_jsx(MicOffIcon, {}) : /*#__PURE__*/_jsx(MicIcon, {}),
|
|
291
|
+
color: isListening ? "error" : "success",
|
|
292
|
+
disabled: disableInput,
|
|
293
|
+
variant: "contained",
|
|
294
|
+
id: "voiceInput",
|
|
295
|
+
ref: buttonRef,
|
|
296
|
+
children: isListening ? t("click_to_stop") : t("click_to_speak")
|
|
297
|
+
})
|
|
254
298
|
})
|
|
255
|
-
})
|
|
299
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
300
|
+
sx: {
|
|
301
|
+
marginLeft: 1.5,
|
|
302
|
+
marginRight: 1,
|
|
303
|
+
my: "auto",
|
|
304
|
+
fontWeight: "bold"
|
|
305
|
+
},
|
|
306
|
+
children: t("or")
|
|
307
|
+
})]
|
|
256
308
|
}), !browserSupportsSpeechRecognition && /*#__PURE__*/_jsx(Tooltip, {
|
|
257
309
|
title: t("only_available_on_chrome"),
|
|
258
310
|
children: /*#__PURE__*/_jsx("span", {
|
package/dist/Chat/Chat.js
CHANGED
|
@@ -94,6 +94,8 @@ function Chat({
|
|
|
94
94
|
noAnswerCounts,
|
|
95
95
|
isDynamicResponsesEnabled,
|
|
96
96
|
isUserInternal,
|
|
97
|
+
isAdvancedBot = false,
|
|
98
|
+
username,
|
|
97
99
|
isChallengeBot = false
|
|
98
100
|
}) {
|
|
99
101
|
const {
|
|
@@ -196,6 +198,8 @@ function Chat({
|
|
|
196
198
|
inputRef: inputRef,
|
|
197
199
|
authenticated: authenticated,
|
|
198
200
|
placeholder: placeholder,
|
|
201
|
+
isAdvancedBot: isAdvancedBot,
|
|
202
|
+
username: username,
|
|
199
203
|
isChallengeBot: isChallengeBot
|
|
200
204
|
})]
|
|
201
205
|
});
|
|
@@ -12,7 +12,8 @@ function SelectExercise({
|
|
|
12
12
|
getCourseSections,
|
|
13
13
|
getRoleplays,
|
|
14
14
|
handleCreateGame,
|
|
15
|
-
username
|
|
15
|
+
username,
|
|
16
|
+
courseSectionTopicId = ""
|
|
16
17
|
}) {
|
|
17
18
|
const [isExerciseSelected, setIsExerciseSelected] = useState(false);
|
|
18
19
|
return /*#__PURE__*/_jsxs(ResponsiveDialog, {
|
|
@@ -33,7 +34,8 @@ function SelectExercise({
|
|
|
33
34
|
t: t,
|
|
34
35
|
isExerciseSelected: isExerciseSelected,
|
|
35
36
|
setIsExerciseSelected: setIsExerciseSelected,
|
|
36
|
-
isDialogOpen: open
|
|
37
|
+
isDialogOpen: open,
|
|
38
|
+
courseSectionTopicId: courseSectionTopicId
|
|
37
39
|
})
|
|
38
40
|
})]
|
|
39
41
|
});
|
|
@@ -99,7 +99,8 @@ function Bot({
|
|
|
99
99
|
isDynamicResponsesEnabled,
|
|
100
100
|
aiChatbotConversationHistory,
|
|
101
101
|
isUserInternal,
|
|
102
|
-
handleStudentMisuse
|
|
102
|
+
handleStudentMisuse,
|
|
103
|
+
username
|
|
103
104
|
}) {
|
|
104
105
|
const theme = useTheme();
|
|
105
106
|
const {
|
|
@@ -639,6 +640,8 @@ function Bot({
|
|
|
639
640
|
isSpeakingTextContainer: isSpeakingTextContainer,
|
|
640
641
|
isDynamicResponsesEnabled: isDynamicResponsesClassroomEnabled,
|
|
641
642
|
isUserInternal: isUserInternal,
|
|
643
|
+
isAdvancedBot: bot.isAdvancedBot,
|
|
644
|
+
username: username,
|
|
642
645
|
isChallengeBot: bot.isChallengeBot
|
|
643
646
|
}), /*#__PURE__*/_jsx(ResponsiveDialog, {
|
|
644
647
|
open: instructionDialogOpen,
|
|
@@ -761,7 +761,7 @@ function Pronouncer({
|
|
|
761
761
|
id: "voiceInput",
|
|
762
762
|
variant: "contained",
|
|
763
763
|
ref: btnRef,
|
|
764
|
-
children: recognizing ? t("click_to_stop") : t("
|
|
764
|
+
children: recognizing ? t("click_to_stop") : t("click_to_speak")
|
|
765
765
|
})
|
|
766
766
|
}), /*#__PURE__*/_jsx(Grid, {
|
|
767
767
|
children: /*#__PURE__*/_jsx(Typography, {
|
|
@@ -213,7 +213,7 @@ function AnswerOptions({
|
|
|
213
213
|
variant: "contained",
|
|
214
214
|
size: "large",
|
|
215
215
|
ref: buttonRef,
|
|
216
|
-
children: recognizing ? t("click_to_stop") : t("
|
|
216
|
+
children: recognizing ? t("click_to_stop") : t("click_to_speak")
|
|
217
217
|
}), /*#__PURE__*/_jsx(Typography, {
|
|
218
218
|
role: "status",
|
|
219
219
|
textAlign: "center",
|
|
@@ -208,7 +208,7 @@ function AnswerOptions({
|
|
|
208
208
|
size: "large",
|
|
209
209
|
ref: buttonRef,
|
|
210
210
|
"aria-label": ariaLiveText,
|
|
211
|
-
children: recognizing ? t("click_to_stop") : t("
|
|
211
|
+
children: recognizing ? t("click_to_stop") : t("click_to_speak")
|
|
212
212
|
}), /*#__PURE__*/_jsx(Typography, {
|
|
213
213
|
role: "status",
|
|
214
214
|
textAlign: "center",
|