@nualang/nualang-ui-components 0.1.1231 → 0.1.1232
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/AssignmentCard/AssignmentCard.js +4 -5
- package/dist/Assignments/AssignmentCardsList/AssignmentCardsList.js +19 -2
- package/dist/Assignments/AssignmentCourseSelection/AssignmentCourseSelection.js +9 -4
- package/dist/Assignments/AssignmentExerciseSelection/AssignmentExerciseSelection.js +38 -7
- package/dist/Assignments/AssignmentExerciseSelector/AssignmentExerciseSelector.js +4 -2
- package/dist/Assignments/AssignmentRoleplaySelection/AssignmentRoleplaySelection.js +19 -8
- package/dist/Assignments/AssignmentSelectExercise/AssignmentSelectExercise.js +2 -2
- package/dist/Cards/SubscriptionPlan/SubscriptionPlan.js +12 -12
- package/dist/Dialogs/Listener/Listener.js +1 -1
- package/dist/Lists/RoleplaySelection/RoleplaySelection.js +1 -1
- package/dist/Screens/Classrooms/ViewClassroom/ViewClassroom.js +14 -0
- package/dist/Tables/MeetingPrompstList/MeetingPromptsList.js +5 -1
- package/dist/Tables/Progress/Progress.js +137 -77
- package/dist/Tables/Progress/ProgressTable.js +240 -64
- package/dist/Tables/Progress/utils.js +7 -242
- package/dist/Tables/RecordingListCards/RecordingListCards.js +1 -1
- package/dist/Tables/ScheduleListCards/ScheduleListCards.js +3 -9
- package/dist/Tables/SubmissionsTableCards/SubmissionsTableCards.js +10 -1
- package/dist/utils/index.js +221 -148
- package/package.json +1 -1
|
@@ -26,7 +26,8 @@ function AssignmentCard({
|
|
|
26
26
|
isCreator,
|
|
27
27
|
getCourses,
|
|
28
28
|
deleteAssignment,
|
|
29
|
-
handleEditAssignment
|
|
29
|
+
handleEditAssignment,
|
|
30
|
+
lastClickedExerciseId
|
|
30
31
|
}) {
|
|
31
32
|
const [confirm] = (0, _useConfirm.default)(t);
|
|
32
33
|
const handleDeleteAssignment = async (classroomId, assignmentId) => {
|
|
@@ -39,9 +40,6 @@ function AssignmentCard({
|
|
|
39
40
|
const now = new Date();
|
|
40
41
|
const due = new Date(dueDate);
|
|
41
42
|
const scheduled = new Date(scheduledDate);
|
|
42
|
-
console.log('now', now);
|
|
43
|
-
console.log('due', due);
|
|
44
|
-
console.log('scheduled', scheduled);
|
|
45
43
|
if (scheduled > now) {
|
|
46
44
|
const daysUntilScheduled = Math.ceil((scheduled - now) / (1000 * 60 * 60 * 24));
|
|
47
45
|
if (daysUntilScheduled === 1) {
|
|
@@ -196,7 +194,8 @@ function AssignmentCard({
|
|
|
196
194
|
getRoleplays: getRoleplays,
|
|
197
195
|
isCreator: isCreator,
|
|
198
196
|
viewOnly: true,
|
|
199
|
-
useCase: isCreator ? "assignment-view" : "assignment-start"
|
|
197
|
+
useCase: isCreator ? "assignment-view" : "assignment-start",
|
|
198
|
+
lastClickedExerciseId: lastClickedExerciseId
|
|
200
199
|
})
|
|
201
200
|
})]
|
|
202
201
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Grid, {
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _material = require("@mui/material");
|
|
10
10
|
var _AssignmentCard = _interopRequireDefault(require("../AssignmentCard/AssignmentCard"));
|
|
@@ -13,6 +13,8 @@ var _teacherCreate = _interopRequireDefault(require("../../img/teacher-create-2.
|
|
|
13
13
|
var _Add = _interopRequireDefault(require("@mui/icons-material/Add"));
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
18
|
const AssignmentCardsList = ({
|
|
17
19
|
t = text => text,
|
|
18
20
|
assignments = [],
|
|
@@ -25,6 +27,20 @@ const AssignmentCardsList = ({
|
|
|
25
27
|
handleEditAssignment,
|
|
26
28
|
refreshAssignments
|
|
27
29
|
}) => {
|
|
30
|
+
const [lastClickedExerciseId, setLastClickedExerciseId] = (0, _react.useState)(null);
|
|
31
|
+
(0, _react.useEffect)(() => {
|
|
32
|
+
const stored = localStorage.getItem("lastClickedExercise");
|
|
33
|
+
if (stored) {
|
|
34
|
+
try {
|
|
35
|
+
const parsed = JSON.parse(stored);
|
|
36
|
+
if (parsed?.courseSectionTopicId) {
|
|
37
|
+
setLastClickedExerciseId(parsed.courseSectionTopicId);
|
|
38
|
+
}
|
|
39
|
+
} catch (e) {
|
|
40
|
+
console.error("Error parsing lastClickedExercise", e);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}, []);
|
|
28
44
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
29
45
|
mb: 1,
|
|
30
46
|
children: assignments.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
@@ -117,7 +133,8 @@ const AssignmentCardsList = ({
|
|
|
117
133
|
getCourseSections: getCourseSections,
|
|
118
134
|
getRoleplays: getRoleplays,
|
|
119
135
|
deleteAssignment: deleteAssignment,
|
|
120
|
-
handleEditAssignment: handleEditAssignment
|
|
136
|
+
handleEditAssignment: handleEditAssignment,
|
|
137
|
+
lastClickedExerciseId: lastClickedExerciseId
|
|
121
138
|
}, assignment.assignmentId))]
|
|
122
139
|
})
|
|
123
140
|
});
|
|
@@ -28,9 +28,11 @@ function Course({
|
|
|
28
28
|
assignment,
|
|
29
29
|
handleStartExercise,
|
|
30
30
|
isCreator,
|
|
31
|
-
viewOnly
|
|
31
|
+
viewOnly,
|
|
32
|
+
lastClickedExerciseId
|
|
32
33
|
}) {
|
|
33
|
-
const
|
|
34
|
+
const numOfIds = lastClickedExerciseId ? lastClickedExerciseId.split('|') : [];
|
|
35
|
+
const [open, setOpen] = (0, _react.useState)(lastClickedExerciseId && (numOfIds.length === 4 && lastClickedExerciseId.endsWith(`|${assignment.assignmentId}`) || numOfIds.length === 5 && lastClickedExerciseId.split('|')[3] === assignment.assignmentId));
|
|
34
36
|
const [selectedSectionIds, setSelectedSectionIds] = (0, _react.useState)([]);
|
|
35
37
|
const [filteredSections, setFilteredSections] = (0, _react.useState)([]);
|
|
36
38
|
const sectionsQuery = _Queries.courses.useCourseSections(async (courseId, filters) => {
|
|
@@ -127,7 +129,8 @@ function Course({
|
|
|
127
129
|
assignment: assignment,
|
|
128
130
|
handleStartExercise: handleStartExercise,
|
|
129
131
|
isCreator: isCreator,
|
|
130
|
-
viewOnly: viewOnly
|
|
132
|
+
viewOnly: viewOnly,
|
|
133
|
+
lastClickedExerciseId: lastClickedExerciseId
|
|
131
134
|
})
|
|
132
135
|
})
|
|
133
136
|
})]
|
|
@@ -148,6 +151,7 @@ function AssignmentCourseSelection({
|
|
|
148
151
|
handleStartExercise,
|
|
149
152
|
isCreator,
|
|
150
153
|
viewOnly,
|
|
154
|
+
lastClickedExerciseId,
|
|
151
155
|
...otherProps
|
|
152
156
|
}) {
|
|
153
157
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -166,7 +170,8 @@ function AssignmentCourseSelection({
|
|
|
166
170
|
assignment: assignment,
|
|
167
171
|
handleStartExercise: handleStartExercise,
|
|
168
172
|
isCreator: isCreator,
|
|
169
|
-
viewOnly: viewOnly
|
|
173
|
+
viewOnly: viewOnly,
|
|
174
|
+
lastClickedExerciseId: lastClickedExerciseId
|
|
170
175
|
}))
|
|
171
176
|
});
|
|
172
177
|
}
|
|
@@ -34,7 +34,8 @@ function Exercise({
|
|
|
34
34
|
handleSelectExercise = null,
|
|
35
35
|
selectedExercises,
|
|
36
36
|
useCase,
|
|
37
|
-
assignment
|
|
37
|
+
assignment,
|
|
38
|
+
lastClickedExerciseId
|
|
38
39
|
}) {
|
|
39
40
|
const [listeningHidden, setListeningHidden] = (0, _react.useState)(false);
|
|
40
41
|
const [translationHidden, setTranslationHidden] = (0, _react.useState)(false);
|
|
@@ -49,6 +50,10 @@ function Exercise({
|
|
|
49
50
|
} = params;
|
|
50
51
|
const [courseId, sectionId, topicId] = courseSectionTopicId.split("|");
|
|
51
52
|
const addSearchParams = () => {
|
|
53
|
+
const lastClickedExercise = {
|
|
54
|
+
courseSectionTopicId: `${courseSectionTopicId}|${assignment.assignmentId}`
|
|
55
|
+
};
|
|
56
|
+
localStorage.setItem("lastClickedExercise", JSON.stringify(lastClickedExercise));
|
|
52
57
|
const assignmentParam = encodeURIComponent(JSON.stringify(assignment));
|
|
53
58
|
navigate(`/classrooms/${classroomId}/${courseId}/${sectionId}/${topicId}?exercise=${name}&assignment=${assignmentParam}`);
|
|
54
59
|
};
|
|
@@ -137,7 +142,8 @@ function Exercise({
|
|
|
137
142
|
handleSelectExercise: handleSelectExercise,
|
|
138
143
|
selectedExercises: selectedExercises,
|
|
139
144
|
useCase: useCase,
|
|
140
|
-
assignment: assignment
|
|
145
|
+
assignment: assignment,
|
|
146
|
+
lastClickedExerciseId: lastClickedExerciseId
|
|
141
147
|
})
|
|
142
148
|
})
|
|
143
149
|
})]
|
|
@@ -161,6 +167,7 @@ function ExerciseList({
|
|
|
161
167
|
assignment,
|
|
162
168
|
handleStartExercise,
|
|
163
169
|
isCreator,
|
|
170
|
+
lastClickedExerciseId,
|
|
164
171
|
...otherProps
|
|
165
172
|
}) {
|
|
166
173
|
const courseSectionTopicId = `${courseId}|${sectionId}|${topicId}`;
|
|
@@ -188,6 +195,7 @@ function ExerciseList({
|
|
|
188
195
|
assignment: assignment,
|
|
189
196
|
handleStartExercise: handleStartExercise,
|
|
190
197
|
isCreator: isCreator,
|
|
198
|
+
lastClickedExerciseId: lastClickedExerciseId,
|
|
191
199
|
...otherProps
|
|
192
200
|
}, keyId);
|
|
193
201
|
})
|
|
@@ -226,12 +234,23 @@ function Topic({
|
|
|
226
234
|
assignment,
|
|
227
235
|
handleStartExercise,
|
|
228
236
|
isCreator,
|
|
237
|
+
lastClickedExerciseId,
|
|
229
238
|
...otherProps
|
|
230
239
|
}) {
|
|
231
240
|
const theme = (0, _styles.useTheme)();
|
|
232
241
|
const isLargeScreen = (0, _useMediaQuery.default)(theme.breakpoints.up("sm"));
|
|
233
|
-
const
|
|
242
|
+
const topicRef = (0, _react.useRef)(null);
|
|
243
|
+
const [lasClickedCourseId, lasClickedSectionId, lasClickedTopicId, lastClickedAssignmentId] = lastClickedExerciseId?.split("|") || [];
|
|
244
|
+
const [isExerciseListOpen, setExerciseListOpen] = (0, _react.useState)(lasClickedTopicId === topicId && lastClickedAssignmentId === assignment.assignmentId);
|
|
234
245
|
const [isWholeTopicSelected, setIsWholeTopicSelected] = (0, _react.useState)(false);
|
|
246
|
+
(0, _react.useEffect)(() => {
|
|
247
|
+
if (lasClickedTopicId === topicId && topicRef.current) {
|
|
248
|
+
topicRef.current.scrollIntoView({
|
|
249
|
+
behavior: "smooth",
|
|
250
|
+
block: "start"
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}, []);
|
|
235
254
|
let exercises;
|
|
236
255
|
switch (useCase) {
|
|
237
256
|
case "assignment-select":
|
|
@@ -294,7 +313,7 @@ function Topic({
|
|
|
294
313
|
games = ["roleplay-story", "roleplay-fill-in-the-blanks", "roleplay-act-it-out", "roleplay-act-it-out-listening", "roleplay-act-it-out-speaking", "roleplay-act-it-out-listening-speaking"];
|
|
295
314
|
}
|
|
296
315
|
(0, _react.useEffect)(() => {
|
|
297
|
-
const exerciseCount = selectedExercises?.filter(exercise => exercise.courseSectionTopicId === `${courseId}|${sectionId}|${topicId}`).length;
|
|
316
|
+
const exerciseCount = selectedExercises?.filter(exercise => !exercise.roleplayId && exercise.courseSectionTopicId === `${courseId}|${sectionId}|${topicId}`).length;
|
|
298
317
|
const roleplayCount = selectedExercises?.filter(exercise => exercise.roleplayId && roleplays?.some(roleplay => roleplay.roleplayId === exercise.roleplayId)).length;
|
|
299
318
|
const total = roleplays.length * 6 + 3;
|
|
300
319
|
if (exerciseCount + roleplayCount === total) {
|
|
@@ -322,7 +341,9 @@ function Topic({
|
|
|
322
341
|
if (!selectedExercises?.some(e => e.roleplayId === roleplay.roleplayId && e.game === game)) {
|
|
323
342
|
exercisesToAdd = [...exercisesToAdd, {
|
|
324
343
|
roleplayId: roleplay.roleplayId,
|
|
325
|
-
game
|
|
344
|
+
game,
|
|
345
|
+
courseSectionTopicId: `${courseId}|${sectionId}|${topicId}`,
|
|
346
|
+
roleplayName: roleplay.roleplayName
|
|
326
347
|
}];
|
|
327
348
|
}
|
|
328
349
|
});
|
|
@@ -344,6 +365,7 @@ function Topic({
|
|
|
344
365
|
justifyContent: "space-between",
|
|
345
366
|
onClick: toggleExerciseList,
|
|
346
367
|
"data-cy": "topic-list-item",
|
|
368
|
+
ref: topicRef,
|
|
347
369
|
disabled: phrases.length === 0 && !hasNonEmptyRoleplay || isExerciseSelected,
|
|
348
370
|
children: [isLargeScreen && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemAvatar, {
|
|
349
371
|
children: picture ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Avatar, {
|
|
@@ -431,6 +453,7 @@ function Topic({
|
|
|
431
453
|
assignment: assignment,
|
|
432
454
|
handleStartExercise: handleStartExercise,
|
|
433
455
|
isCreator: isCreator,
|
|
456
|
+
lastClickedExerciseId: lastClickedExerciseId,
|
|
434
457
|
...otherProps
|
|
435
458
|
})
|
|
436
459
|
})]
|
|
@@ -455,6 +478,7 @@ function Section({
|
|
|
455
478
|
handleStartExercise,
|
|
456
479
|
isCreator,
|
|
457
480
|
viewOnly,
|
|
481
|
+
lastClickedExerciseId,
|
|
458
482
|
...otherProps
|
|
459
483
|
}) {
|
|
460
484
|
const root = {
|
|
@@ -516,7 +540,8 @@ function Section({
|
|
|
516
540
|
useCase: useCase,
|
|
517
541
|
assignment: assignment,
|
|
518
542
|
handleStartExercise: handleStartExercise,
|
|
519
|
-
isCreator: isCreator
|
|
543
|
+
isCreator: isCreator,
|
|
544
|
+
lastClickedExerciseId: lastClickedExerciseId
|
|
520
545
|
}, `${sectionId}-${topic.topicId}`)) : topics.map((topic, i) => /*#__PURE__*/(0, _jsxRuntime.jsx)(Topic, {
|
|
521
546
|
index: i,
|
|
522
547
|
topics: topics,
|
|
@@ -537,7 +562,8 @@ function Section({
|
|
|
537
562
|
useCase: useCase,
|
|
538
563
|
assignment: assignment,
|
|
539
564
|
handleStartExercise: handleStartExercise,
|
|
540
|
-
isCreator: isCreator
|
|
565
|
+
isCreator: isCreator,
|
|
566
|
+
lastClickedExerciseId: lastClickedExerciseId
|
|
541
567
|
}, `${sectionId}-${topic.topicId}`))
|
|
542
568
|
})
|
|
543
569
|
});
|
|
@@ -558,6 +584,7 @@ function SectionList({
|
|
|
558
584
|
handleStartExercise,
|
|
559
585
|
isCreator,
|
|
560
586
|
viewOnly,
|
|
587
|
+
lastClickedExerciseId,
|
|
561
588
|
...otherProps
|
|
562
589
|
}) {
|
|
563
590
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
@@ -580,6 +607,7 @@ function SectionList({
|
|
|
580
607
|
handleStartExercise: handleStartExercise,
|
|
581
608
|
isCreator: isCreator,
|
|
582
609
|
viewOnly: viewOnly,
|
|
610
|
+
lastClickedExerciseId: lastClickedExerciseId,
|
|
583
611
|
...otherProps
|
|
584
612
|
}, section.sectionId);
|
|
585
613
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
@@ -607,6 +635,7 @@ function AssignmentExerciseSelection({
|
|
|
607
635
|
assignment,
|
|
608
636
|
handleStartExercise,
|
|
609
637
|
viewOnly,
|
|
638
|
+
lastClickedExerciseId,
|
|
610
639
|
...otherProps
|
|
611
640
|
}) {
|
|
612
641
|
if (isLoading) {
|
|
@@ -627,6 +656,7 @@ function AssignmentExerciseSelection({
|
|
|
627
656
|
assignment: assignment,
|
|
628
657
|
handleStartExercise: handleStartExercise,
|
|
629
658
|
viewOnly: viewOnly,
|
|
659
|
+
lastClickedExerciseId: lastClickedExerciseId,
|
|
630
660
|
...otherProps
|
|
631
661
|
})
|
|
632
662
|
});
|
|
@@ -649,6 +679,7 @@ function AssignmentExerciseSelection({
|
|
|
649
679
|
useCase: useCase,
|
|
650
680
|
assignment: assignment,
|
|
651
681
|
viewOnly: viewOnly,
|
|
682
|
+
lastClickedExerciseId: lastClickedExerciseId,
|
|
652
683
|
...otherProps
|
|
653
684
|
})
|
|
654
685
|
});
|
|
@@ -19,7 +19,8 @@ function AssignmentExerciseSelector({
|
|
|
19
19
|
isCreator,
|
|
20
20
|
selectedExercises,
|
|
21
21
|
viewOnly,
|
|
22
|
-
useCase
|
|
22
|
+
useCase,
|
|
23
|
+
lastClickedExerciseId
|
|
23
24
|
}) {
|
|
24
25
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_system.Box, {
|
|
25
26
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_AssignmentCourseSelection.default, {
|
|
@@ -33,7 +34,8 @@ function AssignmentExerciseSelector({
|
|
|
33
34
|
isCreator: isCreator,
|
|
34
35
|
selectedExercises: selectedExercises,
|
|
35
36
|
viewOnly: viewOnly,
|
|
36
|
-
useCase: useCase
|
|
37
|
+
useCase: useCase,
|
|
38
|
+
lastClickedExerciseId: lastClickedExerciseId
|
|
37
39
|
})
|
|
38
40
|
});
|
|
39
41
|
}
|
|
@@ -28,7 +28,8 @@ function Roleplay({
|
|
|
28
28
|
handleSelectExercise = null,
|
|
29
29
|
selectedExercises,
|
|
30
30
|
useCase,
|
|
31
|
-
assignment
|
|
31
|
+
assignment,
|
|
32
|
+
lastClickedExerciseId
|
|
32
33
|
}) {
|
|
33
34
|
const navigate = (0, _reactRouterDom.useNavigate)();
|
|
34
35
|
const params = (0, _reactRouterDom.useParams)();
|
|
@@ -36,15 +37,20 @@ function Roleplay({
|
|
|
36
37
|
classroomId
|
|
37
38
|
} = params;
|
|
38
39
|
const [courseId, sectionId, topicId] = courseSectionTopicId ? courseSectionTopicId.split("|") : "";
|
|
40
|
+
const [lasClickedCourseId, lasClickedSectionId, lasClickedTopicId, lastClickedAssignmentId, lastClickedRoleplayId] = lastClickedExerciseId?.split("|") || [];
|
|
39
41
|
const addSearchParams = exercise => {
|
|
40
42
|
if (!classroomId || !courseId || !sectionId || !topicId || !roleplay?.roleplayId) {
|
|
41
|
-
console.error(
|
|
43
|
+
console.error("Missing required parameters for navigation");
|
|
42
44
|
return;
|
|
43
45
|
}
|
|
46
|
+
const lastClickedExercise = {
|
|
47
|
+
courseSectionTopicId: `${courseSectionTopicId}|${assignment.assignmentId}|${roleplay.roleplayId}`
|
|
48
|
+
};
|
|
49
|
+
localStorage.setItem("lastClickedExercise", JSON.stringify(lastClickedExercise));
|
|
44
50
|
const assignmentParam = encodeURIComponent(JSON.stringify(assignment));
|
|
45
51
|
navigate(`/classrooms/${classroomId}/${courseId}/${sectionId}/${topicId}/roleplays/${roleplay?.roleplayId}?game=${encodeURIComponent(exercise)}&assignment=${assignmentParam}`);
|
|
46
52
|
};
|
|
47
|
-
const [open, setOpen] = (0, _react.useState)(
|
|
53
|
+
const [open, setOpen] = (0, _react.useState)(lastClickedRoleplayId === roleplay.roleplayId && lastClickedAssignmentId === assignment.assignmentId);
|
|
48
54
|
const games = ["roleplay-story", "roleplay-fill-in-the-blanks", "roleplay-act-it-out", "roleplay-act-it-out-listening", "roleplay-act-it-out-speaking", "roleplay-act-it-out-listening-speaking"];
|
|
49
55
|
const [isSelectAllChecked, setIsSelectAllChecked] = (0, _react.useState)(false);
|
|
50
56
|
(0, _react.useEffect)(() => {
|
|
@@ -64,7 +70,9 @@ function Roleplay({
|
|
|
64
70
|
if (!selectedExercises?.some(e => e.roleplayId === roleplay.roleplayId && e.game === game)) {
|
|
65
71
|
gamesToAdd = [...gamesToAdd, {
|
|
66
72
|
roleplayId: roleplay.roleplayId,
|
|
67
|
-
game
|
|
73
|
+
game,
|
|
74
|
+
courseSectionTopicId: roleplay.courseSectionTopicId,
|
|
75
|
+
roleplayName: roleplay.roleplayName
|
|
68
76
|
}];
|
|
69
77
|
}
|
|
70
78
|
});
|
|
@@ -105,7 +113,7 @@ function Roleplay({
|
|
|
105
113
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
106
114
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
107
115
|
title: !isRoleplayValid ? t("roleplay_not_valid") : "",
|
|
108
|
-
placement: "
|
|
116
|
+
placement: "right",
|
|
109
117
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
110
118
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.ListItemButton, {
|
|
111
119
|
onClick: () => setOpen(!open),
|
|
@@ -214,7 +222,8 @@ function Roleplay({
|
|
|
214
222
|
children: [useCase === "assignment-select" && games.map((game, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.ListItemButton, {
|
|
215
223
|
onClick: () => handleSelectExercise([{
|
|
216
224
|
roleplayId: roleplay.roleplayId,
|
|
217
|
-
game
|
|
225
|
+
game,
|
|
226
|
+
courseSectionTopicId: roleplay.courseSectionTopicId
|
|
218
227
|
}]),
|
|
219
228
|
sx: {
|
|
220
229
|
display: "flex",
|
|
@@ -271,7 +280,8 @@ function AssignmentRoleplaySelection({
|
|
|
271
280
|
handleSelectExercise,
|
|
272
281
|
selectedExercises,
|
|
273
282
|
useCase,
|
|
274
|
-
assignment
|
|
283
|
+
assignment,
|
|
284
|
+
lastClickedExerciseId
|
|
275
285
|
}) {
|
|
276
286
|
const [isRoleplaySelected, setIsRoleplaySelected] = (0, _react.useState)(false);
|
|
277
287
|
return roleplays.map((roleplay, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(Roleplay, {
|
|
@@ -284,7 +294,8 @@ function AssignmentRoleplaySelection({
|
|
|
284
294
|
handleSelectExercise: handleSelectExercise,
|
|
285
295
|
selectedExercises: selectedExercises,
|
|
286
296
|
useCase: useCase,
|
|
287
|
-
assignment: assignment
|
|
297
|
+
assignment: assignment,
|
|
298
|
+
lastClickedExerciseId: lastClickedExerciseId
|
|
288
299
|
}, index));
|
|
289
300
|
}
|
|
290
301
|
var _default = exports.default = AssignmentRoleplaySelection;
|
|
@@ -29,10 +29,10 @@ function AssignmentSelectExercise({
|
|
|
29
29
|
setSelectedExercises(prevSelectedExercises => {
|
|
30
30
|
let updatedExercises = [...prevSelectedExercises];
|
|
31
31
|
exercises.forEach(exercise => {
|
|
32
|
-
if (exercise.courseSectionTopicId && updatedExercises.some(e => e.courseSectionTopicId === exercise.courseSectionTopicId && e.name === exercise.name)) {
|
|
32
|
+
if (exercise.courseSectionTopicId && !exercise.roleplayId && updatedExercises.some(e => e.courseSectionTopicId === exercise.courseSectionTopicId && e.name === exercise.name)) {
|
|
33
33
|
updatedExercises = updatedExercises.filter(e => e.courseSectionTopicId !== exercise.courseSectionTopicId || e.name !== exercise.name);
|
|
34
34
|
} else if (exercise.roleplayId && updatedExercises.some(e => e.roleplayId === exercise.roleplayId && e.game === exercise.game)) {
|
|
35
|
-
updatedExercises = updatedExercises.filter(e => !!e.courseSectionTopicId || e.roleplayId !== exercise.roleplayId || e.game !== exercise.game);
|
|
35
|
+
updatedExercises = updatedExercises.filter(e => !!e.courseSectionTopicId && !e.roleplayId || e.roleplayId !== exercise.roleplayId || e.game !== exercise.game);
|
|
36
36
|
} else {
|
|
37
37
|
updatedExercises.push(exercise);
|
|
38
38
|
}
|
|
@@ -234,7 +234,7 @@ function SubscriptionPlan({
|
|
|
234
234
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(CardContent, {
|
|
235
235
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(PlanTitle, {
|
|
236
236
|
variant: "h6",
|
|
237
|
-
children: displayPlan.title
|
|
237
|
+
children: t(displayPlan.title)
|
|
238
238
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(PlanPricing, {
|
|
239
239
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(PlanPricingTotal, {
|
|
240
240
|
variant: "h3",
|
|
@@ -251,12 +251,12 @@ function SubscriptionPlan({
|
|
|
251
251
|
title: /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
252
252
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactMarkdown.default, {
|
|
253
253
|
className: classes.planFeaturesListItemTooltipContent,
|
|
254
|
-
children: displayPlan.footnote
|
|
254
|
+
children: t(displayPlan.footnote)
|
|
255
255
|
})
|
|
256
256
|
}),
|
|
257
257
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Badge, {
|
|
258
258
|
component: "div",
|
|
259
|
-
children: displayPlan.badge
|
|
259
|
+
children: t(displayPlan.badge)
|
|
260
260
|
})
|
|
261
261
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {}), priceInfo && priceInfo.interval && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Typography, {
|
|
262
262
|
variant: "subtitle1",
|
|
@@ -265,7 +265,7 @@ function SubscriptionPlan({
|
|
|
265
265
|
})]
|
|
266
266
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(PlanSubtitle, {
|
|
267
267
|
variant: "subtitle1",
|
|
268
|
-
children: displayPlan.subtitle
|
|
268
|
+
children: t(displayPlan.subtitle)
|
|
269
269
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(PlanFeaturesList, {
|
|
270
270
|
children: (displayPlan.benefits || []).map((feature, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(PlanFeaturesListItem, {
|
|
271
271
|
children: [feature.supported ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckCircle.default, {
|
|
@@ -282,12 +282,12 @@ function SubscriptionPlan({
|
|
|
282
282
|
title: /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
283
283
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactMarkdown.default, {
|
|
284
284
|
className: classes.planFeaturesListItemTooltipContent,
|
|
285
|
-
children: feature.description
|
|
285
|
+
children: t(feature.description)
|
|
286
286
|
})
|
|
287
287
|
}),
|
|
288
288
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(PlanFeaturesListItemLabel, {
|
|
289
289
|
variant: "subtitle2",
|
|
290
|
-
children: [feature.label, /*#__PURE__*/(0, _jsxRuntime.jsx)(_HelpOutline.default, {
|
|
290
|
+
children: [t(feature.label), /*#__PURE__*/(0, _jsxRuntime.jsx)(_HelpOutline.default, {
|
|
291
291
|
fontSize: "small",
|
|
292
292
|
sx: {
|
|
293
293
|
ml: 0.5,
|
|
@@ -297,7 +297,7 @@ function SubscriptionPlan({
|
|
|
297
297
|
})
|
|
298
298
|
}), !feature.description && /*#__PURE__*/(0, _jsxRuntime.jsx)(PlanFeaturesListItemLabel, {
|
|
299
299
|
variant: "subtitle2",
|
|
300
|
-
children: feature.label
|
|
300
|
+
children: t(feature.label)
|
|
301
301
|
})]
|
|
302
302
|
}, `${displayPlan.title}-benefits-${index}`))
|
|
303
303
|
}), plan.button && /*#__PURE__*/(0, _jsxRuntime.jsx)(PlanButton, {
|
|
@@ -306,7 +306,7 @@ function SubscriptionPlan({
|
|
|
306
306
|
color: plan.button.buttonColor || "primary",
|
|
307
307
|
onClick: () => plan.button.onClick(),
|
|
308
308
|
bgPrimary: plan.bgPrimary,
|
|
309
|
-
children: plan.button.buttonText
|
|
309
|
+
children: t(plan.button.buttonText)
|
|
310
310
|
}), displayPlan && billingPeriod && currency && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
311
311
|
mt: 2,
|
|
312
312
|
children: [plan.planVersions && displayPlan.subButton && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
@@ -322,7 +322,7 @@ function SubscriptionPlan({
|
|
|
322
322
|
"aria-controls": open ? "demo-positioned-menu" : undefined,
|
|
323
323
|
"aria-haspopup": "true",
|
|
324
324
|
"aria-expanded": open ? "true" : "false",
|
|
325
|
-
children: plan.subButton.buttonText
|
|
325
|
+
children: t(plan.subButton.buttonText)
|
|
326
326
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
327
327
|
alignItems: "center",
|
|
328
328
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Menu, {
|
|
@@ -350,7 +350,7 @@ function SubscriptionPlan({
|
|
|
350
350
|
sx: {
|
|
351
351
|
margin: 2
|
|
352
352
|
},
|
|
353
|
-
children: [getPriceList(i), " ", currentPlan.title, " - Up to", " ", currentPlan.students, " Students"]
|
|
353
|
+
children: [getPriceList(i), " ", t(currentPlan.title), " - Up to", " ", t(currentPlan.students), " Students"]
|
|
354
354
|
})
|
|
355
355
|
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
356
356
|
"aria-label": "close",
|
|
@@ -378,11 +378,11 @@ function SubscriptionPlan({
|
|
|
378
378
|
disabled: buyNowDisabled,
|
|
379
379
|
onClick: () => displayPlan.buyButton.onClick(displayPlan, currency, billingPeriod),
|
|
380
380
|
bgPrimary: displayPlan.bgPrimary,
|
|
381
|
-
children: displayPlan.buyButton.buttonText
|
|
381
|
+
children: t(displayPlan.buyButton.buttonText)
|
|
382
382
|
})]
|
|
383
383
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactMarkdown.default, {
|
|
384
384
|
className: classes.planFootnote,
|
|
385
|
-
children: displayPlan.footnote
|
|
385
|
+
children: t(displayPlan.footnote)
|
|
386
386
|
})]
|
|
387
387
|
})
|
|
388
388
|
}), displayPlan && displayPlan.nuala && /*#__PURE__*/(0, _jsxRuntime.jsx)(Nuala, {
|
|
@@ -45,7 +45,7 @@ function Roleplay({
|
|
|
45
45
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
46
46
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
47
47
|
title: roleplay?.script?.length === 0 ? t("roleplay_no_interactions") : !isRoleplayValid ? t("roleplay_not_valid") : "",
|
|
48
|
-
placement: "
|
|
48
|
+
placement: "right",
|
|
49
49
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
50
50
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.ListItemButton, {
|
|
51
51
|
onClick: () => setOpen(!open),
|
|
@@ -375,6 +375,13 @@ function Classroom({
|
|
|
375
375
|
reportFilters = [],
|
|
376
376
|
filter,
|
|
377
377
|
handleFilterChange,
|
|
378
|
+
reportTypes = [],
|
|
379
|
+
reportType,
|
|
380
|
+
handleReportTypeChange,
|
|
381
|
+
assignmentOptions,
|
|
382
|
+
assignmentValue,
|
|
383
|
+
handleAssignmentChange,
|
|
384
|
+
selectedAssignment,
|
|
378
385
|
handleDeleteClassroomMember,
|
|
379
386
|
handleUpdateClassroomMember,
|
|
380
387
|
vchatProps = {},
|
|
@@ -867,6 +874,13 @@ function Classroom({
|
|
|
867
874
|
reportFilters: reportFilters,
|
|
868
875
|
filter: filter,
|
|
869
876
|
handleFilterChange: handleFilterChange,
|
|
877
|
+
reportTypes: reportTypes,
|
|
878
|
+
reportType: reportType,
|
|
879
|
+
handleReportTypeChange: handleReportTypeChange,
|
|
880
|
+
assignmentOptions: assignmentOptions,
|
|
881
|
+
assignmentValue: assignmentValue,
|
|
882
|
+
handleAssignmentChange: handleAssignmentChange,
|
|
883
|
+
selectedAssignment: selectedAssignment,
|
|
870
884
|
submissions: submissionsTableData,
|
|
871
885
|
featureFlags: featureFlags
|
|
872
886
|
})
|
|
@@ -48,7 +48,11 @@ const MeetingPromptsList = (0, _mui.withStyles)(({
|
|
|
48
48
|
const filteredDiscussions = scheduleListData.filter(item => filter === "active" ? !item.archived : item.archived);
|
|
49
49
|
const uniqueGroupedIds = [...new Set(filteredDiscussions.map(item => item.groupedId))];
|
|
50
50
|
const filteredScheduleListData = uniqueGroupedIds.map(id => filteredDiscussions.find(item => item.groupedId === id));
|
|
51
|
-
const sortedScheduleListData = filteredScheduleListData.sort((a, b) =>
|
|
51
|
+
const sortedScheduleListData = filteredScheduleListData.sort((a, b) => {
|
|
52
|
+
const dateTimeA = new Date(`${a.meetingDate} ${a.meetingTime}`);
|
|
53
|
+
const dateTimeB = new Date(`${b.meetingDate} ${b.meetingTime}`);
|
|
54
|
+
return dateTimeB - dateTimeA;
|
|
55
|
+
});
|
|
52
56
|
const openDialog = () => {
|
|
53
57
|
setDialogOpen(true);
|
|
54
58
|
};
|