catchup-library-web 1.2.1 → 1.2.2
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 +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +191 -0
- package/dist/index.mjs +188 -0
- package/package.json +1 -1
- package/src/utilization/CatchtivityUtilization.ts +194 -0
package/dist/index.d.mts
CHANGED
|
@@ -412,6 +412,12 @@ declare const convertToSolutionMapString: (type: string, solutionMap: any) => an
|
|
|
412
412
|
declare const convertToEvaluationRubricMapString: (type: string, evaluationRubricMap: any) => any;
|
|
413
413
|
declare const constructActivityData: (activityTemplateType: string, contentMap: any, bodyMap: any, materialMap: any, solutionMap: any, taxonomyMap: any, evaluationRubricMap: any) => any;
|
|
414
414
|
declare const constructAnswerBasedOnData: (data: any) => any;
|
|
415
|
+
declare const constructActivityItemListBodyOnly: (bodyMap: any) => any;
|
|
416
|
+
declare const constructActivityItemListMaterialOnly: (materialMap: any, type: string) => {
|
|
417
|
+
type: string;
|
|
418
|
+
text: string;
|
|
419
|
+
}[];
|
|
420
|
+
declare const constructActivityItemListSolutionOnly: (solutionMap: any) => any;
|
|
415
421
|
|
|
416
422
|
declare const retrieveCategoryVersionCodeOptionList: () => {
|
|
417
423
|
value: string;
|
|
@@ -638,4 +644,4 @@ declare const retrieveTokenUsageSubTypeOptionList: () => {
|
|
|
638
644
|
value: string;
|
|
639
645
|
}[];
|
|
640
646
|
|
|
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 };
|
|
647
|
+
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, 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
|
@@ -412,6 +412,12 @@ declare const convertToSolutionMapString: (type: string, solutionMap: any) => an
|
|
|
412
412
|
declare const convertToEvaluationRubricMapString: (type: string, evaluationRubricMap: any) => any;
|
|
413
413
|
declare const constructActivityData: (activityTemplateType: string, contentMap: any, bodyMap: any, materialMap: any, solutionMap: any, taxonomyMap: any, evaluationRubricMap: any) => any;
|
|
414
414
|
declare const constructAnswerBasedOnData: (data: any) => any;
|
|
415
|
+
declare const constructActivityItemListBodyOnly: (bodyMap: any) => any;
|
|
416
|
+
declare const constructActivityItemListMaterialOnly: (materialMap: any, type: string) => {
|
|
417
|
+
type: string;
|
|
418
|
+
text: string;
|
|
419
|
+
}[];
|
|
420
|
+
declare const constructActivityItemListSolutionOnly: (solutionMap: any) => any;
|
|
415
421
|
|
|
416
422
|
declare const retrieveCategoryVersionCodeOptionList: () => {
|
|
417
423
|
value: string;
|
|
@@ -638,4 +644,4 @@ declare const retrieveTokenUsageSubTypeOptionList: () => {
|
|
|
638
644
|
value: string;
|
|
639
645
|
}[];
|
|
640
646
|
|
|
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 };
|
|
647
|
+
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, 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
|
@@ -114,6 +114,9 @@ __export(index_exports, {
|
|
|
114
114
|
constructActivityAnswerMap: () => constructActivityAnswerMap,
|
|
115
115
|
constructActivityAnswerStateList: () => constructActivityAnswerStateList,
|
|
116
116
|
constructActivityData: () => constructActivityData,
|
|
117
|
+
constructActivityItemListBodyOnly: () => constructActivityItemListBodyOnly,
|
|
118
|
+
constructActivityItemListMaterialOnly: () => constructActivityItemListMaterialOnly,
|
|
119
|
+
constructActivityItemListSolutionOnly: () => constructActivityItemListSolutionOnly,
|
|
117
120
|
constructActivityItemListWithAnswersForAI: () => constructActivityItemListWithAnswersForAI,
|
|
118
121
|
constructActivityItemListWithSolutionForAI: () => constructActivityItemListWithSolutionForAI,
|
|
119
122
|
constructAnswerBasedOnData: () => constructAnswerBasedOnData,
|
|
@@ -2654,6 +2657,191 @@ var constructAnswerBasedOnData = (data) => {
|
|
|
2654
2657
|
}
|
|
2655
2658
|
return answer;
|
|
2656
2659
|
};
|
|
2660
|
+
var constructActivityItemListBodyOnly = (bodyMap) => {
|
|
2661
|
+
const itemList = [];
|
|
2662
|
+
Object.keys(bodyMap).forEach((key) => {
|
|
2663
|
+
const bodyItem = JSON.parse(bodyMap[key]);
|
|
2664
|
+
if (bodyItem.type === "IMAGE") {
|
|
2665
|
+
itemList.push({
|
|
2666
|
+
type: "image_url",
|
|
2667
|
+
imageUrl: bodyItem.value
|
|
2668
|
+
});
|
|
2669
|
+
} else {
|
|
2670
|
+
itemList.push({
|
|
2671
|
+
type: "text",
|
|
2672
|
+
text: bodyItem.value
|
|
2673
|
+
});
|
|
2674
|
+
}
|
|
2675
|
+
});
|
|
2676
|
+
return itemList;
|
|
2677
|
+
};
|
|
2678
|
+
var constructActivityItemListMaterialOnly = (materialMap, type) => {
|
|
2679
|
+
const itemList = [];
|
|
2680
|
+
if (type === "ORDERING") {
|
|
2681
|
+
if (Object.keys(materialMap).length > 0) {
|
|
2682
|
+
itemList.push({
|
|
2683
|
+
type: "text",
|
|
2684
|
+
text: `${i18n_default.t("correct_order")}: `
|
|
2685
|
+
});
|
|
2686
|
+
Object.keys(materialMap).forEach((key) => {
|
|
2687
|
+
itemList.push({
|
|
2688
|
+
type: "text",
|
|
2689
|
+
text: materialMap[key]
|
|
2690
|
+
});
|
|
2691
|
+
});
|
|
2692
|
+
}
|
|
2693
|
+
} else if (type === "DROPDOWN") {
|
|
2694
|
+
if (Object.keys(materialMap).length > 0) {
|
|
2695
|
+
itemList.push({
|
|
2696
|
+
type: "text",
|
|
2697
|
+
text: `${i18n_default.t("correct_blanks")}: `
|
|
2698
|
+
});
|
|
2699
|
+
Object.keys(materialMap).forEach((key, index) => {
|
|
2700
|
+
itemList.push({
|
|
2701
|
+
type: "text",
|
|
2702
|
+
text: `${index + 1}. ${Object.keys(materialMap[key])[0]}`
|
|
2703
|
+
});
|
|
2704
|
+
});
|
|
2705
|
+
}
|
|
2706
|
+
} else if (type === "MCSA") {
|
|
2707
|
+
if (Object.keys(materialMap).length > 0) {
|
|
2708
|
+
itemList.push({
|
|
2709
|
+
type: "text",
|
|
2710
|
+
text: `${i18n_default.t("correct_answer")}: `
|
|
2711
|
+
});
|
|
2712
|
+
Object.keys(materialMap).forEach((key) => {
|
|
2713
|
+
itemList.push({
|
|
2714
|
+
type: "text",
|
|
2715
|
+
text: key
|
|
2716
|
+
});
|
|
2717
|
+
});
|
|
2718
|
+
}
|
|
2719
|
+
} else if (type === "MCMA") {
|
|
2720
|
+
if (Object.keys(materialMap).length > 0) {
|
|
2721
|
+
itemList.push({
|
|
2722
|
+
type: "text",
|
|
2723
|
+
text: `${i18n_default.t("correct_answers")}: `
|
|
2724
|
+
});
|
|
2725
|
+
const splittedTextList = Object.keys(materialMap)[0].split("\xA7");
|
|
2726
|
+
splittedTextList.forEach((item) => {
|
|
2727
|
+
const parsedItemList = JSON.parse(item);
|
|
2728
|
+
for (const parsedItem of parsedItemList) {
|
|
2729
|
+
itemList.push({
|
|
2730
|
+
type: "text",
|
|
2731
|
+
text: parsedItem
|
|
2732
|
+
});
|
|
2733
|
+
}
|
|
2734
|
+
});
|
|
2735
|
+
}
|
|
2736
|
+
} else if (type === "MATCHING") {
|
|
2737
|
+
if (Object.keys(materialMap).length > 0) {
|
|
2738
|
+
itemList.push({
|
|
2739
|
+
type: "text",
|
|
2740
|
+
text: `${i18n_default.t("correct_answers")}: `
|
|
2741
|
+
});
|
|
2742
|
+
Object.keys(materialMap).forEach((key, index) => {
|
|
2743
|
+
itemList.push({
|
|
2744
|
+
type: "text",
|
|
2745
|
+
text: `${i18n_default.t("match")} ${index + 1}:`
|
|
2746
|
+
});
|
|
2747
|
+
itemList.push({
|
|
2748
|
+
type: "text",
|
|
2749
|
+
text: `${key}: ${materialMap[key]}`
|
|
2750
|
+
});
|
|
2751
|
+
});
|
|
2752
|
+
}
|
|
2753
|
+
} else if (type === "GROUPING") {
|
|
2754
|
+
if (Object.keys(materialMap).length > 0) {
|
|
2755
|
+
itemList.push({
|
|
2756
|
+
type: "text",
|
|
2757
|
+
text: `${i18n_default.t("correct_answers")}: `
|
|
2758
|
+
});
|
|
2759
|
+
Object.keys(materialMap).forEach((key, index) => {
|
|
2760
|
+
let text = `${i18n_default.t("group")} ${index + 1}: `;
|
|
2761
|
+
itemList.push({
|
|
2762
|
+
type: "text",
|
|
2763
|
+
text
|
|
2764
|
+
});
|
|
2765
|
+
const groupName = key;
|
|
2766
|
+
let currentText = "";
|
|
2767
|
+
materialMap[groupName].forEach((item) => {
|
|
2768
|
+
currentText += `${item}, `;
|
|
2769
|
+
});
|
|
2770
|
+
currentText = currentText.substring(0, currentText.length - 2);
|
|
2771
|
+
itemList.push({
|
|
2772
|
+
type: "text",
|
|
2773
|
+
text: `${groupName}: [${currentText}]`
|
|
2774
|
+
});
|
|
2775
|
+
});
|
|
2776
|
+
}
|
|
2777
|
+
} else if (type === "FILL_IN_THE_BLANKS") {
|
|
2778
|
+
if (Object.keys(materialMap).length > 0) {
|
|
2779
|
+
itemList.push({
|
|
2780
|
+
type: "text",
|
|
2781
|
+
text: `${i18n_default.t("correct_blanks")}: `
|
|
2782
|
+
});
|
|
2783
|
+
Object.keys(materialMap).forEach((key, index) => {
|
|
2784
|
+
JSON.parse(materialMap[key]).forEach((item) => {
|
|
2785
|
+
itemList.push({
|
|
2786
|
+
type: "text",
|
|
2787
|
+
text: `${index + 1}. ${item}`
|
|
2788
|
+
});
|
|
2789
|
+
});
|
|
2790
|
+
});
|
|
2791
|
+
}
|
|
2792
|
+
} else if (type === "OPEN_ENDED") {
|
|
2793
|
+
} else if (type === "TRUE_FALSE") {
|
|
2794
|
+
if (materialMap.trueList) {
|
|
2795
|
+
materialMap.trueList = JSON.parse(materialMap.trueList);
|
|
2796
|
+
if (Object.keys(materialMap.trueList).length > 0) {
|
|
2797
|
+
itemList.push({
|
|
2798
|
+
type: "text",
|
|
2799
|
+
text: `${i18n_default.t("correct_answers")}: `
|
|
2800
|
+
});
|
|
2801
|
+
materialMap.trueList.forEach((item) => {
|
|
2802
|
+
itemList.push({
|
|
2803
|
+
type: "text",
|
|
2804
|
+
text: item
|
|
2805
|
+
});
|
|
2806
|
+
});
|
|
2807
|
+
}
|
|
2808
|
+
}
|
|
2809
|
+
if (materialMap.falseList) {
|
|
2810
|
+
materialMap.falseList = JSON.parse(materialMap.falseList);
|
|
2811
|
+
if (Object.keys(materialMap.falseList).length > 0) {
|
|
2812
|
+
itemList.push({
|
|
2813
|
+
type: "text",
|
|
2814
|
+
text: `${i18n_default.t("incorrect_answers")}: `
|
|
2815
|
+
});
|
|
2816
|
+
materialMap.falseList.forEach((item) => {
|
|
2817
|
+
itemList.push({
|
|
2818
|
+
type: "text",
|
|
2819
|
+
text: item
|
|
2820
|
+
});
|
|
2821
|
+
});
|
|
2822
|
+
}
|
|
2823
|
+
}
|
|
2824
|
+
}
|
|
2825
|
+
return itemList;
|
|
2826
|
+
};
|
|
2827
|
+
var constructActivityItemListSolutionOnly = (solutionMap) => {
|
|
2828
|
+
const itemList = [];
|
|
2829
|
+
Object.keys(solutionMap).forEach((key) => {
|
|
2830
|
+
const bodyItem = JSON.parse(solutionMap[key]);
|
|
2831
|
+
if (bodyItem.type === "IMAGE") {
|
|
2832
|
+
itemList.push({
|
|
2833
|
+
type: "image_url",
|
|
2834
|
+
imageUrl: bodyItem.value
|
|
2835
|
+
});
|
|
2836
|
+
} else {
|
|
2837
|
+
itemList.push({
|
|
2838
|
+
type: "text",
|
|
2839
|
+
text: bodyItem.value
|
|
2840
|
+
});
|
|
2841
|
+
}
|
|
2842
|
+
});
|
|
2843
|
+
return itemList;
|
|
2844
|
+
};
|
|
2657
2845
|
|
|
2658
2846
|
// src/components/dividers/DividerLine.tsx
|
|
2659
2847
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
@@ -8565,6 +8753,9 @@ var retrieveTokenUsageSubTypeOptionList = () => {
|
|
|
8565
8753
|
constructActivityAnswerMap,
|
|
8566
8754
|
constructActivityAnswerStateList,
|
|
8567
8755
|
constructActivityData,
|
|
8756
|
+
constructActivityItemListBodyOnly,
|
|
8757
|
+
constructActivityItemListMaterialOnly,
|
|
8758
|
+
constructActivityItemListSolutionOnly,
|
|
8568
8759
|
constructActivityItemListWithAnswersForAI,
|
|
8569
8760
|
constructActivityItemListWithSolutionForAI,
|
|
8570
8761
|
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";
|
|
@@ -8389,6 +8574,9 @@ export {
|
|
|
8389
8574
|
constructActivityAnswerMap,
|
|
8390
8575
|
constructActivityAnswerStateList,
|
|
8391
8576
|
constructActivityData,
|
|
8577
|
+
constructActivityItemListBodyOnly,
|
|
8578
|
+
constructActivityItemListMaterialOnly,
|
|
8579
|
+
constructActivityItemListSolutionOnly,
|
|
8392
8580
|
constructActivityItemListWithAnswersForAI,
|
|
8393
8581
|
constructActivityItemListWithSolutionForAI,
|
|
8394
8582
|
constructAnswerBasedOnData,
|
package/package.json
CHANGED
|
@@ -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
|
+
};
|