catchup-library-web 1.2.1 → 1.2.3

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.d.mts CHANGED
@@ -306,6 +306,13 @@ interface IInfoWithText {
306
306
 
307
307
  declare const InfoWithText: (props: IInfoWithText) => react_jsx_runtime.JSX.Element;
308
308
 
309
+ interface IInputWithSpecialExpressionProps {
310
+ value: string;
311
+ showSpecialOnly: boolean;
312
+ }
313
+
314
+ declare const InputWithSpecialExpression: ({ value, showSpecialOnly, }: IInputWithSpecialExpressionProps) => react_jsx_runtime.JSX.Element | null;
315
+
309
316
  declare const shuffleArray: (array: any) => any;
310
317
  declare const getColorByIndex: (index: number) => string;
311
318
 
@@ -412,6 +419,12 @@ declare const convertToSolutionMapString: (type: string, solutionMap: any) => an
412
419
  declare const convertToEvaluationRubricMapString: (type: string, evaluationRubricMap: any) => any;
413
420
  declare const constructActivityData: (activityTemplateType: string, contentMap: any, bodyMap: any, materialMap: any, solutionMap: any, taxonomyMap: any, evaluationRubricMap: any) => any;
414
421
  declare const constructAnswerBasedOnData: (data: any) => any;
422
+ declare const constructActivityItemListBodyOnly: (bodyMap: any) => any;
423
+ declare const constructActivityItemListMaterialOnly: (materialMap: any, type: string) => {
424
+ type: string;
425
+ text: string;
426
+ }[];
427
+ declare const constructActivityItemListSolutionOnly: (solutionMap: any) => any;
415
428
 
416
429
  declare const retrieveCategoryVersionCodeOptionList: () => {
417
430
  value: string;
@@ -638,4 +651,4 @@ declare const retrieveTokenUsageSubTypeOptionList: () => {
638
651
  value: string;
639
652
  }[];
640
653
 
641
- export { ActivityPreviewByData, ActivitySolutionContent, ActivityTemplateLabel, ApproveButton, BaseImage, BaseLoading, BaseLoadingWithText, BaseModal, BlueVerticalDividerLine, BrandLabel, CancelButton, CoterieLabel, CreateButton, DeleteButton, DividerLine, DropdownActivityContent, FillInTheBlanksActivityContent, GradeLabel, GroupingActivityContent, InfoWithText, InputGroup, MCMAActivityContent, MCSAActivityContent, MatchingActivityContent, ONE_DAY, ONE_HOUR, ONE_MONTH, ONE_WEEK, OpenEndedActivityContent, OrderingActivityContent, OutcomeLabel, PersonalLabel, PrimaryButton, PublishingHouseLabel, SecondaryButton, SelectionBox, SelectionCheckbox, SelectionTab, THREE_MONTHS, TrueFalseActivityContent, VerticalDividerLine, calculateLevenshteinDistance, checkActivityAnswerState, checkIfAnswerIsEmpty, constructActivityAnswerMap, constructActivityAnswerStateList, constructActivityData, constructActivityItemListWithAnswersForAI, constructActivityItemListWithSolutionForAI, constructAnswerBasedOnData, constructBaseNumericIndividualModel, constructBaseVerbalIndvidualModel, constructInputWithSpecialExpressionList, constructUserProfileQueryParams, constructWeekName, convertDataURLtoFile, convertToBase64, convertToBodyMapString, convertToEvaluationRubricMapString, convertToSolutionMapString, convertTurkishCharactersToEnglish, filterCategoryVersionCodeOptionList, filterCategoryVersionCodeOptionListByGradeDTO, filterCategoryVersionCodeOptionListByInstitutionDTO, filterCoterieTypeOptionList, filterGradeLevelOptionList, filterUserRoleOptionList, findAISettingsFromCurrentProfile, findBestFitActivity, getColorByIndex, ignoreMathematicalExpression, mergeObjects, parseBodyMapFromData, parseContentMapFromData, parseJwt, parseMaterialMapFromData, retrieveActivityAnswerFromAnswerList, retrieveActivityTemplateDTOOptionList, retrieveAllEarnedBadgeDTOListByCoterieType, retrieveAllEarnedBadgeDTOListByCoterieTypeList, retrieveAnnouncementAudienceOptionList, retrieveAnnouncementTypeOptionList, retrieveBadgeRuleListByParams, retrieveBadgeRuleTextByParams, retrieveBranchDTOByUserProfileOptionList, retrieveBranchDTOOptionList, retrieveBrandDTOByUserProfileOptionList, retrieveBrandDTOOptionList, retrieveCampusDTOByUserProfileOptionList, retrieveCampusDTOOptionList, retrieveCategoryVersionCodeOptionList, retrieveClockTimeLeft, retrieveColorByScore, retrieveContentTypeOptionList, retrieveContestTypeOptionList, retrieveCoterieTypeFromStandardExamCoterieType, retrieveCoterieTypeOptionList, retrieveCountryCodeOptionList, retrieveCountryNameOptionList, retrieveCurrentDefaultDataMap, retrieveDateIntervalOptionList, retrieveDefaultUserRoleOptionList, retrieveDistintCoterieTypeFromCatchtivityApplicationDTO, retrieveDocumentTypeFromAcceptedFormat, retrieveDocumentTypeFromExtension, retrieveDurationInMinutesOptionList, retrieveDurationInSecondsOptionList, retrieveDurationTypeOptionList, retrieveEachTimeSpentInSeconds, retrieveEnableOptionList, retrieveExternalRegistrationDTOOptionList, retrieveFrequencyTypeOptionList, retrieveGenderOptionList, retrieveGradeDTOByUserProfileOptionList, retrieveGradeDTOOptionList, retrieveGradeLevelOptionList, retrieveInstitutionDTOByUserProfileOptionList, retrieveInstitutionDTOOptionList, retrieveInstitutionTypeOptionList, retrieveMonthNameByIndex, retrieveOtherBadgeDTOList, retrievePhoneNumberAreaCodeList, retrieveProvinceNameOptionList, retrieveReportTypeOptionList, retrieveSeasonDTOByUserProfileOptionList, retrieveSeasonDTOOptionList, retrieveStandardExamCoterieTypeOptionListByStandardExamType, retrieveStandardExamTypeIcon, retrieveStandardExamTypeOptionList, retrieveStatusOptionList, retrieveTaxonomyGroupName, retrieveTaxonomyName, retrieveTaxonomyType, retrieveTokenUsageSubTypeOptionList, retrieveTokenUsageTypeOptionList, retrieveTotalTimeSpentInMinutes, retrieveTotalTimeSpentInSeconds, retrieveUserAuthorityGeneralOptionList, retrieveUserRoleOptionList, retrieveValidationRequirementList, shuffleArray, useScreenSize };
654
+ export { ActivityPreviewByData, ActivitySolutionContent, ActivityTemplateLabel, ApproveButton, BaseImage, BaseLoading, BaseLoadingWithText, BaseModal, BlueVerticalDividerLine, BrandLabel, CancelButton, CoterieLabel, CreateButton, DeleteButton, DividerLine, DropdownActivityContent, FillInTheBlanksActivityContent, GradeLabel, GroupingActivityContent, InfoWithText, InputGroup, InputWithSpecialExpression, MCMAActivityContent, MCSAActivityContent, MatchingActivityContent, ONE_DAY, ONE_HOUR, ONE_MONTH, ONE_WEEK, OpenEndedActivityContent, OrderingActivityContent, OutcomeLabel, PersonalLabel, PrimaryButton, PublishingHouseLabel, SecondaryButton, SelectionBox, SelectionCheckbox, SelectionTab, THREE_MONTHS, TrueFalseActivityContent, VerticalDividerLine, calculateLevenshteinDistance, checkActivityAnswerState, checkIfAnswerIsEmpty, constructActivityAnswerMap, constructActivityAnswerStateList, constructActivityData, constructActivityItemListBodyOnly, constructActivityItemListMaterialOnly, constructActivityItemListSolutionOnly, constructActivityItemListWithAnswersForAI, constructActivityItemListWithSolutionForAI, constructAnswerBasedOnData, constructBaseNumericIndividualModel, constructBaseVerbalIndvidualModel, constructInputWithSpecialExpressionList, constructUserProfileQueryParams, constructWeekName, convertDataURLtoFile, convertToBase64, convertToBodyMapString, convertToEvaluationRubricMapString, convertToSolutionMapString, convertTurkishCharactersToEnglish, filterCategoryVersionCodeOptionList, filterCategoryVersionCodeOptionListByGradeDTO, filterCategoryVersionCodeOptionListByInstitutionDTO, filterCoterieTypeOptionList, filterGradeLevelOptionList, filterUserRoleOptionList, findAISettingsFromCurrentProfile, findBestFitActivity, getColorByIndex, ignoreMathematicalExpression, mergeObjects, parseBodyMapFromData, parseContentMapFromData, parseJwt, parseMaterialMapFromData, retrieveActivityAnswerFromAnswerList, retrieveActivityTemplateDTOOptionList, retrieveAllEarnedBadgeDTOListByCoterieType, retrieveAllEarnedBadgeDTOListByCoterieTypeList, retrieveAnnouncementAudienceOptionList, retrieveAnnouncementTypeOptionList, retrieveBadgeRuleListByParams, retrieveBadgeRuleTextByParams, retrieveBranchDTOByUserProfileOptionList, retrieveBranchDTOOptionList, retrieveBrandDTOByUserProfileOptionList, retrieveBrandDTOOptionList, retrieveCampusDTOByUserProfileOptionList, retrieveCampusDTOOptionList, retrieveCategoryVersionCodeOptionList, retrieveClockTimeLeft, retrieveColorByScore, retrieveContentTypeOptionList, retrieveContestTypeOptionList, retrieveCoterieTypeFromStandardExamCoterieType, retrieveCoterieTypeOptionList, retrieveCountryCodeOptionList, retrieveCountryNameOptionList, retrieveCurrentDefaultDataMap, retrieveDateIntervalOptionList, retrieveDefaultUserRoleOptionList, retrieveDistintCoterieTypeFromCatchtivityApplicationDTO, retrieveDocumentTypeFromAcceptedFormat, retrieveDocumentTypeFromExtension, retrieveDurationInMinutesOptionList, retrieveDurationInSecondsOptionList, retrieveDurationTypeOptionList, retrieveEachTimeSpentInSeconds, retrieveEnableOptionList, retrieveExternalRegistrationDTOOptionList, retrieveFrequencyTypeOptionList, retrieveGenderOptionList, retrieveGradeDTOByUserProfileOptionList, retrieveGradeDTOOptionList, retrieveGradeLevelOptionList, retrieveInstitutionDTOByUserProfileOptionList, retrieveInstitutionDTOOptionList, retrieveInstitutionTypeOptionList, retrieveMonthNameByIndex, retrieveOtherBadgeDTOList, retrievePhoneNumberAreaCodeList, retrieveProvinceNameOptionList, retrieveReportTypeOptionList, retrieveSeasonDTOByUserProfileOptionList, retrieveSeasonDTOOptionList, retrieveStandardExamCoterieTypeOptionListByStandardExamType, retrieveStandardExamTypeIcon, retrieveStandardExamTypeOptionList, retrieveStatusOptionList, retrieveTaxonomyGroupName, retrieveTaxonomyName, retrieveTaxonomyType, retrieveTokenUsageSubTypeOptionList, retrieveTokenUsageTypeOptionList, retrieveTotalTimeSpentInMinutes, retrieveTotalTimeSpentInSeconds, retrieveUserAuthorityGeneralOptionList, retrieveUserRoleOptionList, retrieveValidationRequirementList, shuffleArray, useScreenSize };
package/dist/index.d.ts CHANGED
@@ -306,6 +306,13 @@ interface IInfoWithText {
306
306
 
307
307
  declare const InfoWithText: (props: IInfoWithText) => react_jsx_runtime.JSX.Element;
308
308
 
309
+ interface IInputWithSpecialExpressionProps {
310
+ value: string;
311
+ showSpecialOnly: boolean;
312
+ }
313
+
314
+ declare const InputWithSpecialExpression: ({ value, showSpecialOnly, }: IInputWithSpecialExpressionProps) => react_jsx_runtime.JSX.Element | null;
315
+
309
316
  declare const shuffleArray: (array: any) => any;
310
317
  declare const getColorByIndex: (index: number) => string;
311
318
 
@@ -412,6 +419,12 @@ declare const convertToSolutionMapString: (type: string, solutionMap: any) => an
412
419
  declare const convertToEvaluationRubricMapString: (type: string, evaluationRubricMap: any) => any;
413
420
  declare const constructActivityData: (activityTemplateType: string, contentMap: any, bodyMap: any, materialMap: any, solutionMap: any, taxonomyMap: any, evaluationRubricMap: any) => any;
414
421
  declare const constructAnswerBasedOnData: (data: any) => any;
422
+ declare const constructActivityItemListBodyOnly: (bodyMap: any) => any;
423
+ declare const constructActivityItemListMaterialOnly: (materialMap: any, type: string) => {
424
+ type: string;
425
+ text: string;
426
+ }[];
427
+ declare const constructActivityItemListSolutionOnly: (solutionMap: any) => any;
415
428
 
416
429
  declare const retrieveCategoryVersionCodeOptionList: () => {
417
430
  value: string;
@@ -638,4 +651,4 @@ declare const retrieveTokenUsageSubTypeOptionList: () => {
638
651
  value: string;
639
652
  }[];
640
653
 
641
- export { ActivityPreviewByData, ActivitySolutionContent, ActivityTemplateLabel, ApproveButton, BaseImage, BaseLoading, BaseLoadingWithText, BaseModal, BlueVerticalDividerLine, BrandLabel, CancelButton, CoterieLabel, CreateButton, DeleteButton, DividerLine, DropdownActivityContent, FillInTheBlanksActivityContent, GradeLabel, GroupingActivityContent, InfoWithText, InputGroup, MCMAActivityContent, MCSAActivityContent, MatchingActivityContent, ONE_DAY, ONE_HOUR, ONE_MONTH, ONE_WEEK, OpenEndedActivityContent, OrderingActivityContent, OutcomeLabel, PersonalLabel, PrimaryButton, PublishingHouseLabel, SecondaryButton, SelectionBox, SelectionCheckbox, SelectionTab, THREE_MONTHS, TrueFalseActivityContent, VerticalDividerLine, calculateLevenshteinDistance, checkActivityAnswerState, checkIfAnswerIsEmpty, constructActivityAnswerMap, constructActivityAnswerStateList, constructActivityData, constructActivityItemListWithAnswersForAI, constructActivityItemListWithSolutionForAI, constructAnswerBasedOnData, constructBaseNumericIndividualModel, constructBaseVerbalIndvidualModel, constructInputWithSpecialExpressionList, constructUserProfileQueryParams, constructWeekName, convertDataURLtoFile, convertToBase64, convertToBodyMapString, convertToEvaluationRubricMapString, convertToSolutionMapString, convertTurkishCharactersToEnglish, filterCategoryVersionCodeOptionList, filterCategoryVersionCodeOptionListByGradeDTO, filterCategoryVersionCodeOptionListByInstitutionDTO, filterCoterieTypeOptionList, filterGradeLevelOptionList, filterUserRoleOptionList, findAISettingsFromCurrentProfile, findBestFitActivity, getColorByIndex, ignoreMathematicalExpression, mergeObjects, parseBodyMapFromData, parseContentMapFromData, parseJwt, parseMaterialMapFromData, retrieveActivityAnswerFromAnswerList, retrieveActivityTemplateDTOOptionList, retrieveAllEarnedBadgeDTOListByCoterieType, retrieveAllEarnedBadgeDTOListByCoterieTypeList, retrieveAnnouncementAudienceOptionList, retrieveAnnouncementTypeOptionList, retrieveBadgeRuleListByParams, retrieveBadgeRuleTextByParams, retrieveBranchDTOByUserProfileOptionList, retrieveBranchDTOOptionList, retrieveBrandDTOByUserProfileOptionList, retrieveBrandDTOOptionList, retrieveCampusDTOByUserProfileOptionList, retrieveCampusDTOOptionList, retrieveCategoryVersionCodeOptionList, retrieveClockTimeLeft, retrieveColorByScore, retrieveContentTypeOptionList, retrieveContestTypeOptionList, retrieveCoterieTypeFromStandardExamCoterieType, retrieveCoterieTypeOptionList, retrieveCountryCodeOptionList, retrieveCountryNameOptionList, retrieveCurrentDefaultDataMap, retrieveDateIntervalOptionList, retrieveDefaultUserRoleOptionList, retrieveDistintCoterieTypeFromCatchtivityApplicationDTO, retrieveDocumentTypeFromAcceptedFormat, retrieveDocumentTypeFromExtension, retrieveDurationInMinutesOptionList, retrieveDurationInSecondsOptionList, retrieveDurationTypeOptionList, retrieveEachTimeSpentInSeconds, retrieveEnableOptionList, retrieveExternalRegistrationDTOOptionList, retrieveFrequencyTypeOptionList, retrieveGenderOptionList, retrieveGradeDTOByUserProfileOptionList, retrieveGradeDTOOptionList, retrieveGradeLevelOptionList, retrieveInstitutionDTOByUserProfileOptionList, retrieveInstitutionDTOOptionList, retrieveInstitutionTypeOptionList, retrieveMonthNameByIndex, retrieveOtherBadgeDTOList, retrievePhoneNumberAreaCodeList, retrieveProvinceNameOptionList, retrieveReportTypeOptionList, retrieveSeasonDTOByUserProfileOptionList, retrieveSeasonDTOOptionList, retrieveStandardExamCoterieTypeOptionListByStandardExamType, retrieveStandardExamTypeIcon, retrieveStandardExamTypeOptionList, retrieveStatusOptionList, retrieveTaxonomyGroupName, retrieveTaxonomyName, retrieveTaxonomyType, retrieveTokenUsageSubTypeOptionList, retrieveTokenUsageTypeOptionList, retrieveTotalTimeSpentInMinutes, retrieveTotalTimeSpentInSeconds, retrieveUserAuthorityGeneralOptionList, retrieveUserRoleOptionList, retrieveValidationRequirementList, shuffleArray, useScreenSize };
654
+ export { ActivityPreviewByData, ActivitySolutionContent, ActivityTemplateLabel, ApproveButton, BaseImage, BaseLoading, BaseLoadingWithText, BaseModal, BlueVerticalDividerLine, BrandLabel, CancelButton, CoterieLabel, CreateButton, DeleteButton, DividerLine, DropdownActivityContent, FillInTheBlanksActivityContent, GradeLabel, GroupingActivityContent, InfoWithText, InputGroup, InputWithSpecialExpression, MCMAActivityContent, MCSAActivityContent, MatchingActivityContent, ONE_DAY, ONE_HOUR, ONE_MONTH, ONE_WEEK, OpenEndedActivityContent, OrderingActivityContent, OutcomeLabel, PersonalLabel, PrimaryButton, PublishingHouseLabel, SecondaryButton, SelectionBox, SelectionCheckbox, SelectionTab, THREE_MONTHS, TrueFalseActivityContent, VerticalDividerLine, calculateLevenshteinDistance, checkActivityAnswerState, checkIfAnswerIsEmpty, constructActivityAnswerMap, constructActivityAnswerStateList, constructActivityData, constructActivityItemListBodyOnly, constructActivityItemListMaterialOnly, constructActivityItemListSolutionOnly, constructActivityItemListWithAnswersForAI, constructActivityItemListWithSolutionForAI, constructAnswerBasedOnData, constructBaseNumericIndividualModel, constructBaseVerbalIndvidualModel, constructInputWithSpecialExpressionList, constructUserProfileQueryParams, constructWeekName, convertDataURLtoFile, convertToBase64, convertToBodyMapString, convertToEvaluationRubricMapString, convertToSolutionMapString, convertTurkishCharactersToEnglish, filterCategoryVersionCodeOptionList, filterCategoryVersionCodeOptionListByGradeDTO, filterCategoryVersionCodeOptionListByInstitutionDTO, filterCoterieTypeOptionList, filterGradeLevelOptionList, filterUserRoleOptionList, findAISettingsFromCurrentProfile, findBestFitActivity, getColorByIndex, ignoreMathematicalExpression, mergeObjects, parseBodyMapFromData, parseContentMapFromData, parseJwt, parseMaterialMapFromData, retrieveActivityAnswerFromAnswerList, retrieveActivityTemplateDTOOptionList, retrieveAllEarnedBadgeDTOListByCoterieType, retrieveAllEarnedBadgeDTOListByCoterieTypeList, retrieveAnnouncementAudienceOptionList, retrieveAnnouncementTypeOptionList, retrieveBadgeRuleListByParams, retrieveBadgeRuleTextByParams, retrieveBranchDTOByUserProfileOptionList, retrieveBranchDTOOptionList, retrieveBrandDTOByUserProfileOptionList, retrieveBrandDTOOptionList, retrieveCampusDTOByUserProfileOptionList, retrieveCampusDTOOptionList, retrieveCategoryVersionCodeOptionList, retrieveClockTimeLeft, retrieveColorByScore, retrieveContentTypeOptionList, retrieveContestTypeOptionList, retrieveCoterieTypeFromStandardExamCoterieType, retrieveCoterieTypeOptionList, retrieveCountryCodeOptionList, retrieveCountryNameOptionList, retrieveCurrentDefaultDataMap, retrieveDateIntervalOptionList, retrieveDefaultUserRoleOptionList, retrieveDistintCoterieTypeFromCatchtivityApplicationDTO, retrieveDocumentTypeFromAcceptedFormat, retrieveDocumentTypeFromExtension, retrieveDurationInMinutesOptionList, retrieveDurationInSecondsOptionList, retrieveDurationTypeOptionList, retrieveEachTimeSpentInSeconds, retrieveEnableOptionList, retrieveExternalRegistrationDTOOptionList, retrieveFrequencyTypeOptionList, retrieveGenderOptionList, retrieveGradeDTOByUserProfileOptionList, retrieveGradeDTOOptionList, retrieveGradeLevelOptionList, retrieveInstitutionDTOByUserProfileOptionList, retrieveInstitutionDTOOptionList, retrieveInstitutionTypeOptionList, retrieveMonthNameByIndex, retrieveOtherBadgeDTOList, retrievePhoneNumberAreaCodeList, retrieveProvinceNameOptionList, retrieveReportTypeOptionList, retrieveSeasonDTOByUserProfileOptionList, retrieveSeasonDTOOptionList, retrieveStandardExamCoterieTypeOptionListByStandardExamType, retrieveStandardExamTypeIcon, retrieveStandardExamTypeOptionList, retrieveStatusOptionList, retrieveTaxonomyGroupName, retrieveTaxonomyName, retrieveTaxonomyType, retrieveTokenUsageSubTypeOptionList, retrieveTokenUsageTypeOptionList, retrieveTotalTimeSpentInMinutes, retrieveTotalTimeSpentInSeconds, retrieveUserAuthorityGeneralOptionList, retrieveUserRoleOptionList, retrieveValidationRequirementList, shuffleArray, useScreenSize };
package/dist/index.js CHANGED
@@ -88,6 +88,7 @@ __export(index_exports, {
88
88
  GroupingActivityContent: () => GroupingActivityContent_default,
89
89
  InfoWithText: () => InfoWithText_default,
90
90
  InputGroup: () => InputGroup_default,
91
+ InputWithSpecialExpression: () => InputWithSpecialExpression_default,
91
92
  MCMAActivityContent: () => MCMAActivityContent_default,
92
93
  MCSAActivityContent: () => MCSAActivityContent_default,
93
94
  MatchingActivityContent: () => MatchingActivityContent_default,
@@ -114,6 +115,9 @@ __export(index_exports, {
114
115
  constructActivityAnswerMap: () => constructActivityAnswerMap,
115
116
  constructActivityAnswerStateList: () => constructActivityAnswerStateList,
116
117
  constructActivityData: () => constructActivityData,
118
+ constructActivityItemListBodyOnly: () => constructActivityItemListBodyOnly,
119
+ constructActivityItemListMaterialOnly: () => constructActivityItemListMaterialOnly,
120
+ constructActivityItemListSolutionOnly: () => constructActivityItemListSolutionOnly,
117
121
  constructActivityItemListWithAnswersForAI: () => constructActivityItemListWithAnswersForAI,
118
122
  constructActivityItemListWithSolutionForAI: () => constructActivityItemListWithSolutionForAI,
119
123
  constructAnswerBasedOnData: () => constructAnswerBasedOnData,
@@ -2654,6 +2658,191 @@ var constructAnswerBasedOnData = (data) => {
2654
2658
  }
2655
2659
  return answer;
2656
2660
  };
2661
+ var constructActivityItemListBodyOnly = (bodyMap) => {
2662
+ const itemList = [];
2663
+ Object.keys(bodyMap).forEach((key) => {
2664
+ const bodyItem = JSON.parse(bodyMap[key]);
2665
+ if (bodyItem.type === "IMAGE") {
2666
+ itemList.push({
2667
+ type: "image_url",
2668
+ imageUrl: bodyItem.value
2669
+ });
2670
+ } else {
2671
+ itemList.push({
2672
+ type: "text",
2673
+ text: bodyItem.value
2674
+ });
2675
+ }
2676
+ });
2677
+ return itemList;
2678
+ };
2679
+ var constructActivityItemListMaterialOnly = (materialMap, type) => {
2680
+ const itemList = [];
2681
+ if (type === "ORDERING") {
2682
+ if (Object.keys(materialMap).length > 0) {
2683
+ itemList.push({
2684
+ type: "text",
2685
+ text: `${i18n_default.t("correct_order")}: `
2686
+ });
2687
+ Object.keys(materialMap).forEach((key) => {
2688
+ itemList.push({
2689
+ type: "text",
2690
+ text: materialMap[key]
2691
+ });
2692
+ });
2693
+ }
2694
+ } else if (type === "DROPDOWN") {
2695
+ if (Object.keys(materialMap).length > 0) {
2696
+ itemList.push({
2697
+ type: "text",
2698
+ text: `${i18n_default.t("correct_blanks")}: `
2699
+ });
2700
+ Object.keys(materialMap).forEach((key, index) => {
2701
+ itemList.push({
2702
+ type: "text",
2703
+ text: `${index + 1}. ${Object.keys(materialMap[key])[0]}`
2704
+ });
2705
+ });
2706
+ }
2707
+ } else if (type === "MCSA") {
2708
+ if (Object.keys(materialMap).length > 0) {
2709
+ itemList.push({
2710
+ type: "text",
2711
+ text: `${i18n_default.t("correct_answer")}: `
2712
+ });
2713
+ Object.keys(materialMap).forEach((key) => {
2714
+ itemList.push({
2715
+ type: "text",
2716
+ text: key
2717
+ });
2718
+ });
2719
+ }
2720
+ } else if (type === "MCMA") {
2721
+ if (Object.keys(materialMap).length > 0) {
2722
+ itemList.push({
2723
+ type: "text",
2724
+ text: `${i18n_default.t("correct_answers")}: `
2725
+ });
2726
+ const splittedTextList = Object.keys(materialMap)[0].split("\xA7");
2727
+ splittedTextList.forEach((item) => {
2728
+ const parsedItemList = JSON.parse(item);
2729
+ for (const parsedItem of parsedItemList) {
2730
+ itemList.push({
2731
+ type: "text",
2732
+ text: parsedItem
2733
+ });
2734
+ }
2735
+ });
2736
+ }
2737
+ } else if (type === "MATCHING") {
2738
+ if (Object.keys(materialMap).length > 0) {
2739
+ itemList.push({
2740
+ type: "text",
2741
+ text: `${i18n_default.t("correct_answers")}: `
2742
+ });
2743
+ Object.keys(materialMap).forEach((key, index) => {
2744
+ itemList.push({
2745
+ type: "text",
2746
+ text: `${i18n_default.t("match")} ${index + 1}:`
2747
+ });
2748
+ itemList.push({
2749
+ type: "text",
2750
+ text: `${key}: ${materialMap[key]}`
2751
+ });
2752
+ });
2753
+ }
2754
+ } else if (type === "GROUPING") {
2755
+ if (Object.keys(materialMap).length > 0) {
2756
+ itemList.push({
2757
+ type: "text",
2758
+ text: `${i18n_default.t("correct_answers")}: `
2759
+ });
2760
+ Object.keys(materialMap).forEach((key, index) => {
2761
+ let text = `${i18n_default.t("group")} ${index + 1}: `;
2762
+ itemList.push({
2763
+ type: "text",
2764
+ text
2765
+ });
2766
+ const groupName = key;
2767
+ let currentText = "";
2768
+ materialMap[groupName].forEach((item) => {
2769
+ currentText += `${item}, `;
2770
+ });
2771
+ currentText = currentText.substring(0, currentText.length - 2);
2772
+ itemList.push({
2773
+ type: "text",
2774
+ text: `${groupName}: [${currentText}]`
2775
+ });
2776
+ });
2777
+ }
2778
+ } else if (type === "FILL_IN_THE_BLANKS") {
2779
+ if (Object.keys(materialMap).length > 0) {
2780
+ itemList.push({
2781
+ type: "text",
2782
+ text: `${i18n_default.t("correct_blanks")}: `
2783
+ });
2784
+ Object.keys(materialMap).forEach((key, index) => {
2785
+ JSON.parse(materialMap[key]).forEach((item) => {
2786
+ itemList.push({
2787
+ type: "text",
2788
+ text: `${index + 1}. ${item}`
2789
+ });
2790
+ });
2791
+ });
2792
+ }
2793
+ } else if (type === "OPEN_ENDED") {
2794
+ } else if (type === "TRUE_FALSE") {
2795
+ if (materialMap.trueList) {
2796
+ materialMap.trueList = JSON.parse(materialMap.trueList);
2797
+ if (Object.keys(materialMap.trueList).length > 0) {
2798
+ itemList.push({
2799
+ type: "text",
2800
+ text: `${i18n_default.t("correct_answers")}: `
2801
+ });
2802
+ materialMap.trueList.forEach((item) => {
2803
+ itemList.push({
2804
+ type: "text",
2805
+ text: item
2806
+ });
2807
+ });
2808
+ }
2809
+ }
2810
+ if (materialMap.falseList) {
2811
+ materialMap.falseList = JSON.parse(materialMap.falseList);
2812
+ if (Object.keys(materialMap.falseList).length > 0) {
2813
+ itemList.push({
2814
+ type: "text",
2815
+ text: `${i18n_default.t("incorrect_answers")}: `
2816
+ });
2817
+ materialMap.falseList.forEach((item) => {
2818
+ itemList.push({
2819
+ type: "text",
2820
+ text: item
2821
+ });
2822
+ });
2823
+ }
2824
+ }
2825
+ }
2826
+ return itemList;
2827
+ };
2828
+ var constructActivityItemListSolutionOnly = (solutionMap) => {
2829
+ const itemList = [];
2830
+ Object.keys(solutionMap).forEach((key) => {
2831
+ const bodyItem = JSON.parse(solutionMap[key]);
2832
+ if (bodyItem.type === "IMAGE") {
2833
+ itemList.push({
2834
+ type: "image_url",
2835
+ imageUrl: bodyItem.value
2836
+ });
2837
+ } else {
2838
+ itemList.push({
2839
+ type: "text",
2840
+ text: bodyItem.value
2841
+ });
2842
+ }
2843
+ });
2844
+ return itemList;
2845
+ };
2657
2846
 
2658
2847
  // src/components/dividers/DividerLine.tsx
2659
2848
  var import_jsx_runtime11 = require("react/jsx-runtime");
@@ -6424,6 +6613,30 @@ var InfoWithText = (props) => {
6424
6613
  };
6425
6614
  var InfoWithText_default = InfoWithText;
6426
6615
 
6616
+ // src/components/texts/InputWithSpecialExpression.tsx
6617
+ var import_react_katex12 = require("react-katex");
6618
+ var import_jsx_runtime54 = require("react/jsx-runtime");
6619
+ var InputWithSpecialExpression = ({
6620
+ value,
6621
+ showSpecialOnly
6622
+ }) => {
6623
+ const inputWithSpecialExpressionList = constructInputWithSpecialExpressionList(value);
6624
+ return showSpecialOnly ? inputWithSpecialExpressionList.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "m-2", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "whitespace-pre-wrap", children: inputWithSpecialExpressionList.map((inputPart, index) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
6625
+ "span",
6626
+ {
6627
+ className: `${inputPart.isBold ? "font-semibold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
6628
+ children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-lg", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react_katex12.InlineMath, { math: inputPart.value }, index) }) : inputPart.value
6629
+ }
6630
+ )) }) }) : null : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "m-2", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "whitespace-pre-wrap", children: inputWithSpecialExpressionList.map((inputPart, index) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
6631
+ "span",
6632
+ {
6633
+ className: `${inputPart.isBold ? "font-semibold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
6634
+ children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "text-lg", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_react_katex12.InlineMath, { math: inputPart.value }, index) }) : inputPart.value
6635
+ }
6636
+ )) }) });
6637
+ };
6638
+ var InputWithSpecialExpression_default = InputWithSpecialExpression;
6639
+
6427
6640
  // src/utilization/AuthorizationUtilization.ts
6428
6641
  var parseJwt = (token) => {
6429
6642
  var base64Url = token.split(".")[1];
@@ -8539,6 +8752,7 @@ var retrieveTokenUsageSubTypeOptionList = () => {
8539
8752
  GroupingActivityContent,
8540
8753
  InfoWithText,
8541
8754
  InputGroup,
8755
+ InputWithSpecialExpression,
8542
8756
  MCMAActivityContent,
8543
8757
  MCSAActivityContent,
8544
8758
  MatchingActivityContent,
@@ -8565,6 +8779,9 @@ var retrieveTokenUsageSubTypeOptionList = () => {
8565
8779
  constructActivityAnswerMap,
8566
8780
  constructActivityAnswerStateList,
8567
8781
  constructActivityData,
8782
+ constructActivityItemListBodyOnly,
8783
+ constructActivityItemListMaterialOnly,
8784
+ constructActivityItemListSolutionOnly,
8568
8785
  constructActivityItemListWithAnswersForAI,
8569
8786
  constructActivityItemListWithSolutionForAI,
8570
8787
  constructAnswerBasedOnData,
package/dist/index.mjs CHANGED
@@ -2479,6 +2479,191 @@ var constructAnswerBasedOnData = (data) => {
2479
2479
  }
2480
2480
  return answer;
2481
2481
  };
2482
+ var constructActivityItemListBodyOnly = (bodyMap) => {
2483
+ const itemList = [];
2484
+ Object.keys(bodyMap).forEach((key) => {
2485
+ const bodyItem = JSON.parse(bodyMap[key]);
2486
+ if (bodyItem.type === "IMAGE") {
2487
+ itemList.push({
2488
+ type: "image_url",
2489
+ imageUrl: bodyItem.value
2490
+ });
2491
+ } else {
2492
+ itemList.push({
2493
+ type: "text",
2494
+ text: bodyItem.value
2495
+ });
2496
+ }
2497
+ });
2498
+ return itemList;
2499
+ };
2500
+ var constructActivityItemListMaterialOnly = (materialMap, type) => {
2501
+ const itemList = [];
2502
+ if (type === "ORDERING") {
2503
+ if (Object.keys(materialMap).length > 0) {
2504
+ itemList.push({
2505
+ type: "text",
2506
+ text: `${i18n_default.t("correct_order")}: `
2507
+ });
2508
+ Object.keys(materialMap).forEach((key) => {
2509
+ itemList.push({
2510
+ type: "text",
2511
+ text: materialMap[key]
2512
+ });
2513
+ });
2514
+ }
2515
+ } else if (type === "DROPDOWN") {
2516
+ if (Object.keys(materialMap).length > 0) {
2517
+ itemList.push({
2518
+ type: "text",
2519
+ text: `${i18n_default.t("correct_blanks")}: `
2520
+ });
2521
+ Object.keys(materialMap).forEach((key, index) => {
2522
+ itemList.push({
2523
+ type: "text",
2524
+ text: `${index + 1}. ${Object.keys(materialMap[key])[0]}`
2525
+ });
2526
+ });
2527
+ }
2528
+ } else if (type === "MCSA") {
2529
+ if (Object.keys(materialMap).length > 0) {
2530
+ itemList.push({
2531
+ type: "text",
2532
+ text: `${i18n_default.t("correct_answer")}: `
2533
+ });
2534
+ Object.keys(materialMap).forEach((key) => {
2535
+ itemList.push({
2536
+ type: "text",
2537
+ text: key
2538
+ });
2539
+ });
2540
+ }
2541
+ } else if (type === "MCMA") {
2542
+ if (Object.keys(materialMap).length > 0) {
2543
+ itemList.push({
2544
+ type: "text",
2545
+ text: `${i18n_default.t("correct_answers")}: `
2546
+ });
2547
+ const splittedTextList = Object.keys(materialMap)[0].split("\xA7");
2548
+ splittedTextList.forEach((item) => {
2549
+ const parsedItemList = JSON.parse(item);
2550
+ for (const parsedItem of parsedItemList) {
2551
+ itemList.push({
2552
+ type: "text",
2553
+ text: parsedItem
2554
+ });
2555
+ }
2556
+ });
2557
+ }
2558
+ } else if (type === "MATCHING") {
2559
+ if (Object.keys(materialMap).length > 0) {
2560
+ itemList.push({
2561
+ type: "text",
2562
+ text: `${i18n_default.t("correct_answers")}: `
2563
+ });
2564
+ Object.keys(materialMap).forEach((key, index) => {
2565
+ itemList.push({
2566
+ type: "text",
2567
+ text: `${i18n_default.t("match")} ${index + 1}:`
2568
+ });
2569
+ itemList.push({
2570
+ type: "text",
2571
+ text: `${key}: ${materialMap[key]}`
2572
+ });
2573
+ });
2574
+ }
2575
+ } else if (type === "GROUPING") {
2576
+ if (Object.keys(materialMap).length > 0) {
2577
+ itemList.push({
2578
+ type: "text",
2579
+ text: `${i18n_default.t("correct_answers")}: `
2580
+ });
2581
+ Object.keys(materialMap).forEach((key, index) => {
2582
+ let text = `${i18n_default.t("group")} ${index + 1}: `;
2583
+ itemList.push({
2584
+ type: "text",
2585
+ text
2586
+ });
2587
+ const groupName = key;
2588
+ let currentText = "";
2589
+ materialMap[groupName].forEach((item) => {
2590
+ currentText += `${item}, `;
2591
+ });
2592
+ currentText = currentText.substring(0, currentText.length - 2);
2593
+ itemList.push({
2594
+ type: "text",
2595
+ text: `${groupName}: [${currentText}]`
2596
+ });
2597
+ });
2598
+ }
2599
+ } else if (type === "FILL_IN_THE_BLANKS") {
2600
+ if (Object.keys(materialMap).length > 0) {
2601
+ itemList.push({
2602
+ type: "text",
2603
+ text: `${i18n_default.t("correct_blanks")}: `
2604
+ });
2605
+ Object.keys(materialMap).forEach((key, index) => {
2606
+ JSON.parse(materialMap[key]).forEach((item) => {
2607
+ itemList.push({
2608
+ type: "text",
2609
+ text: `${index + 1}. ${item}`
2610
+ });
2611
+ });
2612
+ });
2613
+ }
2614
+ } else if (type === "OPEN_ENDED") {
2615
+ } else if (type === "TRUE_FALSE") {
2616
+ if (materialMap.trueList) {
2617
+ materialMap.trueList = JSON.parse(materialMap.trueList);
2618
+ if (Object.keys(materialMap.trueList).length > 0) {
2619
+ itemList.push({
2620
+ type: "text",
2621
+ text: `${i18n_default.t("correct_answers")}: `
2622
+ });
2623
+ materialMap.trueList.forEach((item) => {
2624
+ itemList.push({
2625
+ type: "text",
2626
+ text: item
2627
+ });
2628
+ });
2629
+ }
2630
+ }
2631
+ if (materialMap.falseList) {
2632
+ materialMap.falseList = JSON.parse(materialMap.falseList);
2633
+ if (Object.keys(materialMap.falseList).length > 0) {
2634
+ itemList.push({
2635
+ type: "text",
2636
+ text: `${i18n_default.t("incorrect_answers")}: `
2637
+ });
2638
+ materialMap.falseList.forEach((item) => {
2639
+ itemList.push({
2640
+ type: "text",
2641
+ text: item
2642
+ });
2643
+ });
2644
+ }
2645
+ }
2646
+ }
2647
+ return itemList;
2648
+ };
2649
+ var constructActivityItemListSolutionOnly = (solutionMap) => {
2650
+ const itemList = [];
2651
+ Object.keys(solutionMap).forEach((key) => {
2652
+ const bodyItem = JSON.parse(solutionMap[key]);
2653
+ if (bodyItem.type === "IMAGE") {
2654
+ itemList.push({
2655
+ type: "image_url",
2656
+ imageUrl: bodyItem.value
2657
+ });
2658
+ } else {
2659
+ itemList.push({
2660
+ type: "text",
2661
+ text: bodyItem.value
2662
+ });
2663
+ }
2664
+ });
2665
+ return itemList;
2666
+ };
2482
2667
 
2483
2668
  // src/components/dividers/DividerLine.tsx
2484
2669
  import { jsx as jsx11 } from "react/jsx-runtime";
@@ -6249,6 +6434,30 @@ var InfoWithText = (props) => {
6249
6434
  };
6250
6435
  var InfoWithText_default = InfoWithText;
6251
6436
 
6437
+ // src/components/texts/InputWithSpecialExpression.tsx
6438
+ import { InlineMath as InlineMath12 } from "react-katex";
6439
+ import { jsx as jsx54 } from "react/jsx-runtime";
6440
+ var InputWithSpecialExpression = ({
6441
+ value,
6442
+ showSpecialOnly
6443
+ }) => {
6444
+ const inputWithSpecialExpressionList = constructInputWithSpecialExpressionList(value);
6445
+ return showSpecialOnly ? inputWithSpecialExpressionList.length > 1 ? /* @__PURE__ */ jsx54("div", { className: "m-2", children: /* @__PURE__ */ jsx54("span", { className: "whitespace-pre-wrap", children: inputWithSpecialExpressionList.map((inputPart, index) => /* @__PURE__ */ jsx54(
6446
+ "span",
6447
+ {
6448
+ className: `${inputPart.isBold ? "font-semibold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
6449
+ children: inputPart.isEquation ? /* @__PURE__ */ jsx54("span", { className: "text-lg", children: /* @__PURE__ */ jsx54(InlineMath12, { math: inputPart.value }, index) }) : inputPart.value
6450
+ }
6451
+ )) }) }) : null : /* @__PURE__ */ jsx54("div", { className: "m-2", children: /* @__PURE__ */ jsx54("span", { className: "whitespace-pre-wrap", children: inputWithSpecialExpressionList.map((inputPart, index) => /* @__PURE__ */ jsx54(
6452
+ "span",
6453
+ {
6454
+ className: `${inputPart.isBold ? "font-semibold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
6455
+ children: inputPart.isEquation ? /* @__PURE__ */ jsx54("span", { className: "text-lg", children: /* @__PURE__ */ jsx54(InlineMath12, { math: inputPart.value }, index) }) : inputPart.value
6456
+ }
6457
+ )) }) });
6458
+ };
6459
+ var InputWithSpecialExpression_default = InputWithSpecialExpression;
6460
+
6252
6461
  // src/utilization/AuthorizationUtilization.ts
6253
6462
  var parseJwt = (token) => {
6254
6463
  var base64Url = token.split(".")[1];
@@ -8363,6 +8572,7 @@ export {
8363
8572
  GroupingActivityContent_default as GroupingActivityContent,
8364
8573
  InfoWithText_default as InfoWithText,
8365
8574
  InputGroup_default as InputGroup,
8575
+ InputWithSpecialExpression_default as InputWithSpecialExpression,
8366
8576
  MCMAActivityContent_default as MCMAActivityContent,
8367
8577
  MCSAActivityContent_default as MCSAActivityContent,
8368
8578
  MatchingActivityContent_default as MatchingActivityContent,
@@ -8389,6 +8599,9 @@ export {
8389
8599
  constructActivityAnswerMap,
8390
8600
  constructActivityAnswerStateList,
8391
8601
  constructActivityData,
8602
+ constructActivityItemListBodyOnly,
8603
+ constructActivityItemListMaterialOnly,
8604
+ constructActivityItemListSolutionOnly,
8392
8605
  constructActivityItemListWithAnswersForAI,
8393
8606
  constructActivityItemListWithSolutionForAI,
8394
8607
  constructAnswerBasedOnData,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catchup-library-web",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -0,0 +1,57 @@
1
+ import { InlineMath } from "react-katex";
2
+ import { constructInputWithSpecialExpressionList } from "../../utilization/CatchtivityUtilization";
3
+ import { IInputWithSpecialExpressionProps } from "../../properties/TextProperties";
4
+
5
+ const InputWithSpecialExpression = ({
6
+ value,
7
+ showSpecialOnly,
8
+ }: IInputWithSpecialExpressionProps) => {
9
+ const inputWithSpecialExpressionList =
10
+ constructInputWithSpecialExpressionList(value);
11
+
12
+ return showSpecialOnly ? (
13
+ inputWithSpecialExpressionList.length > 1 ? (
14
+ <div className="m-2">
15
+ <span className="whitespace-pre-wrap">
16
+ {inputWithSpecialExpressionList.map((inputPart, index) => (
17
+ <span
18
+ className={`${inputPart.isBold ? "font-semibold" : ""} ${
19
+ inputPart.isUnderline ? "underline" : ""
20
+ }`}
21
+ >
22
+ {inputPart.isEquation ? (
23
+ <span className="text-lg">
24
+ <InlineMath key={index} math={inputPart.value} />
25
+ </span>
26
+ ) : (
27
+ inputPart.value
28
+ )}
29
+ </span>
30
+ ))}
31
+ </span>
32
+ </div>
33
+ ) : null
34
+ ) : (
35
+ <div className="m-2">
36
+ <span className="whitespace-pre-wrap">
37
+ {inputWithSpecialExpressionList.map((inputPart, index) => (
38
+ <span
39
+ className={`${inputPart.isBold ? "font-semibold" : ""} ${
40
+ inputPart.isUnderline ? "underline" : ""
41
+ }`}
42
+ >
43
+ {inputPart.isEquation ? (
44
+ <span className="text-lg">
45
+ <InlineMath key={index} math={inputPart.value} />
46
+ </span>
47
+ ) : (
48
+ inputPart.value
49
+ )}
50
+ </span>
51
+ ))}
52
+ </span>
53
+ </div>
54
+ );
55
+ };
56
+
57
+ export default InputWithSpecialExpression;
package/src/index.ts CHANGED
@@ -47,6 +47,8 @@ export { default as PublishingHouseLabel } from "./components/labels/PublishingH
47
47
 
48
48
  export { default as InfoWithText } from "./components/infos/InfoWithText";
49
49
 
50
+ export { default as InputWithSpecialExpression } from "./components/texts/InputWithSpecialExpression";
51
+
50
52
  export { default as i18n } from "./language/i18n";
51
53
 
52
54
  export * from "./utilization/AppUtilization";
@@ -0,0 +1,4 @@
1
+ export interface IInputWithSpecialExpressionProps {
2
+ value: string;
3
+ showSpecialOnly: boolean;
4
+ }
@@ -1967,3 +1967,197 @@ export const constructAnswerBasedOnData = (data: any) => {
1967
1967
  }
1968
1968
  return answer;
1969
1969
  };
1970
+
1971
+ export const constructActivityItemListBodyOnly = (bodyMap: any) => {
1972
+ const itemList: any = [];
1973
+ Object.keys(bodyMap).forEach((key) => {
1974
+ const bodyItem = JSON.parse(bodyMap[key]);
1975
+ if (bodyItem.type === "IMAGE") {
1976
+ itemList.push({
1977
+ type: "image_url",
1978
+ imageUrl: bodyItem.value,
1979
+ });
1980
+ } else {
1981
+ itemList.push({
1982
+ type: "text",
1983
+ text: bodyItem.value,
1984
+ });
1985
+ }
1986
+ });
1987
+ return itemList;
1988
+ };
1989
+
1990
+ export const constructActivityItemListMaterialOnly = (
1991
+ materialMap: any,
1992
+ type: string
1993
+ ) => {
1994
+ const itemList = [];
1995
+ if (type === "ORDERING") {
1996
+ if (Object.keys(materialMap).length > 0) {
1997
+ itemList.push({
1998
+ type: "text",
1999
+ text: `${i18n.t("correct_order")}: `,
2000
+ });
2001
+ Object.keys(materialMap).forEach((key) => {
2002
+ itemList.push({
2003
+ type: "text",
2004
+ text: materialMap[key],
2005
+ });
2006
+ });
2007
+ }
2008
+ } else if (type === "DROPDOWN") {
2009
+ if (Object.keys(materialMap).length > 0) {
2010
+ itemList.push({
2011
+ type: "text",
2012
+ text: `${i18n.t("correct_blanks")}: `,
2013
+ });
2014
+ Object.keys(materialMap).forEach((key, index) => {
2015
+ itemList.push({
2016
+ type: "text",
2017
+ text: `${index + 1}. ${Object.keys(materialMap[key])[0]}`,
2018
+ });
2019
+ });
2020
+ }
2021
+ } else if (type === "MCSA") {
2022
+ if (Object.keys(materialMap).length > 0) {
2023
+ itemList.push({
2024
+ type: "text",
2025
+ text: `${i18n.t("correct_answer")}: `,
2026
+ });
2027
+ Object.keys(materialMap).forEach((key) => {
2028
+ itemList.push({
2029
+ type: "text",
2030
+ text: key,
2031
+ });
2032
+ });
2033
+ }
2034
+ } else if (type === "MCMA") {
2035
+ if (Object.keys(materialMap).length > 0) {
2036
+ itemList.push({
2037
+ type: "text",
2038
+ text: `${i18n.t("correct_answers")}: `,
2039
+ });
2040
+ const splittedTextList = Object.keys(materialMap)[0].split("§");
2041
+ splittedTextList.forEach((item) => {
2042
+ const parsedItemList = JSON.parse(item);
2043
+ for (const parsedItem of parsedItemList) {
2044
+ itemList.push({
2045
+ type: "text",
2046
+ text: parsedItem,
2047
+ });
2048
+ }
2049
+ });
2050
+ }
2051
+ } else if (type === "MATCHING") {
2052
+ if (Object.keys(materialMap).length > 0) {
2053
+ itemList.push({
2054
+ type: "text",
2055
+ text: `${i18n.t("correct_answers")}: `,
2056
+ });
2057
+ Object.keys(materialMap).forEach((key, index) => {
2058
+ itemList.push({
2059
+ type: "text",
2060
+ text: `${i18n.t("match")} ${index + 1}:`,
2061
+ });
2062
+ itemList.push({
2063
+ type: "text",
2064
+ text: `${key}: ${materialMap[key]}`,
2065
+ });
2066
+ });
2067
+ }
2068
+ } else if (type === "GROUPING") {
2069
+ if (Object.keys(materialMap).length > 0) {
2070
+ itemList.push({
2071
+ type: "text",
2072
+ text: `${i18n.t("correct_answers")}: `,
2073
+ });
2074
+ Object.keys(materialMap).forEach((key, index) => {
2075
+ let text = `${i18n.t("group")} ${index + 1}: `;
2076
+ itemList.push({
2077
+ type: "text",
2078
+ text: text,
2079
+ });
2080
+
2081
+ const groupName = key;
2082
+ let currentText = "";
2083
+ materialMap[groupName].forEach((item: string) => {
2084
+ currentText += `${item}, `;
2085
+ });
2086
+ currentText = currentText.substring(0, currentText.length - 2);
2087
+ itemList.push({
2088
+ type: "text",
2089
+ text: `${groupName}: [${currentText}]`,
2090
+ });
2091
+ });
2092
+ }
2093
+ } else if (type === "FILL_IN_THE_BLANKS") {
2094
+ if (Object.keys(materialMap).length > 0) {
2095
+ itemList.push({
2096
+ type: "text",
2097
+ text: `${i18n.t("correct_blanks")}: `,
2098
+ });
2099
+ Object.keys(materialMap).forEach((key, index) => {
2100
+ JSON.parse(materialMap[key]).forEach((item: string) => {
2101
+ itemList.push({
2102
+ type: "text",
2103
+ text: `${index + 1}. ${item}`,
2104
+ });
2105
+ });
2106
+ });
2107
+ }
2108
+ } else if (type === "OPEN_ENDED") {
2109
+ } else if (type === "TRUE_FALSE") {
2110
+ if (materialMap.trueList) {
2111
+ materialMap.trueList = JSON.parse(materialMap.trueList);
2112
+ if (Object.keys(materialMap.trueList).length > 0) {
2113
+ itemList.push({
2114
+ type: "text",
2115
+ text: `${i18n.t("correct_answers")}: `,
2116
+ });
2117
+ materialMap.trueList.forEach((item: string) => {
2118
+ itemList.push({
2119
+ type: "text",
2120
+ text: item,
2121
+ });
2122
+ });
2123
+ }
2124
+ }
2125
+
2126
+ if (materialMap.falseList) {
2127
+ materialMap.falseList = JSON.parse(materialMap.falseList);
2128
+ if (Object.keys(materialMap.falseList).length > 0) {
2129
+ itemList.push({
2130
+ type: "text",
2131
+ text: `${i18n.t("incorrect_answers")}: `,
2132
+ });
2133
+ materialMap.falseList.forEach((item: string) => {
2134
+ itemList.push({
2135
+ type: "text",
2136
+ text: item,
2137
+ });
2138
+ });
2139
+ }
2140
+ }
2141
+ }
2142
+
2143
+ return itemList;
2144
+ };
2145
+
2146
+ export const constructActivityItemListSolutionOnly = (solutionMap: any) => {
2147
+ const itemList: any = [];
2148
+ Object.keys(solutionMap).forEach((key) => {
2149
+ const bodyItem = JSON.parse(solutionMap[key]);
2150
+ if (bodyItem.type === "IMAGE") {
2151
+ itemList.push({
2152
+ type: "image_url",
2153
+ imageUrl: bodyItem.value,
2154
+ });
2155
+ } else {
2156
+ itemList.push({
2157
+ type: "text",
2158
+ text: bodyItem.value,
2159
+ });
2160
+ }
2161
+ });
2162
+ return itemList;
2163
+ };