catchup-library-web 1.21.22 → 2.0.1
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 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +105 -82
- package/dist/index.mjs +103 -80
- package/package.json +1 -1
- package/src/utilization/CatchtivityUtilization.ts +57 -82
- package/src/utilization/GamificationUtilization.ts +42 -34
- package/src/utilization/ManagementUtilization.ts +4 -4
- package/src/utilization/ReportUtilization.ts +32 -23
|
@@ -3,16 +3,16 @@ import i18n from "../language/i18n";
|
|
|
3
3
|
const retrieveSourceTypeOptionList = (coterieOnly: boolean) => {
|
|
4
4
|
const currentSourceTypeOptionList = [
|
|
5
5
|
{
|
|
6
|
-
value: "
|
|
7
|
-
text: i18n.t("
|
|
6
|
+
value: "CORPORATE_PERSONALIZED_ASSIGNMENT",
|
|
7
|
+
text: i18n.t("CORPORATE_PERSONALIZED_ASSIGNMENT"),
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
|
-
value: "
|
|
11
|
-
text: i18n.t("
|
|
10
|
+
value: "CORPORATE_ASSESSMENT_ASSIGNMENT",
|
|
11
|
+
text: i18n.t("CORPORATE_ASSESSMENT_ASSIGNMENT"),
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
value: "
|
|
15
|
-
text: i18n.t("
|
|
14
|
+
value: "COMPLETION_ASSIGNMENT",
|
|
15
|
+
text: i18n.t("COMPLETION_ASSIGNMENT"),
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
value: "CONTEST",
|
|
@@ -393,29 +393,33 @@ export const retrieveBadgeRuleTextByParams = (
|
|
|
393
393
|
} else {
|
|
394
394
|
return i18n.t("none_count_activity_time_spent_text");
|
|
395
395
|
}
|
|
396
|
-
} else if (sourceType === "
|
|
396
|
+
} else if (sourceType === "CORPORATE_PERSONALIZED_ASSIGNMENT") {
|
|
397
397
|
if (foundBadgeRule) {
|
|
398
|
-
return `${i18n.t(
|
|
399
|
-
|
|
400
|
-
}${i18n.t(
|
|
398
|
+
return `${i18n.t(
|
|
399
|
+
"total_count_corporate_personalized_assignment_text_1"
|
|
400
|
+
)}${foundBadgeRule.value}${i18n.t(
|
|
401
|
+
"total_count_corporate_personalized_assignment_text_2"
|
|
402
|
+
)}`;
|
|
401
403
|
} else {
|
|
402
|
-
return i18n.t("
|
|
404
|
+
return i18n.t("none_count_corporate_personalized_assignment_text");
|
|
403
405
|
}
|
|
404
|
-
} else if (sourceType === "
|
|
406
|
+
} else if (sourceType === "CORPORATE_ASSESSMENT_ASSIGNMENT") {
|
|
405
407
|
if (foundBadgeRule) {
|
|
406
|
-
return `${i18n.t(
|
|
407
|
-
|
|
408
|
-
}${i18n.t(
|
|
408
|
+
return `${i18n.t(
|
|
409
|
+
"total_count_corporate_assessment_assignment_text_1"
|
|
410
|
+
)}${foundBadgeRule.value}${i18n.t(
|
|
411
|
+
"total_count_corporate_assessment_assignment_text_2"
|
|
412
|
+
)}`;
|
|
409
413
|
} else {
|
|
410
|
-
return i18n.t("
|
|
414
|
+
return i18n.t("none_count_corporate_assessment_assignment_text");
|
|
411
415
|
}
|
|
412
|
-
} else if (sourceType === "
|
|
416
|
+
} else if (sourceType === "COMPLETION_ASSIGNMENT") {
|
|
413
417
|
if (foundBadgeRule) {
|
|
414
|
-
return `${i18n.t("
|
|
418
|
+
return `${i18n.t("total_count_completion_assignment_text_1")}${
|
|
415
419
|
foundBadgeRule.value
|
|
416
|
-
}${i18n.t("
|
|
420
|
+
}${i18n.t("total_count_completion_assignment_text_2")}`;
|
|
417
421
|
} else {
|
|
418
|
-
return i18n.t("
|
|
422
|
+
return i18n.t("none_count_completion_assignment_text");
|
|
419
423
|
}
|
|
420
424
|
} else if (sourceType === "CONTEST") {
|
|
421
425
|
if (foundBadgeRule) {
|
|
@@ -467,29 +471,33 @@ export const retrieveBadgeRuleTextByParams = (
|
|
|
467
471
|
} else {
|
|
468
472
|
return i18n.t("none_count_activity_time_spent_text");
|
|
469
473
|
}
|
|
470
|
-
} else if (sourceType === "
|
|
474
|
+
} else if (sourceType === "CORPORATE_PERSONALIZED_ASSIGNMENT") {
|
|
471
475
|
if (foundBadgeRule) {
|
|
472
|
-
return `${i18n.t(
|
|
473
|
-
|
|
474
|
-
}${i18n.t(
|
|
476
|
+
return `${i18n.t(
|
|
477
|
+
"coterie_count_corporate_personalized_assignment_text_1"
|
|
478
|
+
)}${foundBadgeRule.value}${i18n.t(
|
|
479
|
+
"coterie_count_corporate_personalized_assignment_text_2"
|
|
480
|
+
)}`;
|
|
475
481
|
} else {
|
|
476
|
-
return i18n.t("
|
|
482
|
+
return i18n.t("none_count_corporate_personalized_assignment_text");
|
|
477
483
|
}
|
|
478
|
-
} else if (sourceType === "
|
|
484
|
+
} else if (sourceType === "CORPORATE_ASSESSMENT_ASSIGNMENT") {
|
|
479
485
|
if (foundBadgeRule) {
|
|
480
|
-
return `${i18n.t(
|
|
481
|
-
|
|
482
|
-
}${i18n.t(
|
|
486
|
+
return `${i18n.t(
|
|
487
|
+
"coterie_count_corporate_assessment_assignment_text_1"
|
|
488
|
+
)}${foundBadgeRule.value}${i18n.t(
|
|
489
|
+
"coterie_count_corporate_assessment_assignment_text_2"
|
|
490
|
+
)}`;
|
|
483
491
|
} else {
|
|
484
|
-
return i18n.t("
|
|
492
|
+
return i18n.t("none_count_corporate_assessment_assignment_text");
|
|
485
493
|
}
|
|
486
|
-
} else if (sourceType === "
|
|
494
|
+
} else if (sourceType === "COMPLETION_ASSIGNMENT") {
|
|
487
495
|
if (foundBadgeRule) {
|
|
488
|
-
return `${i18n.t("
|
|
496
|
+
return `${i18n.t("coterie_count_completion_assignment_text_1")}${
|
|
489
497
|
foundBadgeRule.value
|
|
490
|
-
}${i18n.t("
|
|
498
|
+
}${i18n.t("coterie_count_completion_assignment_text_2")}`;
|
|
491
499
|
} else {
|
|
492
|
-
return i18n.t("
|
|
500
|
+
return i18n.t("none_count_completion_assignment_text");
|
|
493
501
|
}
|
|
494
502
|
} else if (sourceType === "CONTEST") {
|
|
495
503
|
if (foundBadgeRule) {
|
|
@@ -1067,8 +1067,8 @@ export const retrieveUserAuthorityGeneralOptionList = () => {
|
|
|
1067
1067
|
{ text: i18n.t("all"), value: "" },
|
|
1068
1068
|
{ text: i18n.t("user"), value: "USER" },
|
|
1069
1069
|
{ text: i18n.t("activity"), value: "ACTIVITY" },
|
|
1070
|
-
{ text: i18n.t("
|
|
1071
|
-
{ text: i18n.t("
|
|
1070
|
+
{ text: i18n.t("corporate_personalized_assignment"), value: "CATCHTIVITY" },
|
|
1071
|
+
{ text: i18n.t("corporate_assessment_assignment"), value: "CATCHXAM" },
|
|
1072
1072
|
{ text: i18n.t("label"), value: "LABEL" },
|
|
1073
1073
|
{ text: i18n.t("announcement"), value: "NOTIFICATION" },
|
|
1074
1074
|
{ text: i18n.t("report"), value: "REPORT" },
|
|
@@ -1082,8 +1082,8 @@ export const retrieveUserAuthorityGeneralOptionList = () => {
|
|
|
1082
1082
|
{ text: i18n.t("grade"), value: "GRADE" },
|
|
1083
1083
|
{ text: i18n.t("branch"), value: "BRANCH" },
|
|
1084
1084
|
{ text: i18n.t("plan"), value: "PLAN" },
|
|
1085
|
-
{ text: i18n.t("
|
|
1086
|
-
{ text: i18n.t("
|
|
1085
|
+
{ text: i18n.t("corporate_standard_exam"), value: "STANDARD_EXAM" },
|
|
1086
|
+
{ text: i18n.t("completion_assignment"), value: "ETUDE" },
|
|
1087
1087
|
];
|
|
1088
1088
|
};
|
|
1089
1089
|
|
|
@@ -94,30 +94,37 @@ const recursivelyIncludeCategoryActivityAnswerDTOList = (
|
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
-
export const
|
|
98
|
-
|
|
97
|
+
export const constructCombinedCorporateAssesmentAssignmentReportMap = (
|
|
98
|
+
filteredSelectedLearnerCorporateAssessmentAssignmentReportDTOList: any[]
|
|
99
99
|
) => {
|
|
100
|
-
const
|
|
101
|
-
const
|
|
102
|
-
JSON.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
const {
|
|
100
|
+
const combinedCorporateAssessmentAssignmentReportMap: any = {};
|
|
101
|
+
const copyFilteredSelectedLearnerCorporateAssessmentAssignmentReportDTOList =
|
|
102
|
+
JSON.parse(
|
|
103
|
+
JSON.stringify(
|
|
104
|
+
filteredSelectedLearnerCorporateAssessmentAssignmentReportDTOList
|
|
105
|
+
)
|
|
106
|
+
);
|
|
107
|
+
for (const learnerCorporateAssessmentAssignmentReportDetailDTO of copyFilteredSelectedLearnerCorporateAssessmentAssignmentReportDTOList) {
|
|
108
|
+
const {
|
|
109
|
+
corporateAssessmentAssignmentApplicationDTO,
|
|
110
|
+
categoryActivityAnswerDTOList,
|
|
111
|
+
} = learnerCorporateAssessmentAssignmentReportDetailDTO;
|
|
112
|
+
const { corporateAssessmentAssignmentDTO } =
|
|
113
|
+
corporateAssessmentAssignmentApplicationDTO;
|
|
114
|
+
const { coterieType } = corporateAssessmentAssignmentDTO;
|
|
109
115
|
const currentCategoryActivityAnswerDTOList =
|
|
110
|
-
|
|
116
|
+
combinedCorporateAssessmentAssignmentReportMap[coterieType];
|
|
111
117
|
if (currentCategoryActivityAnswerDTOList) {
|
|
112
118
|
recursivelyIncludeCategoryActivityAnswerDTOList(
|
|
113
119
|
{ currentCategoryActivityAnswerDTOList },
|
|
114
120
|
categoryActivityAnswerDTOList
|
|
115
121
|
);
|
|
116
122
|
} else {
|
|
117
|
-
|
|
123
|
+
combinedCorporateAssessmentAssignmentReportMap[coterieType] =
|
|
124
|
+
categoryActivityAnswerDTOList;
|
|
118
125
|
}
|
|
119
126
|
}
|
|
120
|
-
return
|
|
127
|
+
return combinedCorporateAssessmentAssignmentReportMap;
|
|
121
128
|
};
|
|
122
129
|
|
|
123
130
|
export const constructOutcomeActivityScoreList = (data: any) => {
|
|
@@ -160,18 +167,20 @@ export const constructOutcomeActivityScoreList = (data: any) => {
|
|
|
160
167
|
};
|
|
161
168
|
|
|
162
169
|
export const constructCombinedOutcomeActivityScoreMapFromCombinedReport = (
|
|
163
|
-
|
|
170
|
+
combinedCorporateAssessmentAssignmentReportMap: any
|
|
164
171
|
) => {
|
|
165
172
|
const combinedOutcomeActivityScoreMap: any = {};
|
|
166
173
|
|
|
167
|
-
Object.keys(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
174
|
+
Object.keys(combinedCorporateAssessmentAssignmentReportMap).forEach(
|
|
175
|
+
(coterieType) => {
|
|
176
|
+
const categoryActivityAnswerDTOList =
|
|
177
|
+
combinedCorporateAssessmentAssignmentReportMap[coterieType];
|
|
178
|
+
const outcomeActivityScoreListFromCoterieType =
|
|
179
|
+
constructOutcomeActivityScoreList(categoryActivityAnswerDTOList);
|
|
180
|
+
combinedOutcomeActivityScoreMap[coterieType] =
|
|
181
|
+
outcomeActivityScoreListFromCoterieType;
|
|
182
|
+
}
|
|
183
|
+
);
|
|
175
184
|
|
|
176
185
|
return combinedOutcomeActivityScoreMap;
|
|
177
186
|
};
|