@nualang/nualang-ui-components 0.1.1278 → 0.1.1280
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/AssignmentCardsList/AssignmentCardsList.js +131 -54
- package/dist/Dialogs/DynamicAIWarning/DynamicAIWarning.js +175 -0
- package/dist/Dialogs/DynamicAIWarning/owl.png +0 -0
- package/dist/Exercises/Bot/Bot.js +8 -3
- package/dist/Forms/CreateBot/Steps/BotSettings/BotSettings.js +6 -6
- package/dist/Forms/CreateClassroom/CreateClassroom.js +1 -0
- package/dist/Forms/CreateClassroom/Steps/ClassroomSettings/ClassroomSettings.js +63 -1
- package/dist/Forms/CreateClassroom/Steps/CourseSettings/CourseSettings.js +20 -14
- package/dist/Forms/CreateRoleplay/Steps/RoleplaySettings/RoleplaySettings.js +12 -12
- package/dist/Forms/CreateRoleplayHook/Steps/RoleplaySettings/RoleplaySettings.js +12 -12
- package/dist/Forms/UpdateClassroom/UpdateClassroom.js +11 -3
- package/dist/Screens/Activity/Exercise/Attempt/Attempt.js +1 -1
- package/dist/Screens/Classrooms/ViewClassroom/ViewClassroom.js +25 -2
- package/dist/hooks/useExerciseState.js +6 -4
- package/package.json +1 -1
|
@@ -32,7 +32,8 @@ const AssignmentCardsList = ({
|
|
|
32
32
|
memberId,
|
|
33
33
|
handleViewProgress,
|
|
34
34
|
lastAssignmentFetch,
|
|
35
|
-
assignmentMembersById
|
|
35
|
+
assignmentMembersById = {},
|
|
36
|
+
isLoadingAssignments
|
|
36
37
|
}) => {
|
|
37
38
|
const [lastClickedExerciseId, setLastClickedExerciseId] = (0, _react.useState)(null);
|
|
38
39
|
(0, _react.useEffect)(() => {
|
|
@@ -48,9 +49,81 @@ const AssignmentCardsList = ({
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
}, []);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
if (isLoadingAssignments) {
|
|
53
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
54
|
+
mb: 1,
|
|
55
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
56
|
+
display: "flex",
|
|
57
|
+
justifyContent: "space-between",
|
|
58
|
+
alignItems: "center",
|
|
59
|
+
sx: {
|
|
60
|
+
mb: 2
|
|
61
|
+
},
|
|
62
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
63
|
+
variant: "text",
|
|
64
|
+
width: 160,
|
|
65
|
+
height: 36
|
|
66
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
67
|
+
variant: "circular",
|
|
68
|
+
width: 40,
|
|
69
|
+
height: 40
|
|
70
|
+
})]
|
|
71
|
+
}), Array.from({
|
|
72
|
+
length: 3
|
|
73
|
+
}).map((_, idx) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
74
|
+
sx: {
|
|
75
|
+
border: "1px solid",
|
|
76
|
+
borderColor: "divider",
|
|
77
|
+
borderRadius: 2,
|
|
78
|
+
p: 2,
|
|
79
|
+
mb: 2
|
|
80
|
+
},
|
|
81
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
82
|
+
variant: "text",
|
|
83
|
+
width: "30%",
|
|
84
|
+
height: 28
|
|
85
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
86
|
+
variant: "text",
|
|
87
|
+
width: "55%"
|
|
88
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
89
|
+
variant: "rectangular",
|
|
90
|
+
height: 80,
|
|
91
|
+
sx: {
|
|
92
|
+
my: 1.5,
|
|
93
|
+
borderRadius: 1
|
|
94
|
+
}
|
|
95
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
96
|
+
display: "flex",
|
|
97
|
+
gap: 1,
|
|
98
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
99
|
+
variant: "rectangular",
|
|
100
|
+
width: 120,
|
|
101
|
+
height: 36,
|
|
102
|
+
sx: {
|
|
103
|
+
borderRadius: 1
|
|
104
|
+
}
|
|
105
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
106
|
+
variant: "rectangular",
|
|
107
|
+
width: 120,
|
|
108
|
+
height: 36,
|
|
109
|
+
sx: {
|
|
110
|
+
borderRadius: 1
|
|
111
|
+
}
|
|
112
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Skeleton, {
|
|
113
|
+
variant: "rectangular",
|
|
114
|
+
width: 80,
|
|
115
|
+
height: 36,
|
|
116
|
+
sx: {
|
|
117
|
+
borderRadius: 1
|
|
118
|
+
}
|
|
119
|
+
})]
|
|
120
|
+
})]
|
|
121
|
+
}, idx))]
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
if (assignments.length === 0) {
|
|
125
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
126
|
+
mb: 1,
|
|
54
127
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
55
128
|
alignItems: "center",
|
|
56
129
|
sx: {
|
|
@@ -126,61 +199,65 @@ const AssignmentCardsList = ({
|
|
|
126
199
|
})
|
|
127
200
|
})]
|
|
128
201
|
})
|
|
129
|
-
})
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
return
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
205
|
+
mb: 1,
|
|
206
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
207
|
+
display: "flex",
|
|
208
|
+
justifyContent: "space-between",
|
|
209
|
+
alignItems: "center",
|
|
210
|
+
sx: {
|
|
211
|
+
mb: 2
|
|
212
|
+
},
|
|
213
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
214
|
+
variant: "h5",
|
|
215
|
+
children: t("assignments")
|
|
216
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
217
|
+
placement: "left",
|
|
218
|
+
title: t("refresh_assignments"),
|
|
219
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
220
|
+
onClick: refreshAssignments,
|
|
221
|
+
"aria-label": "refresh",
|
|
222
|
+
size: "large",
|
|
223
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Refresh.default, {})
|
|
224
|
+
})
|
|
225
|
+
})]
|
|
226
|
+
}), assignments.filter(assignment => {
|
|
227
|
+
if (isCreator) return true;
|
|
228
|
+
if (Array.isArray(assignment.assignedStudents) && !assignment.assignedStudents.includes(memberId)) {
|
|
229
|
+
return false;
|
|
230
|
+
}
|
|
231
|
+
if (!assignment.scheduleDate) return true;
|
|
232
|
+
return new Date(assignment.scheduleDate) <= new Date();
|
|
233
|
+
}).map((assignment, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_AssignmentCard.default, {
|
|
234
|
+
index: index,
|
|
235
|
+
lastAssignmentFetch: lastAssignmentFetch,
|
|
236
|
+
assignment: assignment,
|
|
237
|
+
t: t,
|
|
238
|
+
isCreator: isCreator,
|
|
239
|
+
getCourses: getCourses,
|
|
240
|
+
getCourseSections: getCourseSections,
|
|
241
|
+
getRoleplays: getRoleplays,
|
|
242
|
+
deleteAssignment: deleteAssignment,
|
|
243
|
+
handleEditAssignment: handleEditAssignment,
|
|
244
|
+
lastClickedExerciseId: lastClickedExerciseId,
|
|
245
|
+
progressHelpers: progressHelpers,
|
|
246
|
+
fetchMemberCourseCompletions: fetchMemberCourseCompletions,
|
|
247
|
+
username: username,
|
|
248
|
+
preferred_username: preferred_username,
|
|
249
|
+
memberId: memberId,
|
|
250
|
+
handleViewProgress: handleViewProgress,
|
|
251
|
+
assignedStudents: assignmentMembersById[assignment.assignmentId] || []
|
|
252
|
+
}, assignment.assignmentId))]
|
|
178
253
|
});
|
|
179
254
|
};
|
|
180
255
|
AssignmentCardsList.propTypes = {
|
|
181
256
|
t: _propTypes.default.func,
|
|
182
257
|
assignments: _propTypes.default.array,
|
|
183
258
|
isCreator: _propTypes.default.bool,
|
|
184
|
-
onRefresh: _propTypes.default.func
|
|
259
|
+
onRefresh: _propTypes.default.func,
|
|
260
|
+
isLoadingAssignments: _propTypes.default.bool,
|
|
261
|
+
assignmentMembersById: _propTypes.default.object
|
|
185
262
|
};
|
|
186
263
|
var _default = exports.default = AssignmentCardsList;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _ResponsiveDialog = _interopRequireDefault(require("../ResponsiveDialog"));
|
|
8
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
9
|
+
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
10
|
+
var _Settings = _interopRequireDefault(require("@mui/icons-material/Settings"));
|
|
11
|
+
var _material = require("@mui/material");
|
|
12
|
+
var _Search = _interopRequireDefault(require("@mui/icons-material/Search"));
|
|
13
|
+
var _East = _interopRequireDefault(require("@mui/icons-material/East"));
|
|
14
|
+
var _owl = _interopRequireDefault(require("./owl.png"));
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
// import { useState } from "react";
|
|
18
|
+
// components
|
|
19
|
+
|
|
20
|
+
function DynamicAIWarning({
|
|
21
|
+
t = text => text,
|
|
22
|
+
open = false,
|
|
23
|
+
handleClose,
|
|
24
|
+
handleSubmit,
|
|
25
|
+
dialogTitle
|
|
26
|
+
}) {
|
|
27
|
+
const submit = event => {
|
|
28
|
+
event.preventDefault();
|
|
29
|
+
handleSubmit();
|
|
30
|
+
};
|
|
31
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ResponsiveDialog.default, {
|
|
32
|
+
open: open,
|
|
33
|
+
handleClose: handleClose,
|
|
34
|
+
submitText: t("classroom_settings"),
|
|
35
|
+
dialogTitle: dialogTitle,
|
|
36
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
37
|
+
display: "flex",
|
|
38
|
+
flexDirection: "column",
|
|
39
|
+
alignItems: "stretch",
|
|
40
|
+
width: "100%",
|
|
41
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
42
|
+
variant: "h6",
|
|
43
|
+
component: "h2",
|
|
44
|
+
gutterBottom: true,
|
|
45
|
+
align: "left",
|
|
46
|
+
paddingBottom: 1,
|
|
47
|
+
children: t("chatbot_now_ai")
|
|
48
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
49
|
+
variant: "body2",
|
|
50
|
+
align: "left",
|
|
51
|
+
gutterBottom: true,
|
|
52
|
+
children: t("chatbot_now_ai_desc")
|
|
53
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
54
|
+
variant: "body2",
|
|
55
|
+
align: "left",
|
|
56
|
+
marginTop: 2,
|
|
57
|
+
gutterBottom: true,
|
|
58
|
+
children: t("chatbot_now_ai_benefit")
|
|
59
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
60
|
+
display: "flex",
|
|
61
|
+
alignItems: "center",
|
|
62
|
+
mt: 2,
|
|
63
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Search.default, {
|
|
64
|
+
sx: {
|
|
65
|
+
ml: -0.5,
|
|
66
|
+
mr: 0.5,
|
|
67
|
+
color: "text.secondary"
|
|
68
|
+
},
|
|
69
|
+
fontSize: "small"
|
|
70
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
71
|
+
variant: "body2",
|
|
72
|
+
align: "left",
|
|
73
|
+
children: t("ai_learn_more")
|
|
74
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_East.default, {
|
|
75
|
+
sx: {
|
|
76
|
+
ml: 0.5,
|
|
77
|
+
color: "text.secondary"
|
|
78
|
+
},
|
|
79
|
+
fontSize: "small"
|
|
80
|
+
})]
|
|
81
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
82
|
+
component: "a",
|
|
83
|
+
href: "https://www.waysidepublishing.com/teaching-resources/ai-enhanced-nualang-chatbot",
|
|
84
|
+
target: "_blank",
|
|
85
|
+
rel: "noopener noreferrer",
|
|
86
|
+
display: "flex",
|
|
87
|
+
flexDirection: "row",
|
|
88
|
+
alignItems: "center",
|
|
89
|
+
sx: {
|
|
90
|
+
width: "100%",
|
|
91
|
+
borderRadius: 2,
|
|
92
|
+
my: 2,
|
|
93
|
+
backgroundColor: "#f9f0fa",
|
|
94
|
+
border: "1px solid #c2c2c2",
|
|
95
|
+
boxShadow: 1,
|
|
96
|
+
overflow: "hidden",
|
|
97
|
+
textDecoration: "none",
|
|
98
|
+
color: "black",
|
|
99
|
+
cursor: "pointer",
|
|
100
|
+
transition: "0.3s",
|
|
101
|
+
"&:hover": {
|
|
102
|
+
boxShadow: 3,
|
|
103
|
+
backgroundColor: "#f3e5f5"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
107
|
+
flex: 2,
|
|
108
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
109
|
+
variant: "body1",
|
|
110
|
+
gutterBottom: true,
|
|
111
|
+
ml: 1,
|
|
112
|
+
children: t("chatbot_now_ai")
|
|
113
|
+
})
|
|
114
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
115
|
+
flex: 1,
|
|
116
|
+
display: "flex",
|
|
117
|
+
justifyContent: "flex-end",
|
|
118
|
+
alignItems: "center",
|
|
119
|
+
height: "100%",
|
|
120
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
121
|
+
component: "img",
|
|
122
|
+
src: _owl.default,
|
|
123
|
+
alt: "AI Illustration",
|
|
124
|
+
sx: {
|
|
125
|
+
height: 60,
|
|
126
|
+
width: 60,
|
|
127
|
+
objectFit: "cover",
|
|
128
|
+
objectPosition: "center",
|
|
129
|
+
borderTopRightRadius: 8,
|
|
130
|
+
borderBottomRightRadius: 8,
|
|
131
|
+
display: "block"
|
|
132
|
+
}
|
|
133
|
+
})
|
|
134
|
+
})]
|
|
135
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
136
|
+
display: "flex",
|
|
137
|
+
alignItems: "center",
|
|
138
|
+
pt: 1,
|
|
139
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Settings.default, {
|
|
140
|
+
sx: {
|
|
141
|
+
ml: -0.5,
|
|
142
|
+
mr: 0.5,
|
|
143
|
+
color: "text.secondary"
|
|
144
|
+
},
|
|
145
|
+
fontSize: "small"
|
|
146
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
147
|
+
variant: "body2",
|
|
148
|
+
align: "left",
|
|
149
|
+
children: t("prefer_original_version")
|
|
150
|
+
})]
|
|
151
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Typography.default, {
|
|
152
|
+
variant: "body2",
|
|
153
|
+
align: "left",
|
|
154
|
+
children: [t("chatbot_now_ai_revert_settings"), " ", /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
155
|
+
component: "span",
|
|
156
|
+
variant: "body2",
|
|
157
|
+
sx: {
|
|
158
|
+
color: "primary.main",
|
|
159
|
+
cursor: "pointer",
|
|
160
|
+
fontWeight: "bold"
|
|
161
|
+
},
|
|
162
|
+
onClick: submit,
|
|
163
|
+
children: t("classroom_settings")
|
|
164
|
+
}), " ", "for this class."]
|
|
165
|
+
})]
|
|
166
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Divider, {
|
|
167
|
+
sx: {
|
|
168
|
+
paddingTop: 3,
|
|
169
|
+
marginBottom: -2,
|
|
170
|
+
width: "100%"
|
|
171
|
+
}
|
|
172
|
+
})]
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
var _default = exports.default = DynamicAIWarning;
|
|
Binary file
|
|
@@ -151,9 +151,14 @@ function Bot({
|
|
|
151
151
|
toggleListen(learnLang, speechContexts, model);
|
|
152
152
|
};
|
|
153
153
|
let isDynamicResponsesClassroomEnabled = isDynamicResponsesEnabled;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
154
|
+
const parentClassroomDynamicResponsesEnabled = parentClassroom?.isDynamicResponsesEnabled === undefined || parentClassroom?.isDynamicResponsesEnabled === "enabled";
|
|
155
|
+
if (parentClassroomDynamicResponsesEnabled) {
|
|
156
|
+
if (courseSettings?.isDynamicResponsesEnabled === "enabled") {
|
|
157
|
+
isDynamicResponsesClassroomEnabled = "enable";
|
|
158
|
+
} else if (courseSettings?.isDynamicResponsesEnabled === "disabled") {
|
|
159
|
+
isDynamicResponsesClassroomEnabled = "disable";
|
|
160
|
+
}
|
|
161
|
+
} else {
|
|
157
162
|
isDynamicResponsesClassroomEnabled = "disable";
|
|
158
163
|
}
|
|
159
164
|
const exerciseState = (0, _useExerciseState.default)({
|
|
@@ -105,11 +105,11 @@ function BotSettings({
|
|
|
105
105
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
106
106
|
value: "enable",
|
|
107
107
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
108
|
-
label: t("
|
|
108
|
+
label: t("enabled")
|
|
109
109
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
110
110
|
value: "disable",
|
|
111
111
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
112
|
-
label: t("
|
|
112
|
+
label: t("disabled")
|
|
113
113
|
})]
|
|
114
114
|
})]
|
|
115
115
|
})
|
|
@@ -136,11 +136,11 @@ function BotSettings({
|
|
|
136
136
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
137
137
|
value: true,
|
|
138
138
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
139
|
-
label: t("
|
|
139
|
+
label: t("enabled")
|
|
140
140
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
141
141
|
value: false,
|
|
142
142
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
143
|
-
label: t("
|
|
143
|
+
label: t("disabled")
|
|
144
144
|
})]
|
|
145
145
|
})]
|
|
146
146
|
})
|
|
@@ -179,11 +179,11 @@ function BotSettings({
|
|
|
179
179
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
180
180
|
value: "enable",
|
|
181
181
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
182
|
-
label: t("
|
|
182
|
+
label: t("enabled")
|
|
183
183
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
184
184
|
value: "disable",
|
|
185
185
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
186
|
-
label: t("
|
|
186
|
+
label: t("disabled")
|
|
187
187
|
})]
|
|
188
188
|
})]
|
|
189
189
|
})
|
|
@@ -10,6 +10,7 @@ var Yup = _interopRequireWildcard(require("yup"));
|
|
|
10
10
|
var _Tooltip = _interopRequireDefault(require("@mui/material/Tooltip"));
|
|
11
11
|
var _ChipInput = _interopRequireDefault(require("../../../../Forms/ChipInput"));
|
|
12
12
|
var _index = require("../../../../utils/index");
|
|
13
|
+
var _Help = _interopRequireDefault(require("@mui/icons-material/Help"));
|
|
13
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
16
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
@@ -25,6 +26,8 @@ function ClassroomSettings({
|
|
|
25
26
|
isUpdateClassroom = false,
|
|
26
27
|
scrollToDiscuss = false,
|
|
27
28
|
setScrollToDiscuss,
|
|
29
|
+
scrollToDynamicResponses = false,
|
|
30
|
+
setScrollToDynamicResponses,
|
|
28
31
|
isVideoChatEnabled
|
|
29
32
|
}) {
|
|
30
33
|
const {
|
|
@@ -32,9 +35,11 @@ function ClassroomSettings({
|
|
|
32
35
|
enrolmentKey,
|
|
33
36
|
allowedDomains,
|
|
34
37
|
collaborators,
|
|
35
|
-
vchatEnabledInSettings
|
|
38
|
+
vchatEnabledInSettings,
|
|
39
|
+
isDynamicResponsesEnabled
|
|
36
40
|
} = values;
|
|
37
41
|
const vchatEnabledInSettingsRef = (0, _react.useRef)(null);
|
|
42
|
+
const dynamicResponsesRef = (0, _react.useRef)(null);
|
|
38
43
|
const generateRandomEnrolmentKey = () => {
|
|
39
44
|
return String(Math.floor(Math.random() * 90000) + 10000);
|
|
40
45
|
};
|
|
@@ -55,6 +60,15 @@ function ClassroomSettings({
|
|
|
55
60
|
setScrollToDiscuss(false);
|
|
56
61
|
}
|
|
57
62
|
}, [scrollToDiscuss]);
|
|
63
|
+
(0, _react.useEffect)(() => {
|
|
64
|
+
if (scrollToDynamicResponses) {
|
|
65
|
+
dynamicResponsesRef.current.scrollIntoView({
|
|
66
|
+
behavior: "smooth",
|
|
67
|
+
block: "center"
|
|
68
|
+
});
|
|
69
|
+
setScrollToDynamicResponses(false);
|
|
70
|
+
}
|
|
71
|
+
}, [scrollToDynamicResponses]);
|
|
58
72
|
const isInviteFeatureDisabled = classroomId && classroomId.toLowerCase().includes("wayside");
|
|
59
73
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
60
74
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
@@ -271,6 +285,54 @@ function ClassroomSettings({
|
|
|
271
285
|
})]
|
|
272
286
|
})]
|
|
273
287
|
})
|
|
288
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
289
|
+
ref: dynamicResponsesRef,
|
|
290
|
+
size: {
|
|
291
|
+
xs: 12,
|
|
292
|
+
md: 12
|
|
293
|
+
},
|
|
294
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.FormControl, {
|
|
295
|
+
component: "fieldset",
|
|
296
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.FormLabel, {
|
|
297
|
+
component: "legend",
|
|
298
|
+
children: [t("dynamic_response"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, {
|
|
299
|
+
title: t("dynamic_responses_info"),
|
|
300
|
+
placement: "right",
|
|
301
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
302
|
+
sx: {
|
|
303
|
+
padding: 0,
|
|
304
|
+
marginLeft: 1
|
|
305
|
+
},
|
|
306
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Help.default, {
|
|
307
|
+
fontSize: "small"
|
|
308
|
+
})
|
|
309
|
+
})
|
|
310
|
+
})]
|
|
311
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
312
|
+
color: "textSecondary",
|
|
313
|
+
children: t("dynamic_response_desc")
|
|
314
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.RadioGroup, {
|
|
315
|
+
row: true,
|
|
316
|
+
"aria-label": "isDynamicResponsesEnabled",
|
|
317
|
+
name: "isDynamicResponsesEnabled",
|
|
318
|
+
value: isDynamicResponsesEnabled || 'enabled',
|
|
319
|
+
onChange: handleChange,
|
|
320
|
+
onBlur: handleBlur,
|
|
321
|
+
helperText: touched.isDynamicResponsesEnabled ? errors.isDynamicResponsesEnabled : "",
|
|
322
|
+
error: touched.isDynamicResponsesEnabled && Boolean(errors.isDynamicResponsesEnabled),
|
|
323
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
324
|
+
value: 'enabled',
|
|
325
|
+
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
326
|
+
label: t("enabled"),
|
|
327
|
+
"data-cy": "enable-dynamic-responses-in-settings"
|
|
328
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
329
|
+
value: 'disabled',
|
|
330
|
+
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
331
|
+
label: t("disabled"),
|
|
332
|
+
"data-cy": "disable-dynamic-responses-in-settings"
|
|
333
|
+
})]
|
|
334
|
+
})]
|
|
335
|
+
})
|
|
274
336
|
})]
|
|
275
337
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
276
338
|
children: t("add_collaborators")
|
|
@@ -18,7 +18,8 @@ function Settings({
|
|
|
18
18
|
errors,
|
|
19
19
|
handleBlur,
|
|
20
20
|
courseId,
|
|
21
|
-
setFieldValue
|
|
21
|
+
setFieldValue,
|
|
22
|
+
classroomIsDynamicResponsesEnabled
|
|
22
23
|
}) {
|
|
23
24
|
const {
|
|
24
25
|
courseSettings
|
|
@@ -68,11 +69,11 @@ function Settings({
|
|
|
68
69
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
69
70
|
value: "enabled",
|
|
70
71
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
71
|
-
label: t("
|
|
72
|
+
label: t("enabled")
|
|
72
73
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
73
74
|
value: "disabled",
|
|
74
75
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
75
|
-
label: t("
|
|
76
|
+
label: t("disabled")
|
|
76
77
|
})]
|
|
77
78
|
})]
|
|
78
79
|
})
|
|
@@ -115,11 +116,11 @@ function Settings({
|
|
|
115
116
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
116
117
|
value: "enabled",
|
|
117
118
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
118
|
-
label: t("
|
|
119
|
+
label: t("enabled")
|
|
119
120
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
120
121
|
value: "disabled",
|
|
121
122
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
122
|
-
label: t("
|
|
123
|
+
label: t("disabled")
|
|
123
124
|
})]
|
|
124
125
|
})]
|
|
125
126
|
})
|
|
@@ -162,11 +163,11 @@ function Settings({
|
|
|
162
163
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
163
164
|
value: "enabled",
|
|
164
165
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
165
|
-
label: t("
|
|
166
|
+
label: t("enabled")
|
|
166
167
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
167
168
|
value: "disabled",
|
|
168
169
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
169
|
-
label: t("
|
|
170
|
+
label: t("disabled")
|
|
170
171
|
})]
|
|
171
172
|
})]
|
|
172
173
|
})
|
|
@@ -200,7 +201,7 @@ function Settings({
|
|
|
200
201
|
row: true,
|
|
201
202
|
"aria-label": "Dynamic Responses",
|
|
202
203
|
name: `courseSettings.${courseId}.isDynamicResponsesEnabled`,
|
|
203
|
-
value: thisCoursesSettings.isDynamicResponsesEnabled || "default",
|
|
204
|
+
value: classroomIsDynamicResponsesEnabled === 'disabled' ? 'disabled' : thisCoursesSettings.isDynamicResponsesEnabled || "default",
|
|
204
205
|
onChange: event => {
|
|
205
206
|
const newCourseSettings = {
|
|
206
207
|
...courseSettings,
|
|
@@ -217,11 +218,12 @@ function Settings({
|
|
|
217
218
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
218
219
|
value: "default",
|
|
219
220
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
220
|
-
label: t("course_default")
|
|
221
|
+
label: t("course_default"),
|
|
222
|
+
disabled: classroomIsDynamicResponsesEnabled === 'disabled'
|
|
221
223
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
222
224
|
value: "disabled",
|
|
223
225
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
224
|
-
label: t("
|
|
226
|
+
label: t("disabled")
|
|
225
227
|
})]
|
|
226
228
|
})]
|
|
227
229
|
})
|
|
@@ -237,7 +239,8 @@ function Course({
|
|
|
237
239
|
errors,
|
|
238
240
|
handleChange,
|
|
239
241
|
handleBlur,
|
|
240
|
-
setFieldValue
|
|
242
|
+
setFieldValue,
|
|
243
|
+
classroomIsDynamicResponsesEnabled
|
|
241
244
|
}) {
|
|
242
245
|
const [open, setOpen] = (0, _react.useState)(false);
|
|
243
246
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.List, {
|
|
@@ -289,7 +292,8 @@ function Course({
|
|
|
289
292
|
handleChange: handleChange,
|
|
290
293
|
handleBlur: handleBlur,
|
|
291
294
|
courseId: course.courseId,
|
|
292
|
-
setFieldValue: setFieldValue
|
|
295
|
+
setFieldValue: setFieldValue,
|
|
296
|
+
classroomIsDynamicResponsesEnabled: classroomIsDynamicResponsesEnabled
|
|
293
297
|
})
|
|
294
298
|
})
|
|
295
299
|
})]
|
|
@@ -303,7 +307,8 @@ function CourseSettings({
|
|
|
303
307
|
touched,
|
|
304
308
|
handleChange,
|
|
305
309
|
handleBlur,
|
|
306
|
-
setFieldValue
|
|
310
|
+
setFieldValue,
|
|
311
|
+
classroomIsDynamicResponsesEnabled
|
|
307
312
|
}) {
|
|
308
313
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
309
314
|
children: courses.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
@@ -318,7 +323,8 @@ function CourseSettings({
|
|
|
318
323
|
errors: errors,
|
|
319
324
|
handleChange: handleChange,
|
|
320
325
|
handleBlur: handleBlur,
|
|
321
|
-
setFieldValue: setFieldValue
|
|
326
|
+
setFieldValue: setFieldValue,
|
|
327
|
+
classroomIsDynamicResponsesEnabled: classroomIsDynamicResponsesEnabled
|
|
322
328
|
}))]
|
|
323
329
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
324
330
|
children: t("classroom_courses_not_found_desc")
|
|
@@ -103,11 +103,11 @@ function RoleplaySettings({
|
|
|
103
103
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
104
104
|
value: "enable",
|
|
105
105
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
106
|
-
label: t("
|
|
106
|
+
label: t("enabled")
|
|
107
107
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
108
108
|
value: "disable",
|
|
109
109
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
110
|
-
label: t("
|
|
110
|
+
label: t("disabled")
|
|
111
111
|
})]
|
|
112
112
|
})]
|
|
113
113
|
})]
|
|
@@ -135,11 +135,11 @@ function RoleplaySettings({
|
|
|
135
135
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
136
136
|
value: false,
|
|
137
137
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
138
|
-
label: t("
|
|
138
|
+
label: t("enabled")
|
|
139
139
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
140
140
|
value: true,
|
|
141
141
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
142
|
-
label: t("
|
|
142
|
+
label: t("disabled")
|
|
143
143
|
})]
|
|
144
144
|
})]
|
|
145
145
|
})
|
|
@@ -162,11 +162,11 @@ function RoleplaySettings({
|
|
|
162
162
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
163
163
|
value: false,
|
|
164
164
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
165
|
-
label: t("
|
|
165
|
+
label: t("enabled")
|
|
166
166
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
167
167
|
value: true,
|
|
168
168
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
169
|
-
label: t("
|
|
169
|
+
label: t("disabled")
|
|
170
170
|
})]
|
|
171
171
|
})]
|
|
172
172
|
})
|
|
@@ -189,11 +189,11 @@ function RoleplaySettings({
|
|
|
189
189
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
190
190
|
value: false,
|
|
191
191
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
192
|
-
label: t("
|
|
192
|
+
label: t("enabled")
|
|
193
193
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
194
194
|
value: true,
|
|
195
195
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
196
|
-
label: t("
|
|
196
|
+
label: t("disabled")
|
|
197
197
|
})]
|
|
198
198
|
})]
|
|
199
199
|
})
|
|
@@ -216,11 +216,11 @@ function RoleplaySettings({
|
|
|
216
216
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
217
217
|
value: false,
|
|
218
218
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
219
|
-
label: t("
|
|
219
|
+
label: t("enabled")
|
|
220
220
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
221
221
|
value: true,
|
|
222
222
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
223
|
-
label: t("
|
|
223
|
+
label: t("disabled")
|
|
224
224
|
})]
|
|
225
225
|
})]
|
|
226
226
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
@@ -242,11 +242,11 @@ function RoleplaySettings({
|
|
|
242
242
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
243
243
|
value: false,
|
|
244
244
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
245
|
-
label: t("
|
|
245
|
+
label: t("enabled")
|
|
246
246
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
247
247
|
value: true,
|
|
248
248
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
249
|
-
label: t("
|
|
249
|
+
label: t("disabled")
|
|
250
250
|
})]
|
|
251
251
|
})]
|
|
252
252
|
})
|
|
@@ -113,11 +113,11 @@ function RoleplaySettings({
|
|
|
113
113
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
114
114
|
value: "enable",
|
|
115
115
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
116
|
-
label: t("
|
|
116
|
+
label: t("enabled")
|
|
117
117
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
118
118
|
value: "disable",
|
|
119
119
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
120
|
-
label: t("
|
|
120
|
+
label: t("disabled")
|
|
121
121
|
})]
|
|
122
122
|
})
|
|
123
123
|
})]
|
|
@@ -157,11 +157,11 @@ function RoleplaySettings({
|
|
|
157
157
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
158
158
|
value: false,
|
|
159
159
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
160
|
-
label: t("
|
|
160
|
+
label: t("enabled")
|
|
161
161
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
162
162
|
value: true,
|
|
163
163
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
164
|
-
label: t("
|
|
164
|
+
label: t("disabled")
|
|
165
165
|
})]
|
|
166
166
|
})
|
|
167
167
|
})]
|
|
@@ -196,11 +196,11 @@ function RoleplaySettings({
|
|
|
196
196
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
197
197
|
value: false,
|
|
198
198
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
199
|
-
label: t("
|
|
199
|
+
label: t("enabled")
|
|
200
200
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
201
201
|
value: true,
|
|
202
202
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
203
|
-
label: t("
|
|
203
|
+
label: t("disabled")
|
|
204
204
|
})]
|
|
205
205
|
})
|
|
206
206
|
})]
|
|
@@ -235,11 +235,11 @@ function RoleplaySettings({
|
|
|
235
235
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
236
236
|
value: false,
|
|
237
237
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
238
|
-
label: t("
|
|
238
|
+
label: t("enabled")
|
|
239
239
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
240
240
|
value: true,
|
|
241
241
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
242
|
-
label: t("
|
|
242
|
+
label: t("disabled")
|
|
243
243
|
})]
|
|
244
244
|
})
|
|
245
245
|
})]
|
|
@@ -274,11 +274,11 @@ function RoleplaySettings({
|
|
|
274
274
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
275
275
|
value: false,
|
|
276
276
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
277
|
-
label: t("
|
|
277
|
+
label: t("enabled")
|
|
278
278
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
279
279
|
value: true,
|
|
280
280
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
281
|
-
label: t("
|
|
281
|
+
label: t("disabled")
|
|
282
282
|
})]
|
|
283
283
|
})
|
|
284
284
|
})]
|
|
@@ -313,11 +313,11 @@ function RoleplaySettings({
|
|
|
313
313
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
314
314
|
value: false,
|
|
315
315
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
316
|
-
label: t("
|
|
316
|
+
label: t("enabled")
|
|
317
317
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
318
318
|
value: true,
|
|
319
319
|
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Radio, {}),
|
|
320
|
-
label: t("
|
|
320
|
+
label: t("disabled")
|
|
321
321
|
})]
|
|
322
322
|
})
|
|
323
323
|
})]
|
|
@@ -32,7 +32,8 @@ function UpdateClassroom({
|
|
|
32
32
|
collaborators: [],
|
|
33
33
|
tags: [],
|
|
34
34
|
picture: null,
|
|
35
|
-
courseSettings: {}
|
|
35
|
+
courseSettings: {},
|
|
36
|
+
isDynamicResponsesEnabled: 'enabled'
|
|
36
37
|
},
|
|
37
38
|
onSubmit,
|
|
38
39
|
enableReinitialize,
|
|
@@ -46,6 +47,8 @@ function UpdateClassroom({
|
|
|
46
47
|
courses,
|
|
47
48
|
scrollToDiscuss,
|
|
48
49
|
setScrollToDiscuss,
|
|
50
|
+
scrollToDynamicResponses,
|
|
51
|
+
setScrollToDynamicResponses,
|
|
49
52
|
isClassroomArchived = false,
|
|
50
53
|
verificationStatus,
|
|
51
54
|
isVideoChatEnabled
|
|
@@ -67,7 +70,8 @@ function UpdateClassroom({
|
|
|
67
70
|
picture,
|
|
68
71
|
banner,
|
|
69
72
|
tags,
|
|
70
|
-
courseSettings
|
|
73
|
+
courseSettings,
|
|
74
|
+
isDynamicResponsesEnabled
|
|
71
75
|
} = initialValues;
|
|
72
76
|
const courseIds = courses.map(course => course.courseId);
|
|
73
77
|
let validatedCourseSettings;
|
|
@@ -180,7 +184,8 @@ function UpdateClassroom({
|
|
|
180
184
|
allowedDomains,
|
|
181
185
|
collaborators,
|
|
182
186
|
vchatEnabled,
|
|
183
|
-
vchatEnabledInSettings
|
|
187
|
+
vchatEnabledInSettings,
|
|
188
|
+
isDynamicResponsesEnabled
|
|
184
189
|
},
|
|
185
190
|
enableReinitialize: enableReinitialize,
|
|
186
191
|
validationSchema: _Steps.ClassroomSettings.validationSchema,
|
|
@@ -224,6 +229,8 @@ function UpdateClassroom({
|
|
|
224
229
|
values: values,
|
|
225
230
|
scrollToDiscuss: scrollToDiscuss,
|
|
226
231
|
setScrollToDiscuss: setScrollToDiscuss,
|
|
232
|
+
scrollToDynamicResponses: scrollToDynamicResponses,
|
|
233
|
+
setScrollToDynamicResponses: setScrollToDynamicResponses,
|
|
227
234
|
isVideoChatEnabled: isVideoChatEnabled,
|
|
228
235
|
...otherProps
|
|
229
236
|
})
|
|
@@ -345,6 +352,7 @@ function UpdateClassroom({
|
|
|
345
352
|
values: values,
|
|
346
353
|
handleChange: handleChange,
|
|
347
354
|
setFieldValue: setFieldValue,
|
|
355
|
+
classroomIsDynamicResponsesEnabled: isDynamicResponsesEnabled,
|
|
348
356
|
...otherProps
|
|
349
357
|
})
|
|
350
358
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Divider, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.CardActions, {
|
|
@@ -480,7 +480,7 @@ function Attempt({
|
|
|
480
480
|
const hasInappropriate = (0, _react.useMemo)(() => (messages || []).some(m => m.studentInappropriate), [messages]);
|
|
481
481
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
482
482
|
className: classes.root,
|
|
483
|
-
children: [hasInappropriate && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
483
|
+
children: [hasInappropriate && isCreator && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
484
484
|
style: {
|
|
485
485
|
backgroundColor: "#ffcccc",
|
|
486
486
|
padding: "10px",
|
|
@@ -41,7 +41,6 @@ var _index = _interopRequireDefault(require("../../../utils/placeholder-images/i
|
|
|
41
41
|
var _CreateMeetingMultiStepForm = _interopRequireDefault(require("../../../Forms/CreateMeetingMultiStepForm/CreateMeetingMultiStepForm"));
|
|
42
42
|
var _RecordingListCards = _interopRequireDefault(require("../../../Tables/RecordingListCards/RecordingListCards"));
|
|
43
43
|
var _MeetingPromptsList = _interopRequireDefault(require("../../../Tables/MeetingPrompstList/MeetingPromptsList"));
|
|
44
|
-
var _SubmissionsTableCards = _interopRequireDefault(require("../../../Tables/SubmissionsTableCards/SubmissionsTableCards"));
|
|
45
44
|
var _SelectExercise = _interopRequireDefault(require("../../../Dialogs/SelectExercise"));
|
|
46
45
|
var _iconsMaterial = require("@mui/icons-material");
|
|
47
46
|
var _Discussions = _interopRequireDefault(require("../../../Misc/NotFound/Discussions"));
|
|
@@ -58,6 +57,7 @@ var _ExitToApp = _interopRequireDefault(require("@mui/icons-material/ExitToApp")
|
|
|
58
57
|
var _AssignmentCardsList = _interopRequireDefault(require("../../../Assignments/AssignmentCardsList/AssignmentCardsList"));
|
|
59
58
|
var _Lightbulb = _interopRequireDefault(require("@mui/icons-material/Lightbulb"));
|
|
60
59
|
var _CreatorNotSubscribedUpgrade = _interopRequireDefault(require("../../../Dialogs/CreatorNotSubscribedUpgrade/CreatorNotSubscribedUpgrade"));
|
|
60
|
+
var _DynamicAIWarning = _interopRequireDefault(require("../../../Dialogs/DynamicAIWarning/DynamicAIWarning"));
|
|
61
61
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
62
62
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
63
63
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
@@ -501,6 +501,7 @@ function Classroom({
|
|
|
501
501
|
assignedCourses,
|
|
502
502
|
assignmentMembersById,
|
|
503
503
|
email,
|
|
504
|
+
isLoadingAssignments,
|
|
504
505
|
...otherProps
|
|
505
506
|
}) {
|
|
506
507
|
const {
|
|
@@ -552,9 +553,18 @@ function Classroom({
|
|
|
552
553
|
const [isPictureDialogOpen, setIsPictureDialogOpen] = (0, _react.useState)(false);
|
|
553
554
|
const [overwriteValue, setOverwriteValue] = (0, _react.useState)(null);
|
|
554
555
|
const [scrollToDiscuss, setScrollToDiscuss] = (0, _react.useState)(false);
|
|
556
|
+
const [scrollToDynamicResponses, setScrollToDynamicResponses] = (0, _react.useState)(false);
|
|
557
|
+
const [displayDynamicAiDialog, setDisplayDynamicAiDialog] = (0, _react.useState)(false);
|
|
555
558
|
const isWaysideClassroom = classroom?.classroomId?.toLowerCase().includes("wayside");
|
|
556
559
|
const [isSubscriptionExpired, setIsSubscriptionExpired] = (0, _react.useState)(false);
|
|
557
560
|
let tabs;
|
|
561
|
+
(0, _react.useEffect)(() => {
|
|
562
|
+
const hasDisplayed = localStorage.getItem("displayDynamicAiDialog");
|
|
563
|
+
if (!hasDisplayed && classroom?.isCreator) {
|
|
564
|
+
setDisplayDynamicAiDialog(true);
|
|
565
|
+
localStorage.setItem("displayDynamicAiDialog", "true");
|
|
566
|
+
}
|
|
567
|
+
}, [classroom]);
|
|
558
568
|
(0, _react.useEffect)(() => {
|
|
559
569
|
if (creatorSubscription?.isPaidUser === false) {
|
|
560
570
|
setIsSubscriptionExpired(true);
|
|
@@ -864,6 +874,11 @@ function Classroom({
|
|
|
864
874
|
window.location.hash = "#Settings";
|
|
865
875
|
setScrollToDiscuss(true);
|
|
866
876
|
};
|
|
877
|
+
const handleGoToDynamicResponsesSettings = () => {
|
|
878
|
+
setDisplayDynamicAiDialog(false);
|
|
879
|
+
window.location.hash = "#Settings";
|
|
880
|
+
setScrollToDynamicResponses(true);
|
|
881
|
+
};
|
|
867
882
|
tabs = [{
|
|
868
883
|
label: t("courses"),
|
|
869
884
|
id: "Courses",
|
|
@@ -948,7 +963,8 @@ function Classroom({
|
|
|
948
963
|
getCourses: getCourses,
|
|
949
964
|
refreshAssignments: refreshAssignments,
|
|
950
965
|
progressHelpers: progressHelpers,
|
|
951
|
-
preferred_username: preferred_username
|
|
966
|
+
preferred_username: preferred_username,
|
|
967
|
+
isLoadingAssignments: isLoadingAssignments
|
|
952
968
|
})
|
|
953
969
|
}, `tab-content-assignments`)
|
|
954
970
|
}, ...(isVideoChatEnabled && isNualangLiveEnabled && (isMember && isVideoChatEnabledInSettings || isCreator) ? [{
|
|
@@ -1144,6 +1160,8 @@ function Classroom({
|
|
|
1144
1160
|
courses: courses,
|
|
1145
1161
|
scrollToDiscuss: scrollToDiscuss,
|
|
1146
1162
|
setScrollToDiscuss: setScrollToDiscuss,
|
|
1163
|
+
scrollToDynamicResponses: scrollToDynamicResponses,
|
|
1164
|
+
setScrollToDynamicResponses: setScrollToDynamicResponses,
|
|
1147
1165
|
isClassroomArchived: isArchived,
|
|
1148
1166
|
classroomMembers: classroomMembers,
|
|
1149
1167
|
verificationStatus: verificationStatus,
|
|
@@ -1514,6 +1532,11 @@ function Classroom({
|
|
|
1514
1532
|
itemId: classroomId,
|
|
1515
1533
|
learnLang: classroom.learnLang,
|
|
1516
1534
|
isWaysideClassroom: isWaysideClassroom
|
|
1535
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_DynamicAIWarning.default, {
|
|
1536
|
+
handleSubmit: handleGoToDynamicResponsesSettings,
|
|
1537
|
+
open: displayDynamicAiDialog,
|
|
1538
|
+
handleClose: () => setDisplayDynamicAiDialog(false),
|
|
1539
|
+
t: t
|
|
1517
1540
|
}), run && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactJoyride.default, {
|
|
1518
1541
|
callback: handleJoyrideCallback,
|
|
1519
1542
|
continuous: true,
|
|
@@ -1350,10 +1350,12 @@ function useExerciseState({
|
|
|
1350
1350
|
setIsWordBankAttemptChanged(false);
|
|
1351
1351
|
};
|
|
1352
1352
|
const formatBotMessages = async botMessages => {
|
|
1353
|
+
// to remove baseprompt from conversation history
|
|
1354
|
+
const updatedConversationHistory = conversationHistory.slice(1);
|
|
1353
1355
|
const responses = await Promise.all(botMessages.map(async (m, i) => {
|
|
1354
1356
|
const updatedMessage = {
|
|
1355
1357
|
...m,
|
|
1356
|
-
studentInappropriate:
|
|
1358
|
+
studentInappropriate: m?.studentInappropriate === true || updatedConversationHistory[i]?.studentInappropriate === true ? true : false
|
|
1357
1359
|
};
|
|
1358
1360
|
if (updatedMessage.audioBlob) {
|
|
1359
1361
|
delete updatedMessage.audioBlob;
|
|
@@ -1577,7 +1579,7 @@ function useExerciseState({
|
|
|
1577
1579
|
};
|
|
1578
1580
|
const response = await handleMessageBot(bot.botId, body);
|
|
1579
1581
|
if (response.errorMessage) {
|
|
1580
|
-
openSnackbar("problem_getting_reply", "error");
|
|
1582
|
+
openSnackbar(t("problem_getting_reply"), "error");
|
|
1581
1583
|
} else if (typeof response === "string" && response.startsWith("Syntax error:")) {
|
|
1582
1584
|
openSnackbar(response, "error");
|
|
1583
1585
|
}
|
|
@@ -1596,7 +1598,7 @@ function useExerciseState({
|
|
|
1596
1598
|
}
|
|
1597
1599
|
} catch (error) {
|
|
1598
1600
|
console.error(error);
|
|
1599
|
-
openSnackbar("problem_getting_reply", "error");
|
|
1601
|
+
openSnackbar(t("problem_getting_reply"), "error");
|
|
1600
1602
|
setBotMessages(prevMessages => prevMessages.filter(message => message.isLoading !== true));
|
|
1601
1603
|
}
|
|
1602
1604
|
};
|
|
@@ -1687,7 +1689,7 @@ function useExerciseState({
|
|
|
1687
1689
|
if (responseFromMisuse && responseFromMisuse.error) {
|
|
1688
1690
|
openSnackbar(responseFromMisuse.error, "error");
|
|
1689
1691
|
} else {
|
|
1690
|
-
openSnackbar("student_misuse_reported", "info");
|
|
1692
|
+
openSnackbar(t("student_misuse_reported"), "info");
|
|
1691
1693
|
}
|
|
1692
1694
|
}
|
|
1693
1695
|
} else if (exerciseName === "roleplay") {
|