@nualang/nualang-ui-components 0.1.1228 → 0.1.1230
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 +6 -5
- package/dist/Assignments/AssignmentCardsList/AssignmentCardsList.js +21 -3
- package/dist/Assignments/AssignmentCourseSelection/AssignmentCourseSelection.js +1 -1
- package/dist/Assignments/AssignmentExerciseSelection/AssignmentExerciseSelection.js +6 -4
- package/dist/Assignments/AssignmentRoleplaySelection/AssignmentRoleplaySelection.js +41 -8
- package/dist/Assignments/AssignmentSelectExercise/AssignmentSelectExercise.js +1 -1
- package/dist/Chat/BottomBar/BottomBar.js +8 -0
- package/dist/Dialogs/CreatePhrase/CreatePhrase.js +4 -4
- 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/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/Forms/CreateMeetingMultiStepForm/MeetingForm.js +2 -7
- 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/Tables/MeetingPrompstList/MeetingPromptsList.js +1 -1
- 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
|
@@ -27,9 +27,10 @@ function AssignmentCard({
|
|
|
27
27
|
isCreator,
|
|
28
28
|
getCourses,
|
|
29
29
|
deleteAssignment,
|
|
30
|
-
handleEditAssignment
|
|
30
|
+
handleEditAssignment,
|
|
31
|
+
isExpanded,
|
|
32
|
+
setExpandedAssignmentId
|
|
31
33
|
}) {
|
|
32
|
-
const [expanded, setExpanded] = (0, _react.useState)(false);
|
|
33
34
|
const [confirm] = (0, _useConfirm.default)(t);
|
|
34
35
|
const handleDeleteAssignment = async (classroomId, assignmentId) => {
|
|
35
36
|
const confirmed = await confirm(t('delete_assignment'), t('delete_assignment_confirmation'));
|
|
@@ -54,7 +55,7 @@ function AssignmentCard({
|
|
|
54
55
|
};
|
|
55
56
|
const handleIconClick = event => {
|
|
56
57
|
event.stopPropagation();
|
|
57
|
-
|
|
58
|
+
setExpandedAssignmentId(prevId => prevId === assignment.assignmentId ? null : assignment.assignmentId);
|
|
58
59
|
};
|
|
59
60
|
const {
|
|
60
61
|
uniqueCourses
|
|
@@ -159,10 +160,10 @@ function AssignmentCard({
|
|
|
159
160
|
item: true,
|
|
160
161
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.IconButton, {
|
|
161
162
|
onClick: handleIconClick,
|
|
162
|
-
children:
|
|
163
|
+
children: isExpanded ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandLess.default, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandMore.default, {})
|
|
163
164
|
})
|
|
164
165
|
})]
|
|
165
|
-
}),
|
|
166
|
+
}), isExpanded && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Box, {
|
|
166
167
|
mt: 2,
|
|
167
168
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Divider, {
|
|
168
169
|
sx: {
|
|
@@ -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 [expandedAssignmentId, setExpandedAssignmentId] = (0, _react.useState)(null);
|
|
31
|
+
(0, _react.useEffect)(() => {
|
|
32
|
+
const storedId = localStorage.getItem("expandedAssignmentId");
|
|
33
|
+
if (storedId) {
|
|
34
|
+
setExpandedAssignmentId(JSON.parse(storedId));
|
|
35
|
+
}
|
|
36
|
+
}, []);
|
|
37
|
+
(0, _react.useEffect)(() => {
|
|
38
|
+
if (expandedAssignmentId) {
|
|
39
|
+
localStorage.setItem("expandedAssignmentId", JSON.stringify(expandedAssignmentId));
|
|
40
|
+
} else {
|
|
41
|
+
localStorage.removeItem("expandedAssignmentId");
|
|
42
|
+
}
|
|
43
|
+
}, [expandedAssignmentId]);
|
|
28
44
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.Box, {
|
|
29
45
|
mt: 3,
|
|
30
46
|
mb: 1,
|
|
@@ -114,8 +130,10 @@ const AssignmentCardsList = ({
|
|
|
114
130
|
getCourseSections: getCourseSections,
|
|
115
131
|
getRoleplays: getRoleplays,
|
|
116
132
|
deleteAssignment: deleteAssignment,
|
|
117
|
-
handleEditAssignment: handleEditAssignment
|
|
118
|
-
|
|
133
|
+
handleEditAssignment: handleEditAssignment,
|
|
134
|
+
isExpanded: expandedAssignmentId === assignment.assignmentId,
|
|
135
|
+
setExpandedAssignmentId: setExpandedAssignmentId
|
|
136
|
+
}, assignment.assignmentId))]
|
|
119
137
|
})
|
|
120
138
|
});
|
|
121
139
|
};
|
|
@@ -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;
|
|
@@ -182,6 +182,13 @@ function BottomBar({
|
|
|
182
182
|
activeRef.current.focus();
|
|
183
183
|
}
|
|
184
184
|
}, [isListening, activeRef, disableInput]);
|
|
185
|
+
(0, _react.useEffect)(() => {
|
|
186
|
+
if (activeRef.current) {
|
|
187
|
+
activeRef.current.focus();
|
|
188
|
+
const length = inputValue.length;
|
|
189
|
+
activeRef.current.setSelectionRange(length, length);
|
|
190
|
+
}
|
|
191
|
+
}, [inputValue]);
|
|
185
192
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Paper.default, {
|
|
186
193
|
square: true,
|
|
187
194
|
className: classes.paper,
|
|
@@ -207,6 +214,7 @@ function BottomBar({
|
|
|
207
214
|
id: "voiceInput",
|
|
208
215
|
disabled: disableInput,
|
|
209
216
|
size: "large",
|
|
217
|
+
ref: buttonRef,
|
|
210
218
|
children: isListening ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_MicOff.default, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Mic.default, {})
|
|
211
219
|
})
|
|
212
220
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
@@ -208,7 +208,7 @@ function CreatePhrase({
|
|
|
208
208
|
};
|
|
209
209
|
|
|
210
210
|
// // translation
|
|
211
|
-
// const
|
|
211
|
+
// const generateTranslation = async () => {
|
|
212
212
|
// const translatedText = await handleTranslate(phrase, learnLang, forLang);
|
|
213
213
|
// if (translatedText && translatedText !== "") {
|
|
214
214
|
// setAutoTranslatedText(translatedText);
|
|
@@ -221,11 +221,11 @@ function CreatePhrase({
|
|
|
221
221
|
// }
|
|
222
222
|
// };
|
|
223
223
|
|
|
224
|
-
const
|
|
224
|
+
const generateTranslation = async () => {
|
|
225
225
|
try {
|
|
226
226
|
let chatGptResponse = await makeChatGptApiRequest({
|
|
227
227
|
model: "gpt-4o-mini",
|
|
228
|
-
promptKey: "
|
|
228
|
+
promptKey: "generateTranslation",
|
|
229
229
|
promptVariables: {
|
|
230
230
|
learnLang,
|
|
231
231
|
forLang,
|
|
@@ -409,7 +409,7 @@ function CreatePhrase({
|
|
|
409
409
|
children: t("add_alternative_version")
|
|
410
410
|
})
|
|
411
411
|
}), learnLang !== forLang && /*#__PURE__*/(0, _jsxRuntime.jsx)(_DefaultColourButton.default, {
|
|
412
|
-
onClick:
|
|
412
|
+
onClick: generateTranslation,
|
|
413
413
|
disabled: !phrase || Array.isArray(translationList) && translationList.includes(autoTranslatedText),
|
|
414
414
|
size: "sm",
|
|
415
415
|
className: classes.alternativeVersionButton,
|
|
@@ -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;
|
|
@@ -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
|
});
|
|
@@ -30,6 +30,7 @@ var _DefaultColourButton = _interopRequireDefault(require("../../Misc/DefaultCol
|
|
|
30
30
|
var _WaveFormLite = _interopRequireDefault(require("../../Misc/WaveFormLite"));
|
|
31
31
|
var _styles = require("@mui/material/styles");
|
|
32
32
|
var _reactBeautifulDnd = require("react-beautiful-dnd");
|
|
33
|
+
var _reactRouterDom = require("react-router-dom");
|
|
33
34
|
var _index = require("../../utils/index");
|
|
34
35
|
var _useWordBankFocus = _interopRequireDefault(require("../../hooks/useWordBankFocus"));
|
|
35
36
|
var _voiceImages = _interopRequireDefault(require("../../utils/voiceImages"));
|
|
@@ -235,7 +236,8 @@ function Listener({
|
|
|
235
236
|
siteLanguage,
|
|
236
237
|
courseSettings,
|
|
237
238
|
parentClassroom,
|
|
238
|
-
isHeritageSpeaker = false
|
|
239
|
+
isHeritageSpeaker = false,
|
|
240
|
+
classroomId
|
|
239
241
|
}) {
|
|
240
242
|
(0, _useExerciseDocumentTitle.default)({
|
|
241
243
|
exerciseTitle: "Listening",
|
|
@@ -527,6 +529,10 @@ function Listener({
|
|
|
527
529
|
return;
|
|
528
530
|
}
|
|
529
531
|
};
|
|
532
|
+
const navigate = (0, _reactRouterDom.useNavigate)();
|
|
533
|
+
const goBackToAssignment = () => {
|
|
534
|
+
navigate(`/classrooms/${classroomId}#Assignments`);
|
|
535
|
+
};
|
|
530
536
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBeautifulDnd.DragDropContext, {
|
|
531
537
|
onDragEnd: handleOnDragEnd,
|
|
532
538
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Dialog, {
|
|
@@ -955,7 +961,8 @@ function Listener({
|
|
|
955
961
|
viewReport: viewReport,
|
|
956
962
|
fullScreen: true,
|
|
957
963
|
t: t,
|
|
958
|
-
inTopic: courseId && sectionId && topicId
|
|
964
|
+
inTopic: courseId && sectionId && topicId,
|
|
965
|
+
goBackToAssignment: goBackToAssignment
|
|
959
966
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CloseExercise.default, {
|
|
960
967
|
t: t,
|
|
961
968
|
open: isCloseModalOpen,
|
|
@@ -964,7 +971,8 @@ function Listener({
|
|
|
964
971
|
finishExercise: handleCompleteExercise,
|
|
965
972
|
goBack: handleCloseExercise,
|
|
966
973
|
inTopic: courseId && sectionId && topicId,
|
|
967
|
-
isFinishExerciseDisabled: unattemptedQuestionTotal > 0
|
|
974
|
+
isFinishExerciseDisabled: unattemptedQuestionTotal > 0,
|
|
975
|
+
goBackToAssignment: goBackToAssignment
|
|
968
976
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_InProgressExercise.default, {
|
|
969
977
|
t: t,
|
|
970
978
|
open: isInProgressModalOpen,
|
|
@@ -973,7 +981,8 @@ function Listener({
|
|
|
973
981
|
continueExercise: closeInProgressModal,
|
|
974
982
|
restartExercise: handleRestartExercise,
|
|
975
983
|
goBack: handleCloseExercise,
|
|
976
|
-
inTopic: courseId && sectionId && topicId
|
|
984
|
+
inTopic: courseId && sectionId && topicId,
|
|
985
|
+
goBackToAssignment: goBackToAssignment
|
|
977
986
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactJoyride.default, {
|
|
978
987
|
callback: handleJoyrideCallback,
|
|
979
988
|
continuous: true,
|
|
@@ -34,6 +34,7 @@ var _ChatBubble = _interopRequireDefault(require("../../Misc/ChatBubble/ChatBubb
|
|
|
34
34
|
var _WaveFormLite = _interopRequireDefault(require("../../Misc/WaveFormLite"));
|
|
35
35
|
var _utils = require("../../utils");
|
|
36
36
|
var _voiceImages = _interopRequireDefault(require("../../utils/voiceImages"));
|
|
37
|
+
var _reactRouterDom = require("react-router-dom");
|
|
37
38
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
38
39
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
39
40
|
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); }
|
|
@@ -163,7 +164,8 @@ function Pronouncer({
|
|
|
163
164
|
uploadAudioAttempt,
|
|
164
165
|
languageTag,
|
|
165
166
|
trackRecommendedEvent,
|
|
166
|
-
parentClassroom
|
|
167
|
+
parentClassroom,
|
|
168
|
+
classroomId
|
|
167
169
|
}) {
|
|
168
170
|
(0, _useExerciseDocumentTitle.default)({
|
|
169
171
|
exerciseTitle: "Pronunciation",
|
|
@@ -462,6 +464,10 @@ function Pronouncer({
|
|
|
462
464
|
}
|
|
463
465
|
};
|
|
464
466
|
const isListeningIndicatorTextVisible = recognizing && interimTranscript === "" && finalTranscript === "" ? true : false;
|
|
467
|
+
const navigate = (0, _reactRouterDom.useNavigate)();
|
|
468
|
+
const goBackToAssignment = () => {
|
|
469
|
+
navigate(`/classrooms/${classroomId}#Assignments`);
|
|
470
|
+
};
|
|
465
471
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_material.Dialog, {
|
|
466
472
|
fullScreen: true,
|
|
467
473
|
open: open,
|
|
@@ -896,7 +902,8 @@ function Pronouncer({
|
|
|
896
902
|
viewReport: viewReport,
|
|
897
903
|
fullScreen: true,
|
|
898
904
|
t: t,
|
|
899
|
-
inTopic: courseId && sectionId && topicId
|
|
905
|
+
inTopic: courseId && sectionId && topicId,
|
|
906
|
+
goBackToAssignment: goBackToAssignment
|
|
900
907
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CloseExercise.default, {
|
|
901
908
|
t: t,
|
|
902
909
|
open: isCloseModalOpen,
|
|
@@ -905,7 +912,8 @@ function Pronouncer({
|
|
|
905
912
|
finishExercise: handleCompleteExercise,
|
|
906
913
|
goBack: handleCloseExercise,
|
|
907
914
|
inTopic: courseId && sectionId && topicId,
|
|
908
|
-
isFinishExerciseDisabled: unattemptedQuestionTotal > 0
|
|
915
|
+
isFinishExerciseDisabled: unattemptedQuestionTotal > 0,
|
|
916
|
+
goBackToAssignment: goBackToAssignment
|
|
909
917
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_InProgressExercise.default, {
|
|
910
918
|
t: t,
|
|
911
919
|
open: isInProgressModalOpen,
|
|
@@ -914,7 +922,8 @@ function Pronouncer({
|
|
|
914
922
|
continueExercise: closeInProgressModal,
|
|
915
923
|
restartExercise: handleRestartExercise,
|
|
916
924
|
goBack: handleCloseExercise,
|
|
917
|
-
inTopic: courseId && sectionId && topicId
|
|
925
|
+
inTopic: courseId && sectionId && topicId,
|
|
926
|
+
goBackToAssignment: goBackToAssignment
|
|
918
927
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactJoyride.default, {
|
|
919
928
|
callback: handleJoyrideCallback,
|
|
920
929
|
continuous: true,
|
|
@@ -194,7 +194,8 @@ function RoleplayGame({
|
|
|
194
194
|
languageInformation,
|
|
195
195
|
translationEnabled,
|
|
196
196
|
parentClassroom,
|
|
197
|
-
isHeritageSpeaker = false
|
|
197
|
+
isHeritageSpeaker = false,
|
|
198
|
+
goBackToAssignment
|
|
198
199
|
}) {
|
|
199
200
|
(0, _useExerciseDocumentTitle.default)({
|
|
200
201
|
exerciseTitle: "Act it out",
|
|
@@ -457,7 +458,8 @@ function RoleplayGame({
|
|
|
457
458
|
t: t,
|
|
458
459
|
inTopic: courseId && sectionId && topicId,
|
|
459
460
|
handleNextGame: handleNextGame,
|
|
460
|
-
hasNextGame: hasNextGame
|
|
461
|
+
hasNextGame: hasNextGame,
|
|
462
|
+
goBackToAssignment: goBackToAssignment
|
|
461
463
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CloseExercise.default, {
|
|
462
464
|
t: t,
|
|
463
465
|
open: isCloseModalOpen,
|
|
@@ -467,7 +469,8 @@ function RoleplayGame({
|
|
|
467
469
|
goBack: handleCloseExercise,
|
|
468
470
|
inTopic: courseId && sectionId && topicId,
|
|
469
471
|
isSpeaking: isSpeaking,
|
|
470
|
-
isFinishExerciseDisabled: true
|
|
472
|
+
isFinishExerciseDisabled: true,
|
|
473
|
+
goBackToAssignment: goBackToAssignment
|
|
471
474
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_InProgressExercise.default, {
|
|
472
475
|
t: t,
|
|
473
476
|
open: isInProgressModalOpen,
|
|
@@ -476,7 +479,8 @@ function RoleplayGame({
|
|
|
476
479
|
continueExercise: closeInProgressModal,
|
|
477
480
|
restartExercise: handleRestartExercise,
|
|
478
481
|
goBack: handleCloseExercise,
|
|
479
|
-
inTopic: courseId && sectionId && topicId
|
|
482
|
+
inTopic: courseId && sectionId && topicId,
|
|
483
|
+
goBackToAssignment: goBackToAssignment
|
|
480
484
|
})]
|
|
481
485
|
});
|
|
482
486
|
}
|