catchup-library-web 1.21.21 → 2.0.0

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.
@@ -3,16 +3,16 @@ import i18n from "../language/i18n";
3
3
  const retrieveSourceTypeOptionList = (coterieOnly: boolean) => {
4
4
  const currentSourceTypeOptionList = [
5
5
  {
6
- value: "CATCHTIVITY",
7
- text: i18n.t("CATCHTIVITY"),
6
+ value: "CORPORATE_PERSONALIZED_ASSIGNMENT",
7
+ text: i18n.t("CORPORATE_PERSONALIZED_ASSIGNMENT"),
8
8
  },
9
9
  {
10
- value: "CATCHXAM",
11
- text: i18n.t("CATCHXAM"),
10
+ value: "CORPORATE_ASSESSMENT_ASSIGNMENT",
11
+ text: i18n.t("CORPORATE_ASSESSMENT_ASSIGNMENT"),
12
12
  },
13
13
  {
14
- value: "ETUDE",
15
- text: i18n.t("ETUDE"),
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 === "CATCHTIVITY") {
396
+ } else if (sourceType === "CORPORATE_PERSONALIZED_ASSIGNMENT") {
397
397
  if (foundBadgeRule) {
398
- return `${i18n.t("total_count_catchtivity_text_1")}${
399
- foundBadgeRule.value
400
- }${i18n.t("total_count_catchtivity_text_2")}`;
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("none_count_catchtivity_text");
404
+ return i18n.t("none_count_corporate_personalized_assignment_text");
403
405
  }
404
- } else if (sourceType === "CATCHXAM") {
406
+ } else if (sourceType === "CORPORATE_ASSESSMENT_ASSIGNMENT") {
405
407
  if (foundBadgeRule) {
406
- return `${i18n.t("total_count_catchxam_text_1")}${
407
- foundBadgeRule.value
408
- }${i18n.t("total_count_catchxam_text_2")}`;
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("none_count_catchxam_text");
414
+ return i18n.t("none_count_corporate_assessment_assignment_text");
411
415
  }
412
- } else if (sourceType === "ETUDE") {
416
+ } else if (sourceType === "COMPLETION_ASSIGNMENT") {
413
417
  if (foundBadgeRule) {
414
- return `${i18n.t("total_count_etude_text_1")}${
418
+ return `${i18n.t("total_count_completion_assignment_text_1")}${
415
419
  foundBadgeRule.value
416
- }${i18n.t("total_count_etude_text_2")}`;
420
+ }${i18n.t("total_count_completion_assignment_text_2")}`;
417
421
  } else {
418
- return i18n.t("none_count_etude_text");
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 === "CATCHTIVITY") {
474
+ } else if (sourceType === "CORPORATE_PERSONALIZED_ASSIGNMENT") {
471
475
  if (foundBadgeRule) {
472
- return `${i18n.t("coterie_count_catchtivity_text_1")}${
473
- foundBadgeRule.value
474
- }${i18n.t("coterie_count_catchtivity_text_2")}`;
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("none_count_catchtivity_text");
482
+ return i18n.t("none_count_corporate_personalized_assignment_text");
477
483
  }
478
- } else if (sourceType === "CATCHXAM") {
484
+ } else if (sourceType === "CORPORATE_ASSESSMENT_ASSIGNMENT") {
479
485
  if (foundBadgeRule) {
480
- return `${i18n.t("coterie_count_catchxam_text_1")}${
481
- foundBadgeRule.value
482
- }${i18n.t("coterie_count_catchxam_text_2")}`;
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("none_count_catchxam_text");
492
+ return i18n.t("none_count_corporate_assessment_assignment_text");
485
493
  }
486
- } else if (sourceType === "ETUDE") {
494
+ } else if (sourceType === "COMPLETION_ASSIGNMENT") {
487
495
  if (foundBadgeRule) {
488
- return `${i18n.t("coterie_count_etude_text_1")}${
496
+ return `${i18n.t("coterie_count_completion_assignment_text_1")}${
489
497
  foundBadgeRule.value
490
- }${i18n.t("coterie_count_etude_text_2")}`;
498
+ }${i18n.t("coterie_count_completion_assignment_text_2")}`;
491
499
  } else {
492
- return i18n.t("none_count_etude_text");
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("catchtivity"), value: "CATCHTIVITY" },
1071
- { text: i18n.t("catchxam"), value: "CATCHXAM" },
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("standard_exam"), value: "STANDARD_EXAM" },
1086
- { text: i18n.t("etude"), value: "ETUDE" },
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 constructCombinedCatchxamReportMap = (
98
- filteredSelectedLearnerCatchxamReportDTOList: any[]
97
+ export const constructCombinedCorporateAssesmentAssignmentReportMap = (
98
+ filteredSelectedLearnerCorporateAssessmentAssignmentReportDTOList: any[]
99
99
  ) => {
100
- const combinedCatchxamReportMap: any = {};
101
- const copyFilteredSelectedLearnerCatchxamReportDTOList = JSON.parse(
102
- JSON.stringify(filteredSelectedLearnerCatchxamReportDTOList)
103
- );
104
- for (const learnerCatchxamReportDetailDTO of copyFilteredSelectedLearnerCatchxamReportDTOList) {
105
- const { catchxamApplicationDTO, categoryActivityAnswerDTOList } =
106
- learnerCatchxamReportDetailDTO;
107
- const { catchxamDTO } = catchxamApplicationDTO;
108
- const { coterieType } = catchxamDTO;
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
- combinedCatchxamReportMap[coterieType];
116
+ combinedCorporateAssessmentAssignmentReportMap[coterieType];
111
117
  if (currentCategoryActivityAnswerDTOList) {
112
118
  recursivelyIncludeCategoryActivityAnswerDTOList(
113
119
  { currentCategoryActivityAnswerDTOList },
114
120
  categoryActivityAnswerDTOList
115
121
  );
116
122
  } else {
117
- combinedCatchxamReportMap[coterieType] = categoryActivityAnswerDTOList;
123
+ combinedCorporateAssessmentAssignmentReportMap[coterieType] =
124
+ categoryActivityAnswerDTOList;
118
125
  }
119
126
  }
120
- return combinedCatchxamReportMap;
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
- combinedCatchxamReportMap: any
170
+ combinedCorporateAssessmentAssignmentReportMap: any
164
171
  ) => {
165
172
  const combinedOutcomeActivityScoreMap: any = {};
166
173
 
167
- Object.keys(combinedCatchxamReportMap).forEach((coterieType) => {
168
- const categoryActivityAnswerDTOList =
169
- combinedCatchxamReportMap[coterieType];
170
- const outcomeActivityScoreListFromCoterieType =
171
- constructOutcomeActivityScoreList(categoryActivityAnswerDTOList);
172
- combinedOutcomeActivityScoreMap[coterieType] =
173
- outcomeActivityScoreListFromCoterieType;
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
  };