@nualang/nualang-ui-components 0.1.1229 → 0.1.1231
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 +37 -31
- package/dist/Assignments/AssignmentCardsList/AssignmentCardsList.js +8 -5
- package/dist/Assignments/AssignmentExerciseSelection/AssignmentExerciseSelection.js +6 -4
- package/dist/Assignments/AssignmentRoleplaySelection/AssignmentRoleplaySelection.js +41 -8
- package/dist/Assignments/CreateAssignmentDialog/CreateAssignmentDialog.js +5 -5
- package/dist/Containers/App/App.js +3 -2
- package/dist/Dialogs/ExerciseMenu/Menus/CloseExercise/CloseExercise.js +13 -2
- package/dist/Dialogs/ExerciseMenu/Menus/CompletedExcercise/CompletedExcercise.js +14 -3
- package/dist/Dialogs/ExerciseMenu/Menus/InProgressExercise/InProgressExercise.js +13 -3
- package/dist/Dialogs/RecordingDialog/RecordingDialog.js +41 -19
- package/dist/Dialogs/SelectExercise/SelectExercise.js +4 -36
- package/dist/Exercises/Listener/Listener.js +13 -4
- package/dist/Exercises/Pronouncer/Pronouncer.js +13 -4
- package/dist/Exercises/Roleplay/Games/ActItOutGame/ActItOutGame.js +8 -4
- package/dist/Exercises/Roleplay/Games/ActItOutGameListening/ActItOutGameListening.js +8 -4
- package/dist/Exercises/Roleplay/Games/ActItOutGameListeningAndSpeaking/ActItOutGame.js +8 -4
- package/dist/Exercises/Roleplay/Games/ActItOutGameSpeaking/ActItOutGame.js +8 -4
- package/dist/Exercises/Roleplay/Games/FillInTheBlanksGame/FillInTheBlanksGame.js +8 -4
- package/dist/Exercises/Roleplay/Games/StoryGame/StoryGame.js +8 -4
- package/dist/Exercises/Roleplay/Roleplay.js +9 -1
- package/dist/Exercises/Translator/Translator.js +13 -4
- package/dist/Lists/ExerciseSelection/ExerciseSelection.js +3 -121
- package/dist/Lists/Exercises/Exercises.js +3 -0
- package/dist/Lists/RoleplaySelection/RoleplaySelection.js +2 -68
- package/dist/Screens/Classrooms/ViewClassroom/ViewClassroom.js +2 -2
- package/dist/utils/constants.js +33 -2
- package/package.json +1 -1
- package/dist/Cards/Assignment/Assignment.js +0 -231
- package/dist/Cards/Assignment/package.json +0 -7
- package/dist/Dialogs/CreateAssignment/CreateAssignment.js +0 -170
- package/dist/Dialogs/CreateAssignment/package.json +0 -7
- package/dist/Dialogs/CreateAssignmentScreen/CreateAssignmentScreen.js +0 -418
- package/dist/Dialogs/CreateAssignmentScreen/package.json +0 -7
- package/dist/Lists/AssignmentCardsList/AssignmentCardsList.js +0 -120
- package/dist/Lists/AssignmentCardsList/package.json +0 -7
- package/dist/Misc/AssignmentExerciseSelector/AssignmentExerciseSelector.js +0 -38
- package/dist/Misc/AssignmentExerciseSelector/package.json +0 -7
|
@@ -6,13 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = AssignmentCard;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
|
|
9
|
-
var _ExpandMore = _interopRequireDefault(require("@mui/icons-material/ExpandMore"));
|
|
10
|
-
var _ExpandLess = _interopRequireDefault(require("@mui/icons-material/ExpandLess"));
|
|
11
9
|
var _material = require("@mui/material");
|
|
12
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
11
|
var _AssignmentExerciseSelector = _interopRequireDefault(require("../AssignmentExerciseSelector/AssignmentExerciseSelector"));
|
|
14
12
|
var _Queries = require("@nualang/nualang-api-and-queries/Queries");
|
|
15
13
|
var _useConfirm = _interopRequireDefault(require("../../hooks/useConfirm"));
|
|
14
|
+
var _iconsMaterial = require("@mui/icons-material");
|
|
16
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
17
|
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); }
|
|
@@ -29,17 +28,30 @@ function AssignmentCard({
|
|
|
29
28
|
deleteAssignment,
|
|
30
29
|
handleEditAssignment
|
|
31
30
|
}) {
|
|
32
|
-
const [expanded, setExpanded] = (0, _react.useState)(false);
|
|
33
31
|
const [confirm] = (0, _useConfirm.default)(t);
|
|
34
32
|
const handleDeleteAssignment = async (classroomId, assignmentId) => {
|
|
35
|
-
const confirmed = await confirm(t(
|
|
33
|
+
const confirmed = await confirm(t("delete_assignment"), t("delete_assignment_confirmation"));
|
|
36
34
|
if (confirmed) {
|
|
37
35
|
await deleteAssignment(classroomId, assignmentId);
|
|
38
36
|
}
|
|
39
37
|
};
|
|
40
|
-
const calculateDaysUntilDue = dueDate => {
|
|
38
|
+
const calculateDaysUntilDue = (dueDate, scheduledDate) => {
|
|
41
39
|
const now = new Date();
|
|
42
40
|
const due = new Date(dueDate);
|
|
41
|
+
const scheduled = new Date(scheduledDate);
|
|
42
|
+
console.log('now', now);
|
|
43
|
+
console.log('due', due);
|
|
44
|
+
console.log('scheduled', scheduled);
|
|
45
|
+
if (scheduled > now) {
|
|
46
|
+
const daysUntilScheduled = Math.ceil((scheduled - now) / (1000 * 60 * 60 * 24));
|
|
47
|
+
if (daysUntilScheduled === 1) {
|
|
48
|
+
return t("available_tomorrow");
|
|
49
|
+
} else if (daysUntilScheduled === 0) {
|
|
50
|
+
return t("available_today");
|
|
51
|
+
} else {
|
|
52
|
+
return `${t("available_in")} ${daysUntilScheduled} ${t("days")}`;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
43
55
|
const diffTime = due - now;
|
|
44
56
|
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
|
45
57
|
if (diffDays < 0) {
|
|
@@ -52,10 +64,6 @@ function AssignmentCard({
|
|
|
52
64
|
return `${t("due_in")} ${diffDays} ${t("days")}`;
|
|
53
65
|
}
|
|
54
66
|
};
|
|
55
|
-
const handleIconClick = event => {
|
|
56
|
-
event.stopPropagation();
|
|
57
|
-
setExpanded(prev => !prev);
|
|
58
|
-
};
|
|
59
67
|
const {
|
|
60
68
|
uniqueCourses
|
|
61
69
|
} = (0, _react.useMemo)(() => {
|
|
@@ -135,34 +143,32 @@ function AssignmentCard({
|
|
|
135
143
|
children: `${Math.round(assignment.completed / assignment.assignedStudents.length * 100)}%`
|
|
136
144
|
})]
|
|
137
145
|
})]
|
|
138
|
-
}), isCreator && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Grid, {
|
|
139
|
-
item: true,
|
|
140
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
141
|
-
onClick: () => handleEditAssignment(assignment),
|
|
142
|
-
color: "primary",
|
|
143
|
-
children: t("edit")
|
|
144
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Button, {
|
|
145
|
-
color: "primary",
|
|
146
|
-
onClick: () => {
|
|
147
|
-
handleDeleteAssignment(assignment.classroomId, assignment.assignmentId);
|
|
148
|
-
},
|
|
149
|
-
children: [t("delete"), " "]
|
|
150
|
-
})]
|
|
151
146
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Grid, {
|
|
152
147
|
item: true,
|
|
153
148
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
154
149
|
variant: "button",
|
|
155
150
|
color: "text.secondary",
|
|
156
|
-
children: calculateDaysUntilDue(assignment.dueDate)
|
|
151
|
+
children: calculateDaysUntilDue(assignment.dueDate, assignment.scheduleDate)
|
|
157
152
|
})
|
|
158
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
153
|
+
}), isCreator && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Grid, {
|
|
159
154
|
item: true,
|
|
160
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.
|
|
161
|
-
|
|
162
|
-
children:
|
|
163
|
-
|
|
155
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
156
|
+
title: t("edit"),
|
|
157
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.IconButton, {
|
|
158
|
+
onClick: () => handleEditAssignment(assignment),
|
|
159
|
+
children: [" ", /*#__PURE__*/(0, _jsxRuntime.jsx)(_iconsMaterial.Edit, {}), " "]
|
|
160
|
+
})
|
|
161
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
162
|
+
title: t("delete"),
|
|
163
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.IconButton, {
|
|
164
|
+
onClick: () => {
|
|
165
|
+
handleDeleteAssignment(assignment.classroomId, assignment.assignmentId);
|
|
166
|
+
},
|
|
167
|
+
children: [" ", /*#__PURE__*/(0, _jsxRuntime.jsx)(_iconsMaterial.Delete, {}), " "]
|
|
168
|
+
})
|
|
169
|
+
})]
|
|
164
170
|
})]
|
|
165
|
-
}),
|
|
171
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
166
172
|
mt: 2,
|
|
167
173
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Divider, {
|
|
168
174
|
sx: {
|
|
@@ -180,7 +186,7 @@ function AssignmentCard({
|
|
|
180
186
|
children: assignment.instructions
|
|
181
187
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
182
188
|
mt: 2,
|
|
183
|
-
width: "80%",
|
|
189
|
+
width: isCreator ? "80%" : "100%",
|
|
184
190
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_AssignmentExerciseSelector.default, {
|
|
185
191
|
t: t,
|
|
186
192
|
assignment: assignment,
|
|
@@ -197,7 +203,7 @@ function AssignmentCard({
|
|
|
197
203
|
item: true,
|
|
198
204
|
xs: 3,
|
|
199
205
|
md: 2,
|
|
200
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
206
|
+
children: [isCreator && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
201
207
|
display: "flex",
|
|
202
208
|
justifyContent: "space-between",
|
|
203
209
|
alignItems: "center",
|
|
@@ -26,7 +26,6 @@ const AssignmentCardsList = ({
|
|
|
26
26
|
refreshAssignments
|
|
27
27
|
}) => {
|
|
28
28
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
29
|
-
mt: 3,
|
|
30
29
|
mb: 1,
|
|
31
30
|
children: assignments.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
32
31
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
@@ -48,14 +47,14 @@ const AssignmentCardsList = ({
|
|
|
48
47
|
sx: {
|
|
49
48
|
textAlign: "center",
|
|
50
49
|
mt: 2,
|
|
51
|
-
width:
|
|
50
|
+
width: "70%"
|
|
52
51
|
},
|
|
53
52
|
children: t("no_assignments_description")
|
|
54
53
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
55
54
|
sx: {
|
|
56
55
|
textAlign: "center",
|
|
57
56
|
mt: 2,
|
|
58
|
-
width:
|
|
57
|
+
width: "70%"
|
|
59
58
|
},
|
|
60
59
|
children: t("assignments_description")
|
|
61
60
|
}), isCreator && /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
@@ -106,7 +105,11 @@ const AssignmentCardsList = ({
|
|
|
106
105
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Refresh.default, {})
|
|
107
106
|
})
|
|
108
107
|
})]
|
|
109
|
-
}), assignments.
|
|
108
|
+
}), assignments.filter(assignment => {
|
|
109
|
+
if (isCreator) return true;
|
|
110
|
+
if (!assignment.scheduleDate) return true;
|
|
111
|
+
return new Date(assignment.scheduleDate) <= new Date();
|
|
112
|
+
}).map(assignment => /*#__PURE__*/(0, _jsxRuntime.jsx)(_AssignmentCard.default, {
|
|
110
113
|
assignment: assignment,
|
|
111
114
|
t: t,
|
|
112
115
|
isCreator: isCreator,
|
|
@@ -115,7 +118,7 @@ const AssignmentCardsList = ({
|
|
|
115
118
|
getRoleplays: getRoleplays,
|
|
116
119
|
deleteAssignment: deleteAssignment,
|
|
117
120
|
handleEditAssignment: handleEditAssignment
|
|
118
|
-
}, assignment.
|
|
121
|
+
}, assignment.assignmentId))]
|
|
119
122
|
})
|
|
120
123
|
});
|
|
121
124
|
};
|
|
@@ -29,12 +29,12 @@ function Exercise({
|
|
|
29
29
|
section,
|
|
30
30
|
t,
|
|
31
31
|
isExerciseSelected,
|
|
32
|
-
setIsExerciseSelected,
|
|
33
32
|
roleplays,
|
|
34
33
|
phrases,
|
|
35
34
|
handleSelectExercise = null,
|
|
36
35
|
selectedExercises,
|
|
37
|
-
useCase
|
|
36
|
+
useCase,
|
|
37
|
+
assignment
|
|
38
38
|
}) {
|
|
39
39
|
const [listeningHidden, setListeningHidden] = (0, _react.useState)(false);
|
|
40
40
|
const [translationHidden, setTranslationHidden] = (0, _react.useState)(false);
|
|
@@ -49,7 +49,8 @@ function Exercise({
|
|
|
49
49
|
} = params;
|
|
50
50
|
const [courseId, sectionId, topicId] = courseSectionTopicId.split("|");
|
|
51
51
|
const addSearchParams = () => {
|
|
52
|
-
|
|
52
|
+
const assignmentParam = encodeURIComponent(JSON.stringify(assignment));
|
|
53
|
+
navigate(`/classrooms/${classroomId}/${courseId}/${sectionId}/${topicId}?exercise=${name}&assignment=${assignmentParam}`);
|
|
53
54
|
};
|
|
54
55
|
const handleToggleRoleplays = () => {
|
|
55
56
|
setRoleplaysOpen(!roleplaysOpen);
|
|
@@ -135,7 +136,8 @@ function Exercise({
|
|
|
135
136
|
isExerciseSelected: isExerciseSelected,
|
|
136
137
|
handleSelectExercise: handleSelectExercise,
|
|
137
138
|
selectedExercises: selectedExercises,
|
|
138
|
-
useCase: useCase
|
|
139
|
+
useCase: useCase,
|
|
140
|
+
assignment: assignment
|
|
139
141
|
})
|
|
140
142
|
})
|
|
141
143
|
})]
|
|
@@ -12,6 +12,10 @@ var _RateReview = _interopRequireDefault(require("@mui/icons-material/RateReview
|
|
|
12
12
|
var _ExpandMore = _interopRequireDefault(require("@mui/icons-material/ExpandMore"));
|
|
13
13
|
var _ExpandLess = _interopRequireDefault(require("@mui/icons-material/ExpandLess"));
|
|
14
14
|
var _AutoStories = _interopRequireDefault(require("@mui/icons-material/AutoStories"));
|
|
15
|
+
var _Forum = _interopRequireDefault(require("@mui/icons-material/Forum"));
|
|
16
|
+
var _Headphones = _interopRequireDefault(require("@mui/icons-material/Headphones"));
|
|
17
|
+
var _RecordVoiceOver = _interopRequireDefault(require("@mui/icons-material/RecordVoiceOver"));
|
|
18
|
+
var _SpaceBar = _interopRequireDefault(require("@mui/icons-material/SpaceBar"));
|
|
15
19
|
var _reactRouterDom = require("react-router-dom");
|
|
16
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
21
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -23,7 +27,8 @@ function Roleplay({
|
|
|
23
27
|
isExerciseSelected,
|
|
24
28
|
handleSelectExercise = null,
|
|
25
29
|
selectedExercises,
|
|
26
|
-
useCase
|
|
30
|
+
useCase,
|
|
31
|
+
assignment
|
|
27
32
|
}) {
|
|
28
33
|
const navigate = (0, _reactRouterDom.useNavigate)();
|
|
29
34
|
const params = (0, _reactRouterDom.useParams)();
|
|
@@ -36,7 +41,8 @@ function Roleplay({
|
|
|
36
41
|
console.error('Missing required parameters for navigation');
|
|
37
42
|
return;
|
|
38
43
|
}
|
|
39
|
-
|
|
44
|
+
const assignmentParam = encodeURIComponent(JSON.stringify(assignment));
|
|
45
|
+
navigate(`/classrooms/${classroomId}/${courseId}/${sectionId}/${topicId}/roleplays/${roleplay?.roleplayId}?game=${encodeURIComponent(exercise)}&assignment=${assignmentParam}`);
|
|
40
46
|
};
|
|
41
47
|
const [open, setOpen] = (0, _react.useState)(false);
|
|
42
48
|
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"];
|
|
@@ -71,6 +77,31 @@ function Roleplay({
|
|
|
71
77
|
const roleplayHasInteractions = numberOfRoleplayInteractions > 0;
|
|
72
78
|
const roleplayHasQuestions = numberOfRoleplayQuestions > 0;
|
|
73
79
|
const isRoleplayValid = roleplayHasInteractions && roleplayHasQuestions;
|
|
80
|
+
const ActItOutListeningSpeakingIcon = () => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
81
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Headphones.default, {
|
|
82
|
+
fontSize: "small"
|
|
83
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_RecordVoiceOver.default, {
|
|
84
|
+
fontSize: "small"
|
|
85
|
+
})]
|
|
86
|
+
});
|
|
87
|
+
const getIconForGame = game => {
|
|
88
|
+
switch (game) {
|
|
89
|
+
case "roleplay-story":
|
|
90
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_AutoStories.default, {});
|
|
91
|
+
case "roleplay-fill-in-the-blanks":
|
|
92
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SpaceBar.default, {});
|
|
93
|
+
case "roleplay-act-it-out":
|
|
94
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Message.default, {});
|
|
95
|
+
case "roleplay-act-it-out-listening":
|
|
96
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Headphones.default, {});
|
|
97
|
+
case "roleplay-act-it-out-speaking":
|
|
98
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RecordVoiceOver.default, {});
|
|
99
|
+
case "roleplay-act-it-out-listening-speaking":
|
|
100
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ActItOutListeningSpeakingIcon, {});
|
|
101
|
+
default:
|
|
102
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Forum.default, {});
|
|
103
|
+
}
|
|
104
|
+
};
|
|
74
105
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
75
106
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Tooltip, {
|
|
76
107
|
title: !isRoleplayValid ? t("roleplay_not_valid") : "",
|
|
@@ -195,10 +226,10 @@ function Roleplay({
|
|
|
195
226
|
}
|
|
196
227
|
},
|
|
197
228
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemIcon, {
|
|
198
|
-
children:
|
|
229
|
+
children: getIconForGame(game)
|
|
199
230
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemText, {
|
|
200
|
-
primary: t(game),
|
|
201
|
-
secondary: t("
|
|
231
|
+
primary: t(game.replace(/roleplay-/, "").replace(/-/g, "_")),
|
|
232
|
+
secondary: t(game.replace(/roleplay-/, "").replace(/-/g, "_") + "_description")
|
|
202
233
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemIcon, {
|
|
203
234
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Checkbox, {
|
|
204
235
|
checked: selectedExercises?.some(e => e.roleplayId === roleplay.roleplayId && e.game === game)
|
|
@@ -218,7 +249,7 @@ function Roleplay({
|
|
|
218
249
|
}
|
|
219
250
|
},
|
|
220
251
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemIcon, {
|
|
221
|
-
children:
|
|
252
|
+
children: getIconForGame(game)
|
|
222
253
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemText, {
|
|
223
254
|
primary: t(game.replace(/roleplay-/, "").replace(/-/g, "_")),
|
|
224
255
|
secondary: t(game.replace(/roleplay-/, "").replace(/-/g, "_") + "_description")
|
|
@@ -239,7 +270,8 @@ function AssignmentRoleplaySelection({
|
|
|
239
270
|
isExerciseSelected,
|
|
240
271
|
handleSelectExercise,
|
|
241
272
|
selectedExercises,
|
|
242
|
-
useCase
|
|
273
|
+
useCase,
|
|
274
|
+
assignment
|
|
243
275
|
}) {
|
|
244
276
|
const [isRoleplaySelected, setIsRoleplaySelected] = (0, _react.useState)(false);
|
|
245
277
|
return roleplays.map((roleplay, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(Roleplay, {
|
|
@@ -251,7 +283,8 @@ function AssignmentRoleplaySelection({
|
|
|
251
283
|
isExerciseSelected: isExerciseSelected,
|
|
252
284
|
handleSelectExercise: handleSelectExercise,
|
|
253
285
|
selectedExercises: selectedExercises,
|
|
254
|
-
useCase: useCase
|
|
286
|
+
useCase: useCase,
|
|
287
|
+
assignment: assignment
|
|
255
288
|
}, index));
|
|
256
289
|
}
|
|
257
290
|
var _default = exports.default = AssignmentRoleplaySelection;
|
|
@@ -336,17 +336,17 @@ function CreateAssignmentDialog({
|
|
|
336
336
|
})
|
|
337
337
|
})]
|
|
338
338
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
339
|
-
sx: {
|
|
339
|
+
sx: theme => ({
|
|
340
340
|
position: "fixed",
|
|
341
341
|
bottom: 0,
|
|
342
342
|
width: "100%",
|
|
343
|
-
backgroundColor:
|
|
344
|
-
boxShadow:
|
|
343
|
+
backgroundColor: theme.palette.background.paper,
|
|
344
|
+
boxShadow: theme.shadows[4],
|
|
345
345
|
p: 2,
|
|
346
346
|
textAlign: "center",
|
|
347
347
|
display: "flex",
|
|
348
348
|
justifyContent: "flex-end"
|
|
349
|
-
},
|
|
349
|
+
}),
|
|
350
350
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Button, {
|
|
351
351
|
color: "primary",
|
|
352
352
|
sx: {
|
|
@@ -407,7 +407,7 @@ function CreateAssignmentDialog({
|
|
|
407
407
|
color: "primary",
|
|
408
408
|
fullWidth: true,
|
|
409
409
|
onClick: () => {
|
|
410
|
-
handleCreateAssignment;
|
|
410
|
+
handleCreateAssignment();
|
|
411
411
|
handleMenuClose();
|
|
412
412
|
},
|
|
413
413
|
children: t("schedule_assignment")
|
|
@@ -215,7 +215,8 @@ function App({
|
|
|
215
215
|
verificationStatus,
|
|
216
216
|
gameAward,
|
|
217
217
|
isCollapsed,
|
|
218
|
-
setIsCollapsed
|
|
218
|
+
setIsCollapsed,
|
|
219
|
+
isUserInternal
|
|
219
220
|
}) {
|
|
220
221
|
const theme = (0, _styles.useTheme)();
|
|
221
222
|
const isLgScreen = (0, _useMediaQuery.default)(theme.breakpoints.up("md"));
|
|
@@ -407,7 +408,7 @@ function App({
|
|
|
407
408
|
"data-cy": "appbar-create-course",
|
|
408
409
|
children: t("course")
|
|
409
410
|
})]
|
|
410
|
-
}), process.env.REACT_APP_STAGE === "dev" && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.MenuItem, {
|
|
411
|
+
}), (isUserInternal || process.env.REACT_APP_STAGE === "dev") && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.MenuItem, {
|
|
411
412
|
onClick: handleCreateAssignment,
|
|
412
413
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.ListItemIcon, {
|
|
413
414
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Assignment.default, {})
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _ExerciseMenu = _interopRequireDefault(require("../../ExerciseMenu"));
|
|
8
|
+
var _reactRouterDom = require("react-router-dom");
|
|
8
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
11
|
function CloseExerciseMenu({
|
|
@@ -15,10 +16,14 @@ function CloseExerciseMenu({
|
|
|
15
16
|
saveProgress,
|
|
16
17
|
finishExercise,
|
|
17
18
|
goBack,
|
|
19
|
+
goBackToAssignment,
|
|
18
20
|
inTopic = false,
|
|
19
21
|
saveDisabled = false,
|
|
20
22
|
isFinishExerciseDisabled
|
|
21
23
|
}) {
|
|
24
|
+
const location = (0, _reactRouterDom.useLocation)();
|
|
25
|
+
const searchParams = new URLSearchParams(location.search);
|
|
26
|
+
const assignment = JSON.parse(decodeURIComponent(searchParams.get("assignment")));
|
|
22
27
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExerciseMenu.default, {
|
|
23
28
|
open: open,
|
|
24
29
|
handleClose: close,
|
|
@@ -36,13 +41,19 @@ function CloseExerciseMenu({
|
|
|
36
41
|
color: "primary",
|
|
37
42
|
onClick: saveProgress,
|
|
38
43
|
disabled: isSpeaking
|
|
39
|
-
}, {
|
|
44
|
+
}, ...(assignment ? [{
|
|
45
|
+
dataCypress: "go_back_to_assignments",
|
|
46
|
+
text: t("go_back_to_assignments"),
|
|
47
|
+
variant: "",
|
|
48
|
+
color: "",
|
|
49
|
+
onClick: goBackToAssignment
|
|
50
|
+
}] : [{
|
|
40
51
|
dataCypress: "go_back_to_topic",
|
|
41
52
|
text: inTopic ? t("go_back_to_topic") : t("quit"),
|
|
42
53
|
variant: "",
|
|
43
54
|
color: "",
|
|
44
55
|
onClick: goBack
|
|
45
|
-
}]
|
|
56
|
+
}])]
|
|
46
57
|
});
|
|
47
58
|
}
|
|
48
59
|
var _default = exports.default = CloseExerciseMenu;
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _ExerciseMenu = _interopRequireDefault(require("../../ExerciseMenu"));
|
|
8
|
+
var _reactRouterDom = require("react-router-dom");
|
|
8
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
11
|
function CompletedExerciseMenu({
|
|
@@ -17,8 +18,12 @@ function CompletedExerciseMenu({
|
|
|
17
18
|
viewReport,
|
|
18
19
|
inTopic = false,
|
|
19
20
|
hasNextGame,
|
|
20
|
-
handleNextGame
|
|
21
|
+
handleNextGame,
|
|
22
|
+
goBackToAssignment
|
|
21
23
|
}) {
|
|
24
|
+
const location = (0, _reactRouterDom.useLocation)();
|
|
25
|
+
const searchParams = new URLSearchParams(location.search);
|
|
26
|
+
const assignment = JSON.parse(decodeURIComponent(searchParams.get("assignment")));
|
|
22
27
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExerciseMenu.default, {
|
|
23
28
|
open: open,
|
|
24
29
|
handleClose: close,
|
|
@@ -43,14 +48,20 @@ function CompletedExerciseMenu({
|
|
|
43
48
|
color: "primary",
|
|
44
49
|
onClick: viewReport,
|
|
45
50
|
disabled: disableViewReport
|
|
46
|
-
}, {
|
|
51
|
+
}, ...(assignment ? [{
|
|
52
|
+
dataCypress: "go_back_to_assignments",
|
|
53
|
+
text: t("go_back_to_assignments"),
|
|
54
|
+
variant: "",
|
|
55
|
+
color: "",
|
|
56
|
+
onClick: goBackToAssignment
|
|
57
|
+
}] : [{
|
|
47
58
|
dataCypress: "go_back_to_topic",
|
|
48
59
|
text: inTopic ? t("go_back_to_topic") : t("quit"),
|
|
49
60
|
variant: "",
|
|
50
61
|
color: "",
|
|
51
62
|
onClick: goBack,
|
|
52
63
|
disabled: false
|
|
53
|
-
}]
|
|
64
|
+
}])]
|
|
54
65
|
});
|
|
55
66
|
}
|
|
56
67
|
var _default = exports.default = CompletedExerciseMenu;
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _ExerciseMenu = _interopRequireDefault(require("../../ExerciseMenu"));
|
|
8
|
+
var _reactRouterDom = require("react-router-dom");
|
|
8
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
11
|
function InProgressExercise({
|
|
@@ -14,8 +15,12 @@ function InProgressExercise({
|
|
|
14
15
|
continueExercise,
|
|
15
16
|
restartExercise,
|
|
16
17
|
goBack,
|
|
17
|
-
inTopic = false
|
|
18
|
+
inTopic = false,
|
|
19
|
+
goBackToAssignment
|
|
18
20
|
}) {
|
|
21
|
+
const location = (0, _reactRouterDom.useLocation)();
|
|
22
|
+
const searchParams = new URLSearchParams(location.search);
|
|
23
|
+
const assignment = JSON.parse(decodeURIComponent(searchParams.get("assignment")));
|
|
19
24
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExerciseMenu.default, {
|
|
20
25
|
open: open,
|
|
21
26
|
handleClose: close,
|
|
@@ -29,12 +34,17 @@ function InProgressExercise({
|
|
|
29
34
|
variant: "outlined",
|
|
30
35
|
color: "primary",
|
|
31
36
|
onClick: restartExercise
|
|
32
|
-
}, {
|
|
37
|
+
}, ...(assignment ? [{
|
|
38
|
+
text: t("go_back_to_assignments"),
|
|
39
|
+
variant: "",
|
|
40
|
+
color: "",
|
|
41
|
+
onClick: goBackToAssignment
|
|
42
|
+
}] : [{
|
|
33
43
|
text: inTopic ? t("go_back_to_topic") : t("quit"),
|
|
34
44
|
variant: "",
|
|
35
45
|
color: "",
|
|
36
46
|
onClick: goBack
|
|
37
|
-
}]
|
|
47
|
+
}])]
|
|
38
48
|
});
|
|
39
49
|
}
|
|
40
50
|
var _default = exports.default = InProgressExercise;
|
|
@@ -37,7 +37,7 @@ function TranscriptViewer({
|
|
|
37
37
|
const attendee = attendeesData.find(item => item.username === identifier);
|
|
38
38
|
const userImage = attendee ? attendee.userImage : null;
|
|
39
39
|
// console.log({ sentence, attendee, userImage, conversation })
|
|
40
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
41
41
|
"aria-label": "go to time in recording",
|
|
42
42
|
display: "flex",
|
|
43
43
|
alignItems: "center",
|
|
@@ -49,27 +49,49 @@ function TranscriptViewer({
|
|
|
49
49
|
backgroundColor: "#f2f2f2"
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
|
-
children:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Grid.default, {
|
|
53
|
+
container: true,
|
|
54
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
55
|
+
item: true,
|
|
56
|
+
xs: 4,
|
|
57
|
+
md: 3,
|
|
58
58
|
sx: {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
marginRight: "8px"
|
|
62
|
-
}
|
|
63
|
-
}), sentence?.user && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
64
|
-
style: {
|
|
65
|
-
fontWeight: "bold",
|
|
66
|
-
marginRight: "8px"
|
|
59
|
+
display: "flex",
|
|
60
|
+
flexDirection: "column"
|
|
67
61
|
},
|
|
68
|
-
children:
|
|
62
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
63
|
+
display: "flex",
|
|
64
|
+
alignItems: "center",
|
|
65
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Avatar, {
|
|
66
|
+
alt: sentence?.username,
|
|
67
|
+
src: userImage,
|
|
68
|
+
sx: {
|
|
69
|
+
width: 24,
|
|
70
|
+
height: 24,
|
|
71
|
+
marginRight: "8px"
|
|
72
|
+
}
|
|
73
|
+
}), sentence?.user && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
74
|
+
style: {
|
|
75
|
+
fontWeight: "bold",
|
|
76
|
+
marginRight: "8px"
|
|
77
|
+
},
|
|
78
|
+
children: `${sentence.user}:`
|
|
79
|
+
})]
|
|
80
|
+
})
|
|
81
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Grid.default, {
|
|
82
|
+
item: true,
|
|
83
|
+
xs: 8,
|
|
84
|
+
md: 9,
|
|
85
|
+
sx: {
|
|
86
|
+
display: "flex",
|
|
87
|
+
flexDirection: "column",
|
|
88
|
+
alignItems: "left"
|
|
89
|
+
},
|
|
90
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
91
|
+
children: sentence.text
|
|
92
|
+
})
|
|
69
93
|
})]
|
|
70
|
-
})
|
|
71
|
-
children: sentence.text
|
|
72
|
-
})]
|
|
94
|
+
})
|
|
73
95
|
}, `conversation-${i}`);
|
|
74
96
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Typography, {
|
|
75
97
|
variant: "body2",
|
|
@@ -19,44 +19,16 @@ function SelectExercise({
|
|
|
19
19
|
getCourseSections,
|
|
20
20
|
getRoleplays,
|
|
21
21
|
handleCreateGame,
|
|
22
|
-
username
|
|
23
|
-
useCase = "live",
|
|
24
|
-
selectedExercises = [],
|
|
25
|
-
setSelectedExercises,
|
|
26
|
-
isAssignment
|
|
22
|
+
username
|
|
27
23
|
}) {
|
|
28
24
|
const [isExerciseSelected, setIsExerciseSelected] = (0, _react.useState)(false);
|
|
29
|
-
const handleSelectExercise = (exercises = []) => {
|
|
30
|
-
setSelectedExercises(prevSelectedExercises => {
|
|
31
|
-
let updatedExercises = [...prevSelectedExercises];
|
|
32
|
-
exercises.forEach(exercise => {
|
|
33
|
-
if (exercise.courseSectionTopicId && updatedExercises.some(e => e.courseSectionTopicId === exercise.courseSectionTopicId && e.name === exercise.name)) {
|
|
34
|
-
updatedExercises = updatedExercises.filter(e => e.courseSectionTopicId !== exercise.courseSectionTopicId || e.name !== exercise.name);
|
|
35
|
-
} else if (exercise.roleplayId && updatedExercises.some(e => e.roleplayId === exercise.roleplayId && e.game === exercise.game)) {
|
|
36
|
-
updatedExercises = updatedExercises.filter(e => e.courseSectionTopicId || e.roleplayId !== exercise.roleplayId || e.game !== exercise.game);
|
|
37
|
-
} else {
|
|
38
|
-
updatedExercises.push(exercise);
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
return updatedExercises;
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
const handleSubmitExercises = () => {
|
|
45
|
-
setSelectedExercises(selectedExercises);
|
|
46
|
-
handleClose();
|
|
47
|
-
};
|
|
48
25
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ResponsiveDialog.default, {
|
|
49
26
|
open: open,
|
|
50
27
|
handleClose: handleClose,
|
|
51
|
-
dialogTitle:
|
|
28
|
+
dialogTitle: t("play_live"),
|
|
52
29
|
maxWidth: "md",
|
|
53
|
-
handleSubmit: useCase === "live" ? null : () => {
|
|
54
|
-
handleSubmitExercises();
|
|
55
|
-
},
|
|
56
|
-
submitText: useCase === "live" ? null : t("add_exercises"),
|
|
57
|
-
isSubmitDisabled: selectedExercises.length === 0,
|
|
58
30
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.DialogContentText, {
|
|
59
|
-
children:
|
|
31
|
+
children: t("live_dialog_description")
|
|
60
32
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_system.Box, {
|
|
61
33
|
mt: 1,
|
|
62
34
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CourseSelection.default, {
|
|
@@ -68,11 +40,7 @@ function SelectExercise({
|
|
|
68
40
|
t: t,
|
|
69
41
|
isExerciseSelected: isExerciseSelected,
|
|
70
42
|
setIsExerciseSelected: setIsExerciseSelected,
|
|
71
|
-
isDialogOpen: open
|
|
72
|
-
useCase: useCase,
|
|
73
|
-
selectedExercises: selectedExercises,
|
|
74
|
-
handleSelectExercise: useCase === "assignment" ? handleSelectExercise : null,
|
|
75
|
-
isAssignment: isAssignment
|
|
43
|
+
isDialogOpen: open
|
|
76
44
|
})
|
|
77
45
|
})]
|
|
78
46
|
});
|