catchup-library-web 2.0.8 → 2.0.10
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 +4 -5
- package/dist/index.d.ts +4 -5
- package/dist/index.js +5 -65
- package/dist/index.mjs +5 -64
- package/package.json +1 -1
- package/src/utilization/CatchtivityUtilization.ts +9 -74
package/dist/index.d.mts
CHANGED
|
@@ -566,10 +566,9 @@ declare const retrieveActivityTemplateDTOOptionList: (activityTemplateSet: any)
|
|
|
566
566
|
declare const retrieveCurrentDefaultDataMap: (activityTemplateType: any, activityData: any) => any;
|
|
567
567
|
declare const constructActivityAnswerMap: (activityTemplate: any, activityData: any) => any;
|
|
568
568
|
declare const ignoreMathematicalExpression: (inputText: string) => string;
|
|
569
|
-
declare const
|
|
570
|
-
declare const
|
|
571
|
-
declare const
|
|
572
|
-
declare const checkActivityAnswerState: (answerList: any, activity: any) => "NOT_EXISTS" | "ANSWERED" | "EMPTY";
|
|
569
|
+
declare const constructActivityAnswerStateList: (answerList: any[], activityList: any[]) => any;
|
|
570
|
+
declare const retrieveActivityAnswerFromAnswerList: (answerList: any[], activity: any) => any;
|
|
571
|
+
declare const checkActivityAnswerState: (answerList: any[], activity: any) => "NOT_EXISTS" | "EMPTY" | "ANSWERED";
|
|
573
572
|
declare const findBestFitActivity: (activity: any, individualModelList: any, outcomeModelList: any) => {
|
|
574
573
|
bestScore: number;
|
|
575
574
|
bestActivityTemplate: any;
|
|
@@ -943,4 +942,4 @@ declare const retrieveActivityMethodologyOptionList: () => {
|
|
|
943
942
|
text: string;
|
|
944
943
|
}[];
|
|
945
944
|
|
|
946
|
-
export { ActivityBodyContent, ActivityEmptyContent, ActivityEvaluationRubricContent, ActivityLabel, ActivityPreviewByAnswerData, ActivityPreviewByData, ActivitySolutionContent, ActivityTemplateLabel, ApproveButton, BaseCard, BaseImage, BaseLoading, BaseLoadingWithText, BaseModal, BasePDF, BaseTitle, BlueVerticalDividerLine, BrandLabel, CancelButton, CategoryLabel, CoterieLabel, CreateButton, DeleteButton, DividerLine, DropdownActivityContent, FillInTheBlanksActivityContent, FullCard, GradeLabel, GroupingActivityContent, InfoWithText, InputGroup, InputWithSpecialExpression, LeftTextRightInputGroup, MCMAActivityContent, MCSAActivityContent, MatchingActivityContent, ONE_DAY, ONE_HOUR, ONE_MONTH, ONE_WEEK, OpenEndedActivityContent, OrderingActivityContent, OutcomeLabel, PageTravelGroup, PersonalLabel, PrimaryButton, ProgressBar, PublishingHouseLabel, ScoreBar, SecondaryButton, SelectionBox, SelectionCheckbox, SelectionTab, SelectionTabFill, StatusError, SubTitle, THREE_MONTHS, TimedProgressBar, TrueFalseActivityContent, VerticalDividerLine, base64ToFile, calculateEndDateOfWeek, calculateLevenshteinDistance, calculateStartDateOfWeek, checkActivityAnswerState,
|
|
945
|
+
export { ActivityBodyContent, ActivityEmptyContent, ActivityEvaluationRubricContent, ActivityLabel, ActivityPreviewByAnswerData, ActivityPreviewByData, ActivitySolutionContent, ActivityTemplateLabel, ApproveButton, BaseCard, BaseImage, BaseLoading, BaseLoadingWithText, BaseModal, BasePDF, BaseTitle, BlueVerticalDividerLine, BrandLabel, CancelButton, CategoryLabel, CoterieLabel, CreateButton, DeleteButton, DividerLine, DropdownActivityContent, FillInTheBlanksActivityContent, FullCard, GradeLabel, GroupingActivityContent, InfoWithText, InputGroup, InputWithSpecialExpression, LeftTextRightInputGroup, MCMAActivityContent, MCSAActivityContent, MatchingActivityContent, ONE_DAY, ONE_HOUR, ONE_MONTH, ONE_WEEK, OpenEndedActivityContent, OrderingActivityContent, OutcomeLabel, PageTravelGroup, PersonalLabel, PrimaryButton, ProgressBar, PublishingHouseLabel, ScoreBar, SecondaryButton, SelectionBox, SelectionCheckbox, SelectionTab, SelectionTabFill, StatusError, SubTitle, THREE_MONTHS, TimedProgressBar, TrueFalseActivityContent, VerticalDividerLine, base64ToFile, calculateEndDateOfWeek, calculateLevenshteinDistance, calculateStartDateOfWeek, checkActivityAnswerState, constructActivityAnswerMap, constructActivityAnswerStateList, constructActivityData, constructActivityItemListBodyOnly, constructActivityItemListForSolution, constructActivityItemListMaterialOnly, constructActivityItemListSolutionOnly, constructActivityItemListWithAnswersForAI, constructActivityItemListWithSolutionForAI, constructAnswerBasedOnData, constructBaseNumericIndividualModel, constructBaseVerbalIndvidualModel, constructCategoryTreeFromParentCode, constructCombinedCorporateAssessmentAssignmentReportMap, constructCombinedOutcomeActivityScoreMapFromCombinedReport, constructInputWithSpecialExpressionList, constructMonthName, constructOutcomeActivityScoreList, constructUserProfileQueryParams, constructWeekName, convertDataURLtoFile, convertToBase64, convertToBodyMapString, convertToEvaluationRubricMapString, convertToSolutionMapString, convertTurkishCharactersToEnglish, filterCategoryVersionCodeOptionList, filterCategoryVersionCodeOptionListByGradeDTO, filterCategoryVersionCodeOptionListByInstitutionDTO, filterCoterieTypeByDistinctOptionList, filterCoterieTypeOptionList, filterGradeLevelOptionList, filterUserRoleOptionList, findAISettingsFromCurrentProfile, findBestFitActivity, formatPriceWithCommas, getColorByIndex, ignoreMathematicalExpression, mergeObjects, parseBodyMapFromData, parseContentMapFromData, parseJwt, parseMaterialMapFromData, retrieveActivityAnswerFromAnswerList, retrieveActivityCountOptionList, retrieveActivityMethodologyOptionList, retrieveActivityTemplateDTOOptionList, retrieveAllEarnedBadgeDTOListByCoterieType, retrieveAllEarnedBadgeDTOListByCoterieTypeList, retrieveAnnouncementAudienceOptionList, retrieveAnnouncementTypeOptionList, retrieveBadgeRuleListByParams, retrieveBadgeRuleTextByParams, retrieveBranchDTOByUserProfileOptionList, retrieveBranchDTOOptionList, retrieveBrandDTOByUserProfileOptionList, retrieveBrandDTOOptionList, retrieveCampusDTOByUserProfileOptionList, retrieveCampusDTOOptionList, retrieveCategoryVersionCodeOptionList, retrieveClockTimeLeft, retrieveColorByScore, retrieveContentTypeOptionList, retrieveContestTypeOptionList, retrieveCoterieTypeFromStandardExamCoterieType, retrieveCoterieTypeOptionList, retrieveCountryCodeOptionList, retrieveCountryNameOptionList, retrieveCurrencyTypeOptionList, retrieveCurrentDefaultDataMap, retrieveDateIntervalOptionList, retrieveDefaultUserRoleOptionList, retrieveDelayTypeOptionList, retrieveDifficultyByActivityTypeFromData, retrieveDifficultyOptionList, retrieveDiscountAmountTypeOptionList, retrieveDistinctCoterieTypeFromCorporatePersonalizedAssignmentApplicationDTO, retrieveDocumentTypeFromAcceptedFormat, retrieveDocumentTypeFromExtension, retrieveDurationInMinutesOptionList, retrieveDurationInSecondsOptionList, retrieveDurationTypeOptionList, retrieveEachTimeSpentInSeconds, retrieveEnableOptionList, retrieveExternalRegistrationDTOOptionList, retrieveFrequencyTypeOptionList, retrieveGenderOptionList, retrieveGradeDTOByUserProfileOptionList, retrieveGradeDTOOptionList, retrieveGradeLevelOptionList, retrieveInstitutionDTOByUserProfileOptionList, retrieveInstitutionDTOOptionList, retrieveInstitutionTypeByLevel, retrieveInstitutionTypeOptionList, retrieveLastNOptionList, retrieveLeagueThresholdByLeagueType, retrieveLeagueThresholds, retrieveLeagueTypeOptionList, retrieveMonthNameByIndex, retrieveOpticalExamPartTypeOptionList, retrieveOpticalExamTypeOptionList, retrieveOtherBadgeDTOList, retrieveOutcomePlanTypeOptionList, retrievePhoneNumberAreaCodeList, retrieveProvinceNameOptionList, retrieveReportTypeOptionList, retrieveSeasonDTOByUserProfileOptionList, retrieveSeasonDTOOptionList, retrieveStandardExamCoterieTypeOptionListByStandardExamType, retrieveStandardExamTypeIcon, retrieveStandardExamTypeOptionList, retrieveStatusOptionList, retrieveTeachingMethodologyOptionList, retrieveTimeFilterOptionList, retrieveTimeFilterWithLastNOptionList, retrieveTokenUsageSubTypeOptionList, retrieveTokenUsageTypeOptionList, retrieveTotalTimeSpentInMinutes, retrieveTotalTimeSpentInSeconds, retrieveUserAuthorityGeneralOptionList, retrieveUserRoleOptionList, retrieveValidationRequirementList, shuffleArray, useScreenSize };
|
package/dist/index.d.ts
CHANGED
|
@@ -566,10 +566,9 @@ declare const retrieveActivityTemplateDTOOptionList: (activityTemplateSet: any)
|
|
|
566
566
|
declare const retrieveCurrentDefaultDataMap: (activityTemplateType: any, activityData: any) => any;
|
|
567
567
|
declare const constructActivityAnswerMap: (activityTemplate: any, activityData: any) => any;
|
|
568
568
|
declare const ignoreMathematicalExpression: (inputText: string) => string;
|
|
569
|
-
declare const
|
|
570
|
-
declare const
|
|
571
|
-
declare const
|
|
572
|
-
declare const checkActivityAnswerState: (answerList: any, activity: any) => "NOT_EXISTS" | "ANSWERED" | "EMPTY";
|
|
569
|
+
declare const constructActivityAnswerStateList: (answerList: any[], activityList: any[]) => any;
|
|
570
|
+
declare const retrieveActivityAnswerFromAnswerList: (answerList: any[], activity: any) => any;
|
|
571
|
+
declare const checkActivityAnswerState: (answerList: any[], activity: any) => "NOT_EXISTS" | "EMPTY" | "ANSWERED";
|
|
573
572
|
declare const findBestFitActivity: (activity: any, individualModelList: any, outcomeModelList: any) => {
|
|
574
573
|
bestScore: number;
|
|
575
574
|
bestActivityTemplate: any;
|
|
@@ -943,4 +942,4 @@ declare const retrieveActivityMethodologyOptionList: () => {
|
|
|
943
942
|
text: string;
|
|
944
943
|
}[];
|
|
945
944
|
|
|
946
|
-
export { ActivityBodyContent, ActivityEmptyContent, ActivityEvaluationRubricContent, ActivityLabel, ActivityPreviewByAnswerData, ActivityPreviewByData, ActivitySolutionContent, ActivityTemplateLabel, ApproveButton, BaseCard, BaseImage, BaseLoading, BaseLoadingWithText, BaseModal, BasePDF, BaseTitle, BlueVerticalDividerLine, BrandLabel, CancelButton, CategoryLabel, CoterieLabel, CreateButton, DeleteButton, DividerLine, DropdownActivityContent, FillInTheBlanksActivityContent, FullCard, GradeLabel, GroupingActivityContent, InfoWithText, InputGroup, InputWithSpecialExpression, LeftTextRightInputGroup, MCMAActivityContent, MCSAActivityContent, MatchingActivityContent, ONE_DAY, ONE_HOUR, ONE_MONTH, ONE_WEEK, OpenEndedActivityContent, OrderingActivityContent, OutcomeLabel, PageTravelGroup, PersonalLabel, PrimaryButton, ProgressBar, PublishingHouseLabel, ScoreBar, SecondaryButton, SelectionBox, SelectionCheckbox, SelectionTab, SelectionTabFill, StatusError, SubTitle, THREE_MONTHS, TimedProgressBar, TrueFalseActivityContent, VerticalDividerLine, base64ToFile, calculateEndDateOfWeek, calculateLevenshteinDistance, calculateStartDateOfWeek, checkActivityAnswerState,
|
|
945
|
+
export { ActivityBodyContent, ActivityEmptyContent, ActivityEvaluationRubricContent, ActivityLabel, ActivityPreviewByAnswerData, ActivityPreviewByData, ActivitySolutionContent, ActivityTemplateLabel, ApproveButton, BaseCard, BaseImage, BaseLoading, BaseLoadingWithText, BaseModal, BasePDF, BaseTitle, BlueVerticalDividerLine, BrandLabel, CancelButton, CategoryLabel, CoterieLabel, CreateButton, DeleteButton, DividerLine, DropdownActivityContent, FillInTheBlanksActivityContent, FullCard, GradeLabel, GroupingActivityContent, InfoWithText, InputGroup, InputWithSpecialExpression, LeftTextRightInputGroup, MCMAActivityContent, MCSAActivityContent, MatchingActivityContent, ONE_DAY, ONE_HOUR, ONE_MONTH, ONE_WEEK, OpenEndedActivityContent, OrderingActivityContent, OutcomeLabel, PageTravelGroup, PersonalLabel, PrimaryButton, ProgressBar, PublishingHouseLabel, ScoreBar, SecondaryButton, SelectionBox, SelectionCheckbox, SelectionTab, SelectionTabFill, StatusError, SubTitle, THREE_MONTHS, TimedProgressBar, TrueFalseActivityContent, VerticalDividerLine, base64ToFile, calculateEndDateOfWeek, calculateLevenshteinDistance, calculateStartDateOfWeek, checkActivityAnswerState, constructActivityAnswerMap, constructActivityAnswerStateList, constructActivityData, constructActivityItemListBodyOnly, constructActivityItemListForSolution, constructActivityItemListMaterialOnly, constructActivityItemListSolutionOnly, constructActivityItemListWithAnswersForAI, constructActivityItemListWithSolutionForAI, constructAnswerBasedOnData, constructBaseNumericIndividualModel, constructBaseVerbalIndvidualModel, constructCategoryTreeFromParentCode, constructCombinedCorporateAssessmentAssignmentReportMap, constructCombinedOutcomeActivityScoreMapFromCombinedReport, constructInputWithSpecialExpressionList, constructMonthName, constructOutcomeActivityScoreList, constructUserProfileQueryParams, constructWeekName, convertDataURLtoFile, convertToBase64, convertToBodyMapString, convertToEvaluationRubricMapString, convertToSolutionMapString, convertTurkishCharactersToEnglish, filterCategoryVersionCodeOptionList, filterCategoryVersionCodeOptionListByGradeDTO, filterCategoryVersionCodeOptionListByInstitutionDTO, filterCoterieTypeByDistinctOptionList, filterCoterieTypeOptionList, filterGradeLevelOptionList, filterUserRoleOptionList, findAISettingsFromCurrentProfile, findBestFitActivity, formatPriceWithCommas, getColorByIndex, ignoreMathematicalExpression, mergeObjects, parseBodyMapFromData, parseContentMapFromData, parseJwt, parseMaterialMapFromData, retrieveActivityAnswerFromAnswerList, retrieveActivityCountOptionList, retrieveActivityMethodologyOptionList, retrieveActivityTemplateDTOOptionList, retrieveAllEarnedBadgeDTOListByCoterieType, retrieveAllEarnedBadgeDTOListByCoterieTypeList, retrieveAnnouncementAudienceOptionList, retrieveAnnouncementTypeOptionList, retrieveBadgeRuleListByParams, retrieveBadgeRuleTextByParams, retrieveBranchDTOByUserProfileOptionList, retrieveBranchDTOOptionList, retrieveBrandDTOByUserProfileOptionList, retrieveBrandDTOOptionList, retrieveCampusDTOByUserProfileOptionList, retrieveCampusDTOOptionList, retrieveCategoryVersionCodeOptionList, retrieveClockTimeLeft, retrieveColorByScore, retrieveContentTypeOptionList, retrieveContestTypeOptionList, retrieveCoterieTypeFromStandardExamCoterieType, retrieveCoterieTypeOptionList, retrieveCountryCodeOptionList, retrieveCountryNameOptionList, retrieveCurrencyTypeOptionList, retrieveCurrentDefaultDataMap, retrieveDateIntervalOptionList, retrieveDefaultUserRoleOptionList, retrieveDelayTypeOptionList, retrieveDifficultyByActivityTypeFromData, retrieveDifficultyOptionList, retrieveDiscountAmountTypeOptionList, retrieveDistinctCoterieTypeFromCorporatePersonalizedAssignmentApplicationDTO, retrieveDocumentTypeFromAcceptedFormat, retrieveDocumentTypeFromExtension, retrieveDurationInMinutesOptionList, retrieveDurationInSecondsOptionList, retrieveDurationTypeOptionList, retrieveEachTimeSpentInSeconds, retrieveEnableOptionList, retrieveExternalRegistrationDTOOptionList, retrieveFrequencyTypeOptionList, retrieveGenderOptionList, retrieveGradeDTOByUserProfileOptionList, retrieveGradeDTOOptionList, retrieveGradeLevelOptionList, retrieveInstitutionDTOByUserProfileOptionList, retrieveInstitutionDTOOptionList, retrieveInstitutionTypeByLevel, retrieveInstitutionTypeOptionList, retrieveLastNOptionList, retrieveLeagueThresholdByLeagueType, retrieveLeagueThresholds, retrieveLeagueTypeOptionList, retrieveMonthNameByIndex, retrieveOpticalExamPartTypeOptionList, retrieveOpticalExamTypeOptionList, retrieveOtherBadgeDTOList, retrieveOutcomePlanTypeOptionList, retrievePhoneNumberAreaCodeList, retrieveProvinceNameOptionList, retrieveReportTypeOptionList, retrieveSeasonDTOByUserProfileOptionList, retrieveSeasonDTOOptionList, retrieveStandardExamCoterieTypeOptionListByStandardExamType, retrieveStandardExamTypeIcon, retrieveStandardExamTypeOptionList, retrieveStatusOptionList, retrieveTeachingMethodologyOptionList, retrieveTimeFilterOptionList, retrieveTimeFilterWithLastNOptionList, retrieveTokenUsageSubTypeOptionList, retrieveTokenUsageTypeOptionList, retrieveTotalTimeSpentInMinutes, retrieveTotalTimeSpentInSeconds, retrieveUserAuthorityGeneralOptionList, retrieveUserRoleOptionList, retrieveValidationRequirementList, shuffleArray, useScreenSize };
|
package/dist/index.js
CHANGED
|
@@ -132,7 +132,6 @@ __export(index_exports, {
|
|
|
132
132
|
calculateLevenshteinDistance: () => calculateLevenshteinDistance,
|
|
133
133
|
calculateStartDateOfWeek: () => calculateStartDateOfWeek,
|
|
134
134
|
checkActivityAnswerState: () => checkActivityAnswerState,
|
|
135
|
-
checkIfAnswerIsEmpty: () => checkIfAnswerIsEmpty,
|
|
136
135
|
constructActivityAnswerMap: () => constructActivityAnswerMap,
|
|
137
136
|
constructActivityAnswerStateList: () => constructActivityAnswerStateList,
|
|
138
137
|
constructActivityData: () => constructActivityData,
|
|
@@ -2409,58 +2408,6 @@ var constructActivityAnswerMap = (activityTemplate, activityData) => {
|
|
|
2409
2408
|
var ignoreMathematicalExpression = (inputText) => {
|
|
2410
2409
|
return inputText.replaceAll("{", "").replaceAll("}", "").replaceAll("_", "").replaceAll("^", "").replaceAll("\\frac", "").replaceAll("\\text", "").replaceAll("\\sqrt", "");
|
|
2411
2410
|
};
|
|
2412
|
-
var checkIfAnswerIsEmpty = (answer) => {
|
|
2413
|
-
const { data } = answer;
|
|
2414
|
-
if (data && data.length > 0) {
|
|
2415
|
-
const foundAnswer = data[0];
|
|
2416
|
-
const { type, answerMap } = foundAnswer;
|
|
2417
|
-
if (type === "ORDERING") {
|
|
2418
|
-
return false;
|
|
2419
|
-
} else if (type === "DROPDOWN") {
|
|
2420
|
-
for (const key of Object.keys(answerMap)) {
|
|
2421
|
-
if (answerMap[key] !== "DEFAULT_OPTION") {
|
|
2422
|
-
return false;
|
|
2423
|
-
}
|
|
2424
|
-
}
|
|
2425
|
-
} else if (type === "MCSA") {
|
|
2426
|
-
const key = Object.keys(answerMap)[0];
|
|
2427
|
-
if (answerMap[key] !== "ANSWER_KEY") {
|
|
2428
|
-
return false;
|
|
2429
|
-
}
|
|
2430
|
-
} else if (type === "MCMA") {
|
|
2431
|
-
const key = Object.keys(answerMap)[0];
|
|
2432
|
-
if (answerMap[key].length !== 0) {
|
|
2433
|
-
return false;
|
|
2434
|
-
}
|
|
2435
|
-
} else if (type === "MATCHING") {
|
|
2436
|
-
for (const key of Object.keys(answerMap)) {
|
|
2437
|
-
if (answerMap[key]) {
|
|
2438
|
-
return false;
|
|
2439
|
-
}
|
|
2440
|
-
}
|
|
2441
|
-
} else if (type === "GROUPING") {
|
|
2442
|
-
for (const key of Object.keys(answerMap)) {
|
|
2443
|
-
if (answerMap[key].length !== 0) {
|
|
2444
|
-
return false;
|
|
2445
|
-
}
|
|
2446
|
-
}
|
|
2447
|
-
} else if (type === "FILL_IN_THE_BLANKS") {
|
|
2448
|
-
for (const key of Object.keys(answerMap)) {
|
|
2449
|
-
if (answerMap[key]) {
|
|
2450
|
-
return false;
|
|
2451
|
-
}
|
|
2452
|
-
}
|
|
2453
|
-
} else if (type === "OPEN_ENDED") {
|
|
2454
|
-
const key = Object.keys(answerMap)[0];
|
|
2455
|
-
if (answerMap[key]) {
|
|
2456
|
-
return false;
|
|
2457
|
-
}
|
|
2458
|
-
} else if (type === "TRUE_FALSE") {
|
|
2459
|
-
return answerMap.trueList.length === 0 && answerMap.falseList.length === 0;
|
|
2460
|
-
}
|
|
2461
|
-
}
|
|
2462
|
-
return true;
|
|
2463
|
-
};
|
|
2464
2411
|
var constructActivityAnswerStateList = (answerList, activityList) => {
|
|
2465
2412
|
const stateList = [];
|
|
2466
2413
|
activityList.forEach((activity, index) => {
|
|
@@ -2474,7 +2421,7 @@ var constructActivityAnswerStateList = (answerList, activityList) => {
|
|
|
2474
2421
|
};
|
|
2475
2422
|
var retrieveActivityAnswerFromAnswerList = (answerList, activity) => {
|
|
2476
2423
|
return answerList.find(
|
|
2477
|
-
(answer) => parseFloat(answer.
|
|
2424
|
+
(answer) => parseFloat(answer.activityId) === parseFloat(activity.id)
|
|
2478
2425
|
);
|
|
2479
2426
|
};
|
|
2480
2427
|
var checkActivityAnswerState = (answerList, activity) => {
|
|
@@ -2482,17 +2429,11 @@ var checkActivityAnswerState = (answerList, activity) => {
|
|
|
2482
2429
|
answerList,
|
|
2483
2430
|
activity
|
|
2484
2431
|
);
|
|
2485
|
-
if (!activityAnswer)
|
|
2486
|
-
return "NOT_EXISTS";
|
|
2487
|
-
}
|
|
2432
|
+
if (!activityAnswer) return "NOT_EXISTS";
|
|
2488
2433
|
const { data } = activityAnswer;
|
|
2489
2434
|
if (!data) return "NOT_EXISTS";
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
return "ANSWERED";
|
|
2493
|
-
} else {
|
|
2494
|
-
return "EMPTY";
|
|
2495
|
-
}
|
|
2435
|
+
if (activityAnswer.isEmpty) return "EMPTY";
|
|
2436
|
+
return "ANSWERED";
|
|
2496
2437
|
};
|
|
2497
2438
|
var findBestFitActivity = (activity, individualModelList, outcomeModelList) => {
|
|
2498
2439
|
const { activityTemplateDTOList, data, coterieType, categoryIdList } = activity;
|
|
@@ -2656,7 +2597,7 @@ var retrieveClockTimeLeft = (type, value, durationType, durationInMinutes, activ
|
|
|
2656
2597
|
var retrieveEachTimeSpentInSeconds = (activityProgressList, activity) => {
|
|
2657
2598
|
if (!activityProgressList || !activity) return 0;
|
|
2658
2599
|
const foundActivityProgress = activityProgressList.find(
|
|
2659
|
-
(activityProgress) => parseFloat(activityProgress.
|
|
2600
|
+
(activityProgress) => parseFloat(activityProgress.activityId) === parseFloat(activity.id)
|
|
2660
2601
|
);
|
|
2661
2602
|
if (foundActivityProgress) {
|
|
2662
2603
|
return foundActivityProgress.timeSpent / 1e3;
|
|
@@ -10860,7 +10801,6 @@ var retrieveActivityMethodologyOptionList = () => {
|
|
|
10860
10801
|
calculateLevenshteinDistance,
|
|
10861
10802
|
calculateStartDateOfWeek,
|
|
10862
10803
|
checkActivityAnswerState,
|
|
10863
|
-
checkIfAnswerIsEmpty,
|
|
10864
10804
|
constructActivityAnswerMap,
|
|
10865
10805
|
constructActivityAnswerStateList,
|
|
10866
10806
|
constructActivityData,
|
package/dist/index.mjs
CHANGED
|
@@ -2186,58 +2186,6 @@ var constructActivityAnswerMap = (activityTemplate, activityData) => {
|
|
|
2186
2186
|
var ignoreMathematicalExpression = (inputText) => {
|
|
2187
2187
|
return inputText.replaceAll("{", "").replaceAll("}", "").replaceAll("_", "").replaceAll("^", "").replaceAll("\\frac", "").replaceAll("\\text", "").replaceAll("\\sqrt", "");
|
|
2188
2188
|
};
|
|
2189
|
-
var checkIfAnswerIsEmpty = (answer) => {
|
|
2190
|
-
const { data } = answer;
|
|
2191
|
-
if (data && data.length > 0) {
|
|
2192
|
-
const foundAnswer = data[0];
|
|
2193
|
-
const { type, answerMap } = foundAnswer;
|
|
2194
|
-
if (type === "ORDERING") {
|
|
2195
|
-
return false;
|
|
2196
|
-
} else if (type === "DROPDOWN") {
|
|
2197
|
-
for (const key of Object.keys(answerMap)) {
|
|
2198
|
-
if (answerMap[key] !== "DEFAULT_OPTION") {
|
|
2199
|
-
return false;
|
|
2200
|
-
}
|
|
2201
|
-
}
|
|
2202
|
-
} else if (type === "MCSA") {
|
|
2203
|
-
const key = Object.keys(answerMap)[0];
|
|
2204
|
-
if (answerMap[key] !== "ANSWER_KEY") {
|
|
2205
|
-
return false;
|
|
2206
|
-
}
|
|
2207
|
-
} else if (type === "MCMA") {
|
|
2208
|
-
const key = Object.keys(answerMap)[0];
|
|
2209
|
-
if (answerMap[key].length !== 0) {
|
|
2210
|
-
return false;
|
|
2211
|
-
}
|
|
2212
|
-
} else if (type === "MATCHING") {
|
|
2213
|
-
for (const key of Object.keys(answerMap)) {
|
|
2214
|
-
if (answerMap[key]) {
|
|
2215
|
-
return false;
|
|
2216
|
-
}
|
|
2217
|
-
}
|
|
2218
|
-
} else if (type === "GROUPING") {
|
|
2219
|
-
for (const key of Object.keys(answerMap)) {
|
|
2220
|
-
if (answerMap[key].length !== 0) {
|
|
2221
|
-
return false;
|
|
2222
|
-
}
|
|
2223
|
-
}
|
|
2224
|
-
} else if (type === "FILL_IN_THE_BLANKS") {
|
|
2225
|
-
for (const key of Object.keys(answerMap)) {
|
|
2226
|
-
if (answerMap[key]) {
|
|
2227
|
-
return false;
|
|
2228
|
-
}
|
|
2229
|
-
}
|
|
2230
|
-
} else if (type === "OPEN_ENDED") {
|
|
2231
|
-
const key = Object.keys(answerMap)[0];
|
|
2232
|
-
if (answerMap[key]) {
|
|
2233
|
-
return false;
|
|
2234
|
-
}
|
|
2235
|
-
} else if (type === "TRUE_FALSE") {
|
|
2236
|
-
return answerMap.trueList.length === 0 && answerMap.falseList.length === 0;
|
|
2237
|
-
}
|
|
2238
|
-
}
|
|
2239
|
-
return true;
|
|
2240
|
-
};
|
|
2241
2189
|
var constructActivityAnswerStateList = (answerList, activityList) => {
|
|
2242
2190
|
const stateList = [];
|
|
2243
2191
|
activityList.forEach((activity, index) => {
|
|
@@ -2251,7 +2199,7 @@ var constructActivityAnswerStateList = (answerList, activityList) => {
|
|
|
2251
2199
|
};
|
|
2252
2200
|
var retrieveActivityAnswerFromAnswerList = (answerList, activity) => {
|
|
2253
2201
|
return answerList.find(
|
|
2254
|
-
(answer) => parseFloat(answer.
|
|
2202
|
+
(answer) => parseFloat(answer.activityId) === parseFloat(activity.id)
|
|
2255
2203
|
);
|
|
2256
2204
|
};
|
|
2257
2205
|
var checkActivityAnswerState = (answerList, activity) => {
|
|
@@ -2259,17 +2207,11 @@ var checkActivityAnswerState = (answerList, activity) => {
|
|
|
2259
2207
|
answerList,
|
|
2260
2208
|
activity
|
|
2261
2209
|
);
|
|
2262
|
-
if (!activityAnswer)
|
|
2263
|
-
return "NOT_EXISTS";
|
|
2264
|
-
}
|
|
2210
|
+
if (!activityAnswer) return "NOT_EXISTS";
|
|
2265
2211
|
const { data } = activityAnswer;
|
|
2266
2212
|
if (!data) return "NOT_EXISTS";
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
return "ANSWERED";
|
|
2270
|
-
} else {
|
|
2271
|
-
return "EMPTY";
|
|
2272
|
-
}
|
|
2213
|
+
if (activityAnswer.isEmpty) return "EMPTY";
|
|
2214
|
+
return "ANSWERED";
|
|
2273
2215
|
};
|
|
2274
2216
|
var findBestFitActivity = (activity, individualModelList, outcomeModelList) => {
|
|
2275
2217
|
const { activityTemplateDTOList, data, coterieType, categoryIdList } = activity;
|
|
@@ -2433,7 +2375,7 @@ var retrieveClockTimeLeft = (type, value, durationType, durationInMinutes, activ
|
|
|
2433
2375
|
var retrieveEachTimeSpentInSeconds = (activityProgressList, activity) => {
|
|
2434
2376
|
if (!activityProgressList || !activity) return 0;
|
|
2435
2377
|
const foundActivityProgress = activityProgressList.find(
|
|
2436
|
-
(activityProgress) => parseFloat(activityProgress.
|
|
2378
|
+
(activityProgress) => parseFloat(activityProgress.activityId) === parseFloat(activity.id)
|
|
2437
2379
|
);
|
|
2438
2380
|
if (foundActivityProgress) {
|
|
2439
2381
|
return foundActivityProgress.timeSpent / 1e3;
|
|
@@ -10636,7 +10578,6 @@ export {
|
|
|
10636
10578
|
calculateLevenshteinDistance,
|
|
10637
10579
|
calculateStartDateOfWeek,
|
|
10638
10580
|
checkActivityAnswerState,
|
|
10639
|
-
checkIfAnswerIsEmpty,
|
|
10640
10581
|
constructActivityAnswerMap,
|
|
10641
10582
|
constructActivityAnswerStateList,
|
|
10642
10583
|
constructActivityData,
|
package/package.json
CHANGED
|
@@ -1252,64 +1252,9 @@ export const ignoreMathematicalExpression = (inputText: string) => {
|
|
|
1252
1252
|
.replaceAll("\\sqrt", "");
|
|
1253
1253
|
};
|
|
1254
1254
|
|
|
1255
|
-
export const checkIfAnswerIsEmpty = (answer: any) => {
|
|
1256
|
-
const { data } = answer;
|
|
1257
|
-
if (data && data.length > 0) {
|
|
1258
|
-
const foundAnswer = data[0];
|
|
1259
|
-
const { type, answerMap } = foundAnswer;
|
|
1260
|
-
if (type === "ORDERING") {
|
|
1261
|
-
return false;
|
|
1262
|
-
} else if (type === "DROPDOWN") {
|
|
1263
|
-
for (const key of Object.keys(answerMap)) {
|
|
1264
|
-
if (answerMap[key] !== "DEFAULT_OPTION") {
|
|
1265
|
-
return false;
|
|
1266
|
-
}
|
|
1267
|
-
}
|
|
1268
|
-
} else if (type === "MCSA") {
|
|
1269
|
-
const key = Object.keys(answerMap)[0];
|
|
1270
|
-
if (answerMap[key] !== "ANSWER_KEY") {
|
|
1271
|
-
return false;
|
|
1272
|
-
}
|
|
1273
|
-
} else if (type === "MCMA") {
|
|
1274
|
-
const key = Object.keys(answerMap)[0];
|
|
1275
|
-
if (answerMap[key].length !== 0) {
|
|
1276
|
-
return false;
|
|
1277
|
-
}
|
|
1278
|
-
} else if (type === "MATCHING") {
|
|
1279
|
-
for (const key of Object.keys(answerMap)) {
|
|
1280
|
-
if (answerMap[key]) {
|
|
1281
|
-
return false;
|
|
1282
|
-
}
|
|
1283
|
-
}
|
|
1284
|
-
} else if (type === "GROUPING") {
|
|
1285
|
-
for (const key of Object.keys(answerMap)) {
|
|
1286
|
-
if (answerMap[key].length !== 0) {
|
|
1287
|
-
return false;
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
} else if (type === "FILL_IN_THE_BLANKS") {
|
|
1291
|
-
for (const key of Object.keys(answerMap)) {
|
|
1292
|
-
if (answerMap[key]) {
|
|
1293
|
-
return false;
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
} else if (type === "OPEN_ENDED") {
|
|
1297
|
-
const key = Object.keys(answerMap)[0];
|
|
1298
|
-
if (answerMap[key]) {
|
|
1299
|
-
return false;
|
|
1300
|
-
}
|
|
1301
|
-
} else if (type === "TRUE_FALSE") {
|
|
1302
|
-
return (
|
|
1303
|
-
answerMap.trueList.length === 0 && answerMap.falseList.length === 0
|
|
1304
|
-
);
|
|
1305
|
-
}
|
|
1306
|
-
}
|
|
1307
|
-
return true;
|
|
1308
|
-
};
|
|
1309
|
-
|
|
1310
1255
|
export const constructActivityAnswerStateList = (
|
|
1311
|
-
answerList: any,
|
|
1312
|
-
activityList: any
|
|
1256
|
+
answerList: any[],
|
|
1257
|
+
activityList: any[]
|
|
1313
1258
|
) => {
|
|
1314
1259
|
const stateList: any = [];
|
|
1315
1260
|
activityList.forEach((activity: any, index: number) => {
|
|
@@ -1323,34 +1268,24 @@ export const constructActivityAnswerStateList = (
|
|
|
1323
1268
|
};
|
|
1324
1269
|
|
|
1325
1270
|
export const retrieveActivityAnswerFromAnswerList = (
|
|
1326
|
-
answerList: any,
|
|
1271
|
+
answerList: any[],
|
|
1327
1272
|
activity: any
|
|
1328
1273
|
) => {
|
|
1329
|
-
// if (!answerList || !activity) return;
|
|
1330
1274
|
return answerList.find(
|
|
1331
|
-
(answer: any) =>
|
|
1332
|
-
parseFloat(answer.activityDTO.id) === parseFloat(activity.id)
|
|
1275
|
+
(answer: any) => parseFloat(answer.activityId) === parseFloat(activity.id)
|
|
1333
1276
|
);
|
|
1334
1277
|
};
|
|
1335
1278
|
|
|
1336
|
-
export const checkActivityAnswerState = (answerList: any, activity: any) => {
|
|
1279
|
+
export const checkActivityAnswerState = (answerList: any[], activity: any) => {
|
|
1337
1280
|
const activityAnswer = retrieveActivityAnswerFromAnswerList(
|
|
1338
1281
|
answerList,
|
|
1339
1282
|
activity
|
|
1340
1283
|
);
|
|
1341
|
-
if (!activityAnswer)
|
|
1342
|
-
return "NOT_EXISTS";
|
|
1343
|
-
}
|
|
1284
|
+
if (!activityAnswer) return "NOT_EXISTS";
|
|
1344
1285
|
const { data } = activityAnswer;
|
|
1345
1286
|
if (!data) return "NOT_EXISTS";
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
parsedData.filter((item: any) => !item.isEmpty).length === parsedData.length
|
|
1349
|
-
) {
|
|
1350
|
-
return "ANSWERED";
|
|
1351
|
-
} else {
|
|
1352
|
-
return "EMPTY";
|
|
1353
|
-
}
|
|
1287
|
+
if (activityAnswer.isEmpty) return "EMPTY";
|
|
1288
|
+
return "ANSWERED";
|
|
1354
1289
|
};
|
|
1355
1290
|
|
|
1356
1291
|
export const findBestFitActivity = (
|
|
@@ -1563,7 +1498,7 @@ export const retrieveEachTimeSpentInSeconds = (
|
|
|
1563
1498
|
if (!activityProgressList || !activity) return 0;
|
|
1564
1499
|
const foundActivityProgress = activityProgressList.find(
|
|
1565
1500
|
(activityProgress: any) =>
|
|
1566
|
-
parseFloat(activityProgress.
|
|
1501
|
+
parseFloat(activityProgress.activityId) === parseFloat(activity.id)
|
|
1567
1502
|
);
|
|
1568
1503
|
if (foundActivityProgress) {
|
|
1569
1504
|
return foundActivityProgress.timeSpent / 1000;
|