@nualang/nualang-ui-components 0.1.1180 → 0.1.1181
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/Dialogs/GeneratePhrases/GeneratePhrases.js +1 -1
- package/dist/Dialogs/GenerateRoleplay/GenerateRoleplay.js +6 -3
- package/dist/Dialogs/RoleplayPreview/RoleplayPreview.js +2 -1
- package/dist/Editors/Roleplay/Roleplay.js +1 -1
- package/dist/Exercises/Roleplay/Games/ActItOutGame/ActItOutGame.js +2 -1
- package/dist/Exercises/Roleplay/Games/ActItOutGameListening/ActItOutGameListening.js +2 -1
- package/dist/Exercises/Roleplay/Games/FillInTheBlanksGame/FillInTheBlanksGame.js +2 -1
- package/dist/Exercises/Roleplay/Games/StoryGame/StoryGame.js +2 -1
- package/dist/Exercises/Roleplay/OriginalRoleplay.js +4 -2
- package/dist/Forms/ChipInput/ChipInput.js +3 -2
- package/dist/Forms/CreateBot/Steps/BotInformation/BotInformation.js +4 -3
- package/dist/Forms/CreateClassroom/Steps/ClassroomInformation/ClassroomInformation.js +4 -3
- package/dist/Forms/CreateClassroom/Steps/ClassroomSettings/ClassroomSettings.js +12 -8
- package/dist/Forms/CreateCourse/Steps/CourseInformation/CourseInformation.js +4 -3
- package/dist/Forms/CreateCourse/Steps/CourseSettings/CourseSettings.js +8 -5
- package/dist/Forms/CreateRoleplay/Steps/RoleplayInformation/RoleplayInformation.js +4 -3
- package/dist/Forms/CreateRoleplayHook/Steps/RoleplayInformation/RoleplayInformation.js +4 -3
- package/dist/Forms/CreateTopic/Steps/TopicInformation/TopicInformation.js +4 -3
- package/dist/Screens/Classrooms/ViewClassroom/ViewClassroom.js +5 -0
- package/package.json +1 -1
|
@@ -114,7 +114,7 @@ function GeneratePhrases({
|
|
|
114
114
|
setErrorMessage(null);
|
|
115
115
|
const goalPrompt = `The generated phrases must specifically target the following linguistic goal: '${values.topicGoal}'. Avoid generating phrases that do not align with this goal. `;
|
|
116
116
|
const prompt = phraseType === "sentences" ? isPhrases ? `The context is a language learning application. Here is a list of phrases or sentences in ${learnLang} and their translations in ${forLang}:\n\n${JSON.stringify(phrases)}\n\nNow, generate ${values.phraseAmount} more uniques sentences in ${learnLang} and their translations in ${forLang} on the topic of '${values.phrasesTopic}' in the same JSON format as the ones that I have passed to you. The 'idx' field should contain an index integer which follows on incrementally from the existing phrases. The 'image' field should contain an empty string. Do not include a 'voices' field. ${values.topicGoal.trim() ? goalPrompt : ""}The sentences should be unique and not already in the list. The sentences should be appropriate for ${["en-US"].includes(siteLanguage) ? "ACTFL" : "CEFR"} ${difficulty} level. Ensure the formatting of the JSON response is correct and follows this structure.` : `The context is a language learning application. Generate ${values.phraseAmount} unique phrases or sentences in ${learnLang} and their translations in ${forLang} on the topic of '${values.phrasesTopic}'. Return the sentences inside a JSON array of ${values.phraseAmount} objects, each with the following fields: 'phrase', 'translations', 'idx', and 'image'. Each field is required and cannot be omitted. The 'idx' field represents the index of the phrases, starting from 0 and going up by 1 up until the last phrase. The 'image' field should contain an empty string. The 'translations' field should be an array of at least one translation of the sentence in ${forLang}, but it can contain more translations as long as they are grammatically correct. ${values.topicGoal.trim() ? goalPrompt : ""}The sentences should be appropriate for the ${["en-US"].includes(siteLanguage) ? "ACTFL" : "CEFR"} ${difficulty} level. The sentences should be unique. Ensure the formatting of the JSON response is correct and follows this structure.` : isPhrases ? `The context is a language learning application. Here is a list of words or short lexical phrases in ${learnLang} and their translations in ${forLang}:\n\n${JSON.stringify(phrases)}\n\nNow, generate ${values.phraseAmount} more words or lexical phrases and their translations in ${learnLang} on the topic of '${values.phrasesTopic}' in the same JSON format as the ones that I have passed to you. The 'idx' field should contain an index integer which follows on incrementally from the existing phrases. The 'image' field should contain an empty string. Do not include a 'voices' field. ${values.topicGoal.trim() ? goalPrompt : ""}The words or lexical phrases should be unique and not already in the list. The words or lexical phrases should be ${["en-US"].includes(siteLanguage) ? "ACTFL" : "CEFR"} ${difficulty}. Ensure the formatting of the JSON response is correct and follows this structure.` : `The context is a language learning application. Generate ${values.phraseAmount} unique words or short lexical phrases in ${learnLang} and their translations in ${forLang} on the topic of '${values.phrasesTopic}'. Return the words or short lexical phrases inside a JSON array of ${values.phraseAmount} objects, each with the following fields: 'phrase', 'translations', 'idx', and 'image'. Each field is required and cannot be omitted. The 'idx' field represents the index of the phrases, starting from 0 and going up by 1 up until the last phrase. The 'image' field should contain an empty string. The 'translations' field should be an array of at least one translation of the phrase in ${forLang}, but it can contain more translations as long as they are grammatically correct. ${values.topicGoal.trim() ? goalPrompt : ""}The words or short lexical phrases should be appropriate for the ${["en-US"].includes(siteLanguage) ? "ACTFL" : "CEFR"} ${difficulty} level. The words or short lexical phrases should be unique. Ensure the formatting of the JSON response is correct and follows this structure.`;
|
|
117
|
-
console.log("prompt: ", prompt);
|
|
117
|
+
// console.log("prompt: ", prompt);
|
|
118
118
|
const chatGptResponse = await makeChatGptApiRequest({
|
|
119
119
|
model: "gpt-3.5-turbo",
|
|
120
120
|
prompt
|
|
@@ -182,7 +182,8 @@ function GenerateRoleplayDialog({
|
|
|
182
182
|
setErrorMessage("");
|
|
183
183
|
let response;
|
|
184
184
|
const roleplayDifficulty = values.roleplayDifficulty;
|
|
185
|
-
console.log("Roleplay Difficulty:", roleplayDifficulty);
|
|
185
|
+
// console.log("Roleplay Difficulty:", roleplayDifficulty);
|
|
186
|
+
|
|
186
187
|
const basePrompt = usePdfContext ? `Create an informative conversation between 2 people ${values?.actor1?.name && values?.actor2?.name ? `'${values.actor1.name}' and '${values.actor2.name}' ` : ""} about the topic '${values.roleplayTopic}' in the language ${learnLang}. The conversation should be ${i18nLanguage === "en-US" ? "ACTFL" : "CEFR"} level '${t(roleplayDifficulty)}.'` : `Create a conversation between 2 people ${values?.actor1?.name && values?.actor2?.name ? `'${values.actor1.name}' and '${values.actor2?.name}' ` : ""} about the topic '${values.roleplayTopic}' in the language ${learnLang}. The conversation should be ${i18nLanguage === "en-US" ? "ACTFL" : "CEFR"} level '${t(roleplayDifficulty)}.'`;
|
|
187
188
|
const topicGoalPrompt = topicGoal ? ` The conversation should be guided by the following goal: '${topicGoal}'.` : "";
|
|
188
189
|
const promptWithPhrases = usePhrasesContext ? ` Additionally, use the following phrases as part of the conversation, where appropriate to the topic '${values.roleplayTopic}': ${phrases.map(phrase => phrase.phrase).join(", ")}. Only use these phrases if they fit naturally into the conversation.` : "";
|
|
@@ -192,7 +193,8 @@ function GenerateRoleplayDialog({
|
|
|
192
193
|
const promptWithoutQuestions = usePdfContext ? `${finalPrompt} The conversation should be returned as a single JSON array. The array must contain exactly ${values.roleplayLengthNumber} exchanges (lines). Each piece of dialogue should be represented as an object with the keys 'actor' and 'text'. The 'actor' key should be set to 1 if the dialogue is spoken by the first actor, and 2 if it is spoken by the second actor. The 'text' key should be set to the dialogue text spoken by that actor. Please ensure the entire output is formatted as a single, well-formed JSON array.` : `${finalPrompt} The conversation should be returned as a single JSON array. The array must contain exactly ${values.roleplayLengthNumber} exchanges (lines). Each piece of dialogue should be represented as an object with the keys 'actor' and 'text'. The 'actor' key should be set to 1 if the dialogue is spoken by the first actor, and 2 if it is spoken by the second actor. The 'text' key should be set to the dialogue text spoken by that actor. Please ensure the entire output is formatted as a single, well-formed JSON array.`;
|
|
193
194
|
const promptWithQuestions = usePdfContext ? `${finalPrompt} The conversation should be returned as a single JSON array. The array must contain exactly ${values.roleplayLengthNumber} exchanges (lines), followed by ${values?.questionsAmount} comprehension questions related to the conversation, the question should be generated in ${questionLang}. Each piece of dialogue should be represented as an object with the keys 'actor' and 'text'. The 'actor' key should be set to 1 if the dialogue is spoken by the first actor, and 2 if it is spoken by the second actor. The 'text' key should be set to the dialogue text spoken by that actor. Each comprehension question should also be represented as an object within the same array, with the keys 'question' and 'answers'. The 'answers' key should be an array of 3 objects, each containing 'text', 'correct' (true or false), and 'type' ('correct' or 'incorrect'), the answers should be generated in ${questionLang}. Please ensure the entire output is formatted as a single, well-formed JSON array.` : `${finalPrompt} The conversation should be returned as a single JSON array. The array must contain exactly ${values.roleplayLengthNumber} exchanges (lines), followed by ${values?.questionsAmount} comprehension questions related to the conversation, the question should be generated in ${questionLang}. Each piece of dialogue should be represented as an object with the keys 'actor' and 'text'. The 'actor' key should be set to 1 if the dialogue is spoken by the first actor, and 2 if it is spoken by the second actor. The 'text' key should be set to the dialogue text spoken by that actor. Each comprehension question should also be represented as an object within the same array, with the keys 'question' and 'answers'. The 'answers' key should be an array of 3 objects, each containing 'text', 'correct' (true or false), and 'type' ('correct' or 'incorrect'), the answers should be generated in ${questionLang}. Please ensure the entire output is formatted as a single, well-formed JSON array.`;
|
|
194
195
|
const activePrompt = generateQuestions ? promptWithQuestions : promptWithoutQuestions;
|
|
195
|
-
|
|
196
|
+
|
|
197
|
+
// console.log("Final Prompt Sent to API:", activePrompt);
|
|
196
198
|
|
|
197
199
|
// Call the API and handle the response as before
|
|
198
200
|
if (usePdfContext) {
|
|
@@ -235,7 +237,8 @@ function GenerateRoleplayDialog({
|
|
|
235
237
|
}
|
|
236
238
|
|
|
237
239
|
// Log the full response for debugging
|
|
238
|
-
console.log("Full API Response:", response);
|
|
240
|
+
// console.log("Full API Response:", response);
|
|
241
|
+
|
|
239
242
|
const jsonResponse = removeExtraTextFromChatGptResponse(response);
|
|
240
243
|
const roleplayScript = fixMissingComma(jsonResponse);
|
|
241
244
|
if (validateScript(roleplayScript)) {
|
|
@@ -274,7 +274,7 @@ function Roleplay({
|
|
|
274
274
|
initialTopicGoal,
|
|
275
275
|
isUserInternal
|
|
276
276
|
}) {
|
|
277
|
-
console.log("Edit Roleplay -> phrases", phrases);
|
|
277
|
+
// console.log("Edit Roleplay -> phrases", phrases);
|
|
278
278
|
const [isGenerateRoleplayDialogOpen, setIsGenerateRoleplayDialogOpen] = (0, _react.useState)(false);
|
|
279
279
|
const [isGenerateQuestionDialogOpen, setIsGenerateQuestionDialogOpen] = (0, _react.useState)(false);
|
|
280
280
|
const {
|
|
@@ -394,7 +394,8 @@ function RoleplayGame({
|
|
|
394
394
|
handleEditRoleplay: handleEditRoleplay,
|
|
395
395
|
handleRestart: handleRestart,
|
|
396
396
|
handleShareRoleplay: handleShareRoleplay,
|
|
397
|
-
parentClassroom: parentClassroom
|
|
397
|
+
parentClassroom: parentClassroom,
|
|
398
|
+
exercise: gameId
|
|
398
399
|
}),
|
|
399
400
|
beforeElements: beforeElements,
|
|
400
401
|
afterElements: afterElements,
|
|
@@ -399,7 +399,8 @@ function RoleplayGame({
|
|
|
399
399
|
handleEditRoleplay: handleEditRoleplay,
|
|
400
400
|
handleRestart: handleRestart,
|
|
401
401
|
handleShareRoleplay: handleShareRoleplay,
|
|
402
|
-
parentClassroom: parentClassroom
|
|
402
|
+
parentClassroom: parentClassroom,
|
|
403
|
+
exercise: gameId
|
|
403
404
|
}),
|
|
404
405
|
beforeElements: beforeElements,
|
|
405
406
|
afterElements: afterElements,
|
|
@@ -273,7 +273,8 @@ function RoleplayGame({
|
|
|
273
273
|
handleEditRoleplay: handleEditRoleplay,
|
|
274
274
|
handleRestart: handleRestart,
|
|
275
275
|
handleShareRoleplay: handleShareRoleplay,
|
|
276
|
-
parentClassroom: parentClassroom
|
|
276
|
+
parentClassroom: parentClassroom,
|
|
277
|
+
exercise: gameId
|
|
277
278
|
}),
|
|
278
279
|
beforeElements: /*#__PURE__*/_react.default.createElement(_BeforeElements.default, {
|
|
279
280
|
t: t,
|
|
@@ -258,7 +258,8 @@ function RoleplayGame({
|
|
|
258
258
|
handleEditRoleplay: handleEditRoleplay,
|
|
259
259
|
handleRestart: handleRestart,
|
|
260
260
|
handleShareRoleplay: handleShareRoleplay,
|
|
261
|
-
parentClassroom: parentClassroom
|
|
261
|
+
parentClassroom: parentClassroom,
|
|
262
|
+
exercise: gameId
|
|
262
263
|
}),
|
|
263
264
|
beforeElements: /*#__PURE__*/_react.default.createElement(_BeforeElements.default, {
|
|
264
265
|
t: t,
|
|
@@ -357,7 +357,8 @@ function OverflowMenu({
|
|
|
357
357
|
handleCloseReportProblem: handleCloseReportProblem,
|
|
358
358
|
handleReportProblem: handleReportProblem,
|
|
359
359
|
mode: "menuitem",
|
|
360
|
-
menuIconClassname: classes.menuIcon
|
|
360
|
+
menuIconClassname: classes.menuIcon,
|
|
361
|
+
exercise: exerciseName
|
|
361
362
|
})));
|
|
362
363
|
}
|
|
363
364
|
function Roleplay({
|
|
@@ -619,7 +620,8 @@ function Roleplay({
|
|
|
619
620
|
isReportProblemOpen: isReportProblemOpen,
|
|
620
621
|
handleOpenReportProblem: handleOpenReportProblem,
|
|
621
622
|
handleCloseReportProblem: handleCloseReportProblem,
|
|
622
|
-
handleReportProblem: handleReportProblem
|
|
623
|
+
handleReportProblem: handleReportProblem,
|
|
624
|
+
exercise: exerciseName
|
|
623
625
|
})), /*#__PURE__*/_react.default.createElement(_Hidden.default, {
|
|
624
626
|
smUp: true
|
|
625
627
|
}, /*#__PURE__*/_react.default.createElement(_material.Button, {
|
|
@@ -13,10 +13,11 @@ function ChipInput(props) {
|
|
|
13
13
|
name = "",
|
|
14
14
|
value = [],
|
|
15
15
|
handleChange = () => {},
|
|
16
|
-
label
|
|
16
|
+
label,
|
|
17
|
+
delimiter = /[\s,]+/
|
|
17
18
|
} = props;
|
|
18
19
|
const handleAddChip = chip => {
|
|
19
|
-
const newChips = chip.split(
|
|
20
|
+
const newChips = chip.split(delimiter).map(c => c.trim().toLowerCase()).filter(Boolean);
|
|
20
21
|
handleChange({
|
|
21
22
|
target: {
|
|
22
23
|
name: name,
|
|
@@ -214,19 +214,20 @@ function BotInformation({
|
|
|
214
214
|
}, difficultyOptions)), /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
215
215
|
item: true,
|
|
216
216
|
xs: 12
|
|
217
|
-
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
217
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Typography, null, t("content_tags")), /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
218
218
|
color: "textSecondary",
|
|
219
219
|
component: "label",
|
|
220
220
|
htmlFor: "tags"
|
|
221
|
-
}, t("
|
|
221
|
+
}, t("enter_info_tags")), /*#__PURE__*/_react.default.createElement(_ChipInput.default, {
|
|
222
222
|
t: t,
|
|
223
223
|
id: "tags",
|
|
224
224
|
"data-cy": "tags",
|
|
225
|
-
value: tags,
|
|
225
|
+
value: tags || [],
|
|
226
226
|
name: "tags",
|
|
227
227
|
helperText: touched.tags ? t(errors.tags) : t("add_tag"),
|
|
228
228
|
error: touched.tags && Boolean(errors.tags),
|
|
229
229
|
handleChange: handleChange,
|
|
230
|
+
delimiter: /,/,
|
|
230
231
|
type: "text",
|
|
231
232
|
margin: "normal",
|
|
232
233
|
variant: "outlined",
|
|
@@ -119,19 +119,20 @@ function ClassroomInformation({
|
|
|
119
119
|
})), /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
120
120
|
item: true,
|
|
121
121
|
xs: 12
|
|
122
|
-
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
122
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Typography, null, t("content_tags")), /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
123
123
|
color: "textSecondary",
|
|
124
124
|
component: "label",
|
|
125
125
|
htmlFor: "tags"
|
|
126
|
-
}, t("
|
|
126
|
+
}, t("enter_info_tags")), /*#__PURE__*/_react.default.createElement(_ChipInput.default, {
|
|
127
127
|
t: t,
|
|
128
128
|
id: "tags",
|
|
129
129
|
"data-cy": "tags",
|
|
130
|
-
value: tags,
|
|
130
|
+
value: tags || [],
|
|
131
131
|
name: "tags",
|
|
132
132
|
helperText: touched.tags ? t(errors.tags) : t("add_tag"),
|
|
133
133
|
error: touched.tags && Boolean(errors.tags),
|
|
134
134
|
handleChange: handleChange,
|
|
135
|
+
delimiter: /,/,
|
|
135
136
|
type: "text",
|
|
136
137
|
margin: "normal",
|
|
137
138
|
variant: "outlined",
|
|
@@ -128,20 +128,21 @@ function ClassroomSettings({
|
|
|
128
128
|
sx: {
|
|
129
129
|
mb: 2
|
|
130
130
|
}
|
|
131
|
-
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
131
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Typography, null, t("allowed_domains")), /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
132
132
|
color: "textSecondary",
|
|
133
133
|
component: "label",
|
|
134
134
|
htmlFor: "allowedDomains"
|
|
135
|
-
}, t("
|
|
135
|
+
}, t("enter_domains_info")), /*#__PURE__*/_react.default.createElement(_ChipInput.default, {
|
|
136
136
|
t: t,
|
|
137
137
|
id: "allowedDomains",
|
|
138
138
|
"data-cy": "allowedDomains",
|
|
139
139
|
label: t("allowed_domains"),
|
|
140
|
-
value: allowedDomains,
|
|
140
|
+
value: allowedDomains || [],
|
|
141
141
|
name: "allowedDomains",
|
|
142
142
|
helperText: errors.allowedDomains ? t(errors.allowedDomains) : t("add_allowed_domains_desc"),
|
|
143
143
|
error: errors.allowedDomains && Boolean(errors.allowedDomains),
|
|
144
144
|
handleChange: handleChange,
|
|
145
|
+
delimiter: /[\s,]+/,
|
|
145
146
|
type: "text",
|
|
146
147
|
margin: "normal",
|
|
147
148
|
variant: "outlined",
|
|
@@ -176,20 +177,21 @@ function ClassroomSettings({
|
|
|
176
177
|
sx: {
|
|
177
178
|
mb: 2
|
|
178
179
|
}
|
|
179
|
-
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
180
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Typography, null, t("allowed_domains")), /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
180
181
|
color: "textSecondary",
|
|
181
182
|
component: "label",
|
|
182
183
|
htmlFor: "allowedDomains"
|
|
183
|
-
}, t("
|
|
184
|
+
}, t("enter_domains_info")), /*#__PURE__*/_react.default.createElement(_ChipInput.default, {
|
|
184
185
|
t: t,
|
|
185
186
|
id: "allowedDomains",
|
|
186
187
|
"data-cy": "allowedDomains",
|
|
187
188
|
label: t("allowed_domains"),
|
|
188
|
-
value: allowedDomains,
|
|
189
|
+
value: allowedDomains || [],
|
|
189
190
|
name: "allowedDomains",
|
|
190
191
|
helperText: errors.allowedDomains ? t(errors.allowedDomains) : t("add_allowed_domains_desc"),
|
|
191
192
|
error: errors.allowedDomains && Boolean(errors.allowedDomains),
|
|
192
193
|
handleChange: handleChange,
|
|
194
|
+
delimiter: /[\s,]+/,
|
|
193
195
|
type: "text",
|
|
194
196
|
margin: "normal",
|
|
195
197
|
variant: "outlined",
|
|
@@ -262,11 +264,12 @@ function ClassroomSettings({
|
|
|
262
264
|
id: "collaborators",
|
|
263
265
|
"data-cy": "collaborators",
|
|
264
266
|
label: t("collaborators"),
|
|
265
|
-
value: collaborators,
|
|
267
|
+
value: collaborators || [],
|
|
266
268
|
name: "collaborators",
|
|
267
269
|
helperText: touched.collaborators ? t(errors.collaborators) : t("add_collaborator_tag"),
|
|
268
270
|
error: touched.collaborators && Boolean(errors.collaborators),
|
|
269
271
|
handleChange: handleChange,
|
|
272
|
+
delimiter: /[\s,]+/,
|
|
270
273
|
type: "text",
|
|
271
274
|
margin: "normal",
|
|
272
275
|
variant: "outlined",
|
|
@@ -280,11 +283,12 @@ function ClassroomSettings({
|
|
|
280
283
|
id: "collaborators",
|
|
281
284
|
"data-cy": "collaborators",
|
|
282
285
|
label: t("collaborators"),
|
|
283
|
-
value: collaborators,
|
|
286
|
+
value: collaborators || [],
|
|
284
287
|
name: "collaborators",
|
|
285
288
|
helperText: touched.collaborators ? errors.collaborators : t("add_collaborator_tag"),
|
|
286
289
|
error: touched.collaborators && Boolean(errors.collaborators),
|
|
287
290
|
handleChange: handleChange,
|
|
291
|
+
delimiter: /[\s,]+/,
|
|
288
292
|
type: "text",
|
|
289
293
|
margin: "normal",
|
|
290
294
|
variant: "outlined",
|
|
@@ -143,19 +143,20 @@ function CourseInformation({
|
|
|
143
143
|
})), /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
144
144
|
item: true,
|
|
145
145
|
xs: 12
|
|
146
|
-
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
146
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Typography, null, t("content_tags")), /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
147
147
|
color: "textSecondary",
|
|
148
148
|
component: "label",
|
|
149
149
|
htmlFor: "tags"
|
|
150
|
-
}, t("
|
|
150
|
+
}, t("enter_info_tags")), /*#__PURE__*/_react.default.createElement(_ChipInput.default, {
|
|
151
151
|
t: t,
|
|
152
152
|
id: "tags",
|
|
153
153
|
"data-cy": "tags",
|
|
154
|
-
value: tags,
|
|
154
|
+
value: tags || [],
|
|
155
155
|
name: "tags",
|
|
156
156
|
helperText: touched.tags ? t(errors.tags) : t("add_tag"),
|
|
157
157
|
error: touched.tags && Boolean(errors.tags),
|
|
158
158
|
handleChange: handleChange,
|
|
159
|
+
delimiter: /,/,
|
|
159
160
|
type: "text",
|
|
160
161
|
margin: "normal",
|
|
161
162
|
variant: "outlined",
|
|
@@ -95,20 +95,21 @@ function CourseSettings({
|
|
|
95
95
|
sx: {
|
|
96
96
|
mb: 2
|
|
97
97
|
}
|
|
98
|
-
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
98
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Typography, null, t("allowed_domains")), /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
99
99
|
color: "textSecondary",
|
|
100
100
|
component: "label",
|
|
101
101
|
htmlFor: "allowedDomains"
|
|
102
|
-
}, t("
|
|
102
|
+
}, t("enter_domains_info")), /*#__PURE__*/_react.default.createElement(_ChipInput.default, {
|
|
103
103
|
t: t,
|
|
104
104
|
id: "allowedDomains",
|
|
105
105
|
"data-cy": "allowedDomains",
|
|
106
106
|
label: t("allowed_domains"),
|
|
107
|
-
value: allowedDomains,
|
|
107
|
+
value: allowedDomains || [],
|
|
108
108
|
name: "allowedDomains",
|
|
109
109
|
helperText: errors.allowedDomains ? t(errors.allowedDomains) : t("add_allowed_domains_desc"),
|
|
110
110
|
error: errors.allowedDomains && Boolean(errors.allowedDomains),
|
|
111
111
|
handleChange: handleChange,
|
|
112
|
+
delimiter: /[\s,]+/,
|
|
112
113
|
type: "text",
|
|
113
114
|
margin: "normal",
|
|
114
115
|
variant: "outlined",
|
|
@@ -153,11 +154,12 @@ function CourseSettings({
|
|
|
153
154
|
id: "collaborators",
|
|
154
155
|
"data-cy": "collaborators",
|
|
155
156
|
label: t("collaborators"),
|
|
156
|
-
value: collaborators,
|
|
157
|
+
value: collaborators || [],
|
|
157
158
|
name: "collaborators",
|
|
158
159
|
helperText: touched.collaborators ? t(errors.collaborators) : t("add_collaborator_tag"),
|
|
159
160
|
error: touched.collaborators && Boolean(errors.collaborators),
|
|
160
161
|
handleChange: handleChange,
|
|
162
|
+
delimiter: /[\s,]+/,
|
|
161
163
|
type: "text",
|
|
162
164
|
margin: "normal",
|
|
163
165
|
variant: "outlined",
|
|
@@ -171,11 +173,12 @@ function CourseSettings({
|
|
|
171
173
|
id: "collaborators",
|
|
172
174
|
"data-cy": "collaborators",
|
|
173
175
|
label: t("collaborators"),
|
|
174
|
-
value: collaborators,
|
|
176
|
+
value: collaborators || [],
|
|
175
177
|
name: "collaborators",
|
|
176
178
|
helperText: touched.collaborators ? t(errors.collaborators) : t("add_collaborator_tag"),
|
|
177
179
|
error: touched.collaborators && Boolean(errors.collaborators),
|
|
178
180
|
handleChange: handleChange,
|
|
181
|
+
delimiter: /[\s,]+/,
|
|
179
182
|
type: "text",
|
|
180
183
|
margin: "normal",
|
|
181
184
|
variant: "outlined",
|
|
@@ -318,19 +318,20 @@ function RoleplayInformation({
|
|
|
318
318
|
sx: {
|
|
319
319
|
mb: 2
|
|
320
320
|
}
|
|
321
|
-
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
321
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Typography, null, t("content_tags")), /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
322
322
|
color: "textSecondary",
|
|
323
323
|
component: "label",
|
|
324
324
|
htmlFor: "tags"
|
|
325
|
-
}, t("
|
|
325
|
+
}, t("enter_info_tags")), /*#__PURE__*/_react.default.createElement(_ChipInput.default, {
|
|
326
326
|
t: t,
|
|
327
327
|
id: "tags",
|
|
328
328
|
"data-cy": "tags",
|
|
329
|
-
value: tags,
|
|
329
|
+
value: tags || [],
|
|
330
330
|
name: "tags",
|
|
331
331
|
helperText: touched.tags ? t(errors.tags) : t("add_tag"),
|
|
332
332
|
error: touched.tags && Boolean(errors.tags),
|
|
333
333
|
handleChange: handleChange,
|
|
334
|
+
delimiter: /,/,
|
|
334
335
|
type: "text",
|
|
335
336
|
margin: "normal",
|
|
336
337
|
variant: "outlined",
|
|
@@ -360,11 +360,11 @@ function RoleplayInformation({
|
|
|
360
360
|
sx: {
|
|
361
361
|
mb: 2
|
|
362
362
|
}
|
|
363
|
-
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
363
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Typography, null, t("content_tags")), /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
364
364
|
color: "textSecondary",
|
|
365
365
|
component: "label",
|
|
366
366
|
htmlFor: "tags"
|
|
367
|
-
}, t("
|
|
367
|
+
}, t("enter_info_tags")), /*#__PURE__*/_react.default.createElement(_reactHookForm.Controller, {
|
|
368
368
|
name: "tags",
|
|
369
369
|
render: ({
|
|
370
370
|
field: {
|
|
@@ -380,7 +380,7 @@ function RoleplayInformation({
|
|
|
380
380
|
t: t,
|
|
381
381
|
id: "tags",
|
|
382
382
|
"data-cy": "tags",
|
|
383
|
-
value: value,
|
|
383
|
+
value: value || [],
|
|
384
384
|
name: "tags"
|
|
385
385
|
// Having a bit of trouble getting helper text displayed too, seems to be an issue with refs
|
|
386
386
|
,
|
|
@@ -388,6 +388,7 @@ function RoleplayInformation({
|
|
|
388
388
|
error: !!error,
|
|
389
389
|
onBlur: onBlur,
|
|
390
390
|
handleChange: onChange,
|
|
391
|
+
delimiter: /,/,
|
|
391
392
|
type: "text",
|
|
392
393
|
margin: "normal",
|
|
393
394
|
variant: "outlined",
|
|
@@ -136,19 +136,20 @@ function TopicInformation({
|
|
|
136
136
|
})), /*#__PURE__*/_react.default.createElement(_material.Grid, {
|
|
137
137
|
item: true,
|
|
138
138
|
xs: 12
|
|
139
|
-
}, /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
139
|
+
}, /*#__PURE__*/_react.default.createElement(_material.Typography, null, t("content_tags")), /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
140
140
|
color: "textSecondary",
|
|
141
141
|
component: "label",
|
|
142
142
|
htmlFor: "tags"
|
|
143
|
-
}, t("
|
|
143
|
+
}, t("enter_info_tags")), /*#__PURE__*/_react.default.createElement(_ChipInput.default, {
|
|
144
144
|
t: t,
|
|
145
145
|
id: "tags",
|
|
146
146
|
"data-cy": "tags",
|
|
147
|
-
value: tags,
|
|
147
|
+
value: tags || [],
|
|
148
148
|
name: "tags",
|
|
149
149
|
helperText: touched.tags ? t(errors.tags) : t("add_tag"),
|
|
150
150
|
error: touched.tags && Boolean(errors.tags),
|
|
151
151
|
handleChange: handleChange,
|
|
152
|
+
delimiter: /,/,
|
|
152
153
|
type: "text",
|
|
153
154
|
margin: "normal",
|
|
154
155
|
variant: "outlined",
|
|
@@ -423,6 +423,10 @@ function Classroom({
|
|
|
423
423
|
content: /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("h2", null, t("classroom_creator_add_students_email")), /*#__PURE__*/_react.default.createElement("br", null), /*#__PURE__*/_react.default.createElement("p", null, t("classroom_creator_add_students_email_desc"))),
|
|
424
424
|
spotlightPadding: 8,
|
|
425
425
|
target: "#invite"
|
|
426
|
+
}, {
|
|
427
|
+
content: /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("h2", null, t("classroom_creator_play_live_game")), /*#__PURE__*/_react.default.createElement("br", null), /*#__PURE__*/_react.default.createElement("p", null, t("classroom_creator_play_live_game_desc"))),
|
|
428
|
+
spotlightPadding: 8,
|
|
429
|
+
target: "#play-live"
|
|
426
430
|
}, {
|
|
427
431
|
content: /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("h2", null, t("classroom_creator_track_progress")), /*#__PURE__*/_react.default.createElement("br", null), /*#__PURE__*/_react.default.createElement("p", null, t("classroom_creator_track_progress_desc"))),
|
|
428
432
|
spotlightPadding: 8,
|
|
@@ -1076,6 +1080,7 @@ function Classroom({
|
|
|
1076
1080
|
color: "primary",
|
|
1077
1081
|
startIcon: /*#__PURE__*/_react.default.createElement(_LiveTv.default, null),
|
|
1078
1082
|
size: "small",
|
|
1083
|
+
id: "play-live",
|
|
1079
1084
|
sx: {
|
|
1080
1085
|
animation: createdGame && createdGame.createdBy === username ? `${theme.palette.mode === "light" ? _Styles.glowPulseLight : _Styles.glowPulseDark} 2s infinite ease-in-out` : null,
|
|
1081
1086
|
boxShadow: createdGame && createdGame.createdBy === username ? `0 0 0 0 ${theme.palette.mode === "light" ? "rgba(101, 0, 221, 0.7)" : "rgba(171, 120, 255, 0.7)"}` : null
|