@nualang/nualang-ui-components 0.1.1403 → 0.1.1406

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.
@@ -141,6 +141,12 @@ function PhraseList({
141
141
  }, ...(hasDefinitions ? [{
142
142
  name: "meaning",
143
143
  description: "meaning_exercise_desc"
144
+ }, {
145
+ name: "meaning-listen-and-speak",
146
+ description: "meaning_listen_and_speak_exercise_desc"
147
+ }, {
148
+ name: "meaning-read-and-write",
149
+ description: "meaning_read_write_exercise_desc"
144
150
  }] : [])].filter(game => !hidden.has(game.name));
145
151
  const filteredGames = viewOnly ? games.filter(game => selectedExercises.some(exercise => exercise.name === game.name && exercise.courseSectionTopicId === courseSectionTopicId && exercise.phraseListId === phraseList.phraseListId)) : games;
146
152
  useEffect(() => {
@@ -239,7 +245,7 @@ function PhraseList({
239
245
  };
240
246
  };
241
247
  const getTotalQuestions = gameName => {
242
- if (gameName === "meaning") {
248
+ if (gameName === "meaning" || gameName === "meaning-listen-and-speak" || gameName === "meaning-read-and-write") {
243
249
  return activePhrases.filter(phrase => phrase.definitions?.length > 0).length;
244
250
  }
245
251
  return activePhrases.length;
@@ -355,6 +361,10 @@ function PhraseList({
355
361
  children: /*#__PURE__*/_jsx(RecordVoiceOverIcon, {})
356
362
  }), game.name.toLowerCase() === "meaning" && /*#__PURE__*/_jsx(ListItemIcon, {
357
363
  children: /*#__PURE__*/_jsx(ExtensionIcon, {})
364
+ }), game.name.toLowerCase() === "meaning-listen-and-speak" && /*#__PURE__*/_jsx(ListItemIcon, {
365
+ children: /*#__PURE__*/_jsx(ExtensionIcon, {})
366
+ }), game.name.toLowerCase() === "meaning-read-and-write" && /*#__PURE__*/_jsx(ListItemIcon, {
367
+ children: /*#__PURE__*/_jsx(ExtensionIcon, {})
358
368
  }), /*#__PURE__*/_jsx(ListItemText, {
359
369
  primary: t(game.name),
360
370
  secondary: t(game.description)
@@ -311,8 +311,11 @@ export const calcTopicCompletions = (topic, completions = [], isSectionHidden, a
311
311
  if (!assignmentExercises && topic.phraseLists?.length > 0) {
312
312
  topic.phraseLists.forEach(phraseList => {
313
313
  if (phraseList.isPhraseListHidden) return;
314
- const hasMeaning = phraseList?.phrases?.some(p => p.definitions?.length > 0) && !phraseList?.hiddenPhraseGroupGames?.meaning;
315
- const exerciseNames = ["translation", "listening", "pronunciation", ...(hasMeaning ? ["meaning"] : [])];
314
+ const hasDefinitions = phraseList?.phrases?.some(p => p.definitions?.length > 0);
315
+ const hasMeaning = hasDefinitions && !phraseList?.hiddenPhraseGroupGames?.meaning;
316
+ const hasListenAndSpeak = hasDefinitions && !phraseList?.hiddenPhraseGroupGames?.["meaning-listen-and-speak"];
317
+ const hasReadAndWrite = hasDefinitions && !phraseList?.hiddenPhraseGroupGames?.["meaning-read-and-write"];
318
+ const exerciseNames = ["translation", "listening", "pronunciation", ...(hasMeaning ? ["meaning"] : []), ...(hasListenAndSpeak ? ["meaning-listen-and-speak"] : []), ...(hasReadAndWrite ? ["meaning-read-and-write"] : [])];
316
319
  exerciseNames.forEach(exerciseName => {
317
320
  totalExercises++;
318
321
  const isCompleted = Array.isArray(completions) && completions.some(c => c.phraseListId === phraseList.phraseListId && c.exercise === exerciseName && c.topicId === topic.topicId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nualang/nualang-ui-components",
3
- "version": "0.1.1403",
3
+ "version": "0.1.1406",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "files": [