catchup-library-web 1.2.6 → 1.2.8

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/index.js CHANGED
@@ -2694,14 +2694,29 @@ var constructActivityItemListMaterialOnly = (materialMap, type) => {
2694
2694
  }
2695
2695
  } else if (type === "DROPDOWN") {
2696
2696
  if (Object.keys(materialMap).length > 0) {
2697
- itemList.push({
2698
- type: "text",
2699
- text: `${i18n_default.t("correct_blanks")}: `
2700
- });
2701
2697
  Object.keys(materialMap).forEach((key, index) => {
2698
+ const materialInnerMap = JSON.parse(materialMap[key]);
2699
+ const innerKey = Object.keys(materialInnerMap)[0];
2700
+ console.log("innerKey", innerKey);
2701
+ const optionList = JSON.parse(materialInnerMap[innerKey]);
2702
+ console.log("optionList", optionList);
2703
+ let currentText = "";
2704
+ for (const option of optionList) {
2705
+ let prefix = "";
2706
+ if (option === innerKey) {
2707
+ prefix = `[${i18n_default.t("correct")}]`;
2708
+ } else {
2709
+ prefix = `[${i18n_default.t("incorrect")}]`;
2710
+ }
2711
+ currentText += `${prefix}${option}, `;
2712
+ }
2713
+ console.log("currentText", currentText);
2702
2714
  itemList.push({
2703
2715
  type: "text",
2704
- text: `${index + 1}. ${Object.keys(materialMap[key])[0]}`
2716
+ text: `${index + 1}. ${currentText.substring(
2717
+ 0,
2718
+ currentText.length - 2
2719
+ )}`
2705
2720
  });
2706
2721
  });
2707
2722
  }
@@ -2766,9 +2781,6 @@ var constructActivityItemListMaterialOnly = (materialMap, type) => {
2766
2781
  });
2767
2782
  const groupName = key;
2768
2783
  let currentText = "";
2769
- console.log("group name: ", groupName);
2770
- console.log("material map: ", materialMap);
2771
- console.log("material map group name: ", materialMap[groupName]);
2772
2784
  JSON.parse(materialMap[groupName]).forEach((item) => {
2773
2785
  currentText += `${item}, `;
2774
2786
  });
package/dist/index.mjs CHANGED
@@ -2514,14 +2514,29 @@ var constructActivityItemListMaterialOnly = (materialMap, type) => {
2514
2514
  }
2515
2515
  } else if (type === "DROPDOWN") {
2516
2516
  if (Object.keys(materialMap).length > 0) {
2517
- itemList.push({
2518
- type: "text",
2519
- text: `${i18n_default.t("correct_blanks")}: `
2520
- });
2521
2517
  Object.keys(materialMap).forEach((key, index) => {
2518
+ const materialInnerMap = JSON.parse(materialMap[key]);
2519
+ const innerKey = Object.keys(materialInnerMap)[0];
2520
+ console.log("innerKey", innerKey);
2521
+ const optionList = JSON.parse(materialInnerMap[innerKey]);
2522
+ console.log("optionList", optionList);
2523
+ let currentText = "";
2524
+ for (const option of optionList) {
2525
+ let prefix = "";
2526
+ if (option === innerKey) {
2527
+ prefix = `[${i18n_default.t("correct")}]`;
2528
+ } else {
2529
+ prefix = `[${i18n_default.t("incorrect")}]`;
2530
+ }
2531
+ currentText += `${prefix}${option}, `;
2532
+ }
2533
+ console.log("currentText", currentText);
2522
2534
  itemList.push({
2523
2535
  type: "text",
2524
- text: `${index + 1}. ${Object.keys(materialMap[key])[0]}`
2536
+ text: `${index + 1}. ${currentText.substring(
2537
+ 0,
2538
+ currentText.length - 2
2539
+ )}`
2525
2540
  });
2526
2541
  });
2527
2542
  }
@@ -2586,9 +2601,6 @@ var constructActivityItemListMaterialOnly = (materialMap, type) => {
2586
2601
  });
2587
2602
  const groupName = key;
2588
2603
  let currentText = "";
2589
- console.log("group name: ", groupName);
2590
- console.log("material map: ", materialMap);
2591
- console.log("material map group name: ", materialMap[groupName]);
2592
2604
  JSON.parse(materialMap[groupName]).forEach((item) => {
2593
2605
  currentText += `${item}, `;
2594
2606
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catchup-library-web",
3
- "version": "1.2.6",
3
+ "version": "1.2.8",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -2007,14 +2007,29 @@ export const constructActivityItemListMaterialOnly = (
2007
2007
  }
2008
2008
  } else if (type === "DROPDOWN") {
2009
2009
  if (Object.keys(materialMap).length > 0) {
2010
- itemList.push({
2011
- type: "text",
2012
- text: `${i18n.t("correct_blanks")}: `,
2013
- });
2014
2010
  Object.keys(materialMap).forEach((key, index) => {
2011
+ const materialInnerMap = JSON.parse(materialMap[key]);
2012
+ const innerKey = Object.keys(materialInnerMap)[0];
2013
+ console.log("innerKey", innerKey);
2014
+ const optionList = JSON.parse(materialInnerMap[innerKey]);
2015
+ console.log("optionList", optionList);
2016
+ let currentText = "";
2017
+ for (const option of optionList) {
2018
+ let prefix = "";
2019
+ if (option === innerKey) {
2020
+ prefix = `[${i18n.t("correct")}]`;
2021
+ } else {
2022
+ prefix = `[${i18n.t("incorrect")}]`;
2023
+ }
2024
+ currentText += `${prefix}${option}, `;
2025
+ }
2026
+ console.log("currentText", currentText);
2015
2027
  itemList.push({
2016
2028
  type: "text",
2017
- text: `${index + 1}. ${Object.keys(materialMap[key])[0]}`,
2029
+ text: `${index + 1}. ${currentText.substring(
2030
+ 0,
2031
+ currentText.length - 2
2032
+ )}`,
2018
2033
  });
2019
2034
  });
2020
2035
  }
@@ -2080,9 +2095,6 @@ export const constructActivityItemListMaterialOnly = (
2080
2095
 
2081
2096
  const groupName = key;
2082
2097
  let currentText = "";
2083
- console.log("group name: ", groupName);
2084
- console.log("material map: ", materialMap);
2085
- console.log("material map group name: ", materialMap[groupName]);
2086
2098
  JSON.parse(materialMap[groupName]).forEach((item: string) => {
2087
2099
  currentText += `${item}, `;
2088
2100
  });