catchup-library-web 1.2.7 → 1.2.9

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,15 +2694,26 @@ 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) => {
2702
- console.log(materialMap[key]);
2698
+ const materialInnerMap = JSON.parse(materialMap[key]);
2699
+ const innerKey = Object.keys(materialInnerMap)[0];
2700
+ const optionList = JSON.parse(materialInnerMap[innerKey]);
2701
+ let currentText = "";
2702
+ for (const option of optionList) {
2703
+ let prefix = "";
2704
+ if (option === innerKey) {
2705
+ prefix = `[${i18n_default.t("correct").toUpperCase()}]`;
2706
+ } else {
2707
+ prefix = `[${i18n_default.t("incorrect").toUpperCase()}]`;
2708
+ }
2709
+ currentText += `${prefix}${option}, `;
2710
+ }
2703
2711
  itemList.push({
2704
2712
  type: "text",
2705
- text: `${index + 1}. ${Object.keys(materialMap[key])[0]}`
2713
+ text: `${index + 1}. ${currentText.substring(
2714
+ 0,
2715
+ currentText.length - 2
2716
+ )}`
2706
2717
  });
2707
2718
  });
2708
2719
  }
package/dist/index.mjs CHANGED
@@ -2514,15 +2514,26 @@ 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) => {
2522
- console.log(materialMap[key]);
2518
+ const materialInnerMap = JSON.parse(materialMap[key]);
2519
+ const innerKey = Object.keys(materialInnerMap)[0];
2520
+ const optionList = JSON.parse(materialInnerMap[innerKey]);
2521
+ let currentText = "";
2522
+ for (const option of optionList) {
2523
+ let prefix = "";
2524
+ if (option === innerKey) {
2525
+ prefix = `[${i18n_default.t("correct").toUpperCase()}]`;
2526
+ } else {
2527
+ prefix = `[${i18n_default.t("incorrect").toUpperCase()}]`;
2528
+ }
2529
+ currentText += `${prefix}${option}, `;
2530
+ }
2523
2531
  itemList.push({
2524
2532
  type: "text",
2525
- text: `${index + 1}. ${Object.keys(materialMap[key])[0]}`
2533
+ text: `${index + 1}. ${currentText.substring(
2534
+ 0,
2535
+ currentText.length - 2
2536
+ )}`
2526
2537
  });
2527
2538
  });
2528
2539
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catchup-library-web",
3
- "version": "1.2.7",
3
+ "version": "1.2.9",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -2007,15 +2007,26 @@ 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) => {
2015
- console.log(materialMap[key]);
2011
+ const materialInnerMap = JSON.parse(materialMap[key]);
2012
+ const innerKey = Object.keys(materialInnerMap)[0];
2013
+ const optionList = JSON.parse(materialInnerMap[innerKey]);
2014
+ let currentText = "";
2015
+ for (const option of optionList) {
2016
+ let prefix = "";
2017
+ if (option === innerKey) {
2018
+ prefix = `[${i18n.t("correct").toUpperCase()}]`;
2019
+ } else {
2020
+ prefix = `[${i18n.t("incorrect").toUpperCase()}]`;
2021
+ }
2022
+ currentText += `${prefix}${option}, `;
2023
+ }
2016
2024
  itemList.push({
2017
2025
  type: "text",
2018
- text: `${index + 1}. ${Object.keys(materialMap[key])[0]}`,
2026
+ text: `${index + 1}. ${currentText.substring(
2027
+ 0,
2028
+ currentText.length - 2
2029
+ )}`,
2019
2030
  });
2020
2031
  });
2021
2032
  }