catchup-library-web 1.13.2 → 1.14.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.
@@ -109,93 +109,6 @@ export const retrieveDurationInSecondsOptionList = () => {
109
109
  ];
110
110
  };
111
111
 
112
- export const retrieveTaxonomyType = () => {
113
- return [
114
- {
115
- value: "BLOOM",
116
- text: i18n.t("BLOOM"),
117
- },
118
- ];
119
- };
120
-
121
- export const retrieveTaxonomyGroupName = () => {
122
- return [
123
- {
124
- type: "BLOOM",
125
- value: "BLOOM",
126
- text: i18n.t("BLOOM"),
127
- },
128
- ];
129
- };
130
-
131
- export const retrieveTaxonomyName = () => {
132
- return [
133
- {
134
- stage: 1,
135
- groupName: "BLOOM",
136
- value: "REMEMBER",
137
- text: i18n.t("REMEMBER"),
138
- },
139
- {
140
- stage: 2,
141
- groupName: "BLOOM",
142
- value: "UNDERSTAND",
143
- text: i18n.t("UNDERSTAND"),
144
- },
145
- {
146
- stage: 3,
147
- groupName: "BLOOM",
148
- value: "APPLY",
149
- text: i18n.t("APPLY"),
150
- },
151
- {
152
- stage: 4,
153
- groupName: "BLOOM",
154
- value: "ANALYZE",
155
- text: i18n.t("ANALYZE"),
156
- },
157
- {
158
- stage: 5,
159
- groupName: "BLOOM",
160
- value: "EVALUATE",
161
- text: i18n.t("EVALUATE"),
162
- },
163
- {
164
- stage: 6,
165
- groupName: "BLOOM",
166
- value: "CREATE",
167
- text: i18n.t("CREATE"),
168
- },
169
- ];
170
- };
171
-
172
- // export const constructInputWithSpecialExpressionList = (inputText: string) => {
173
- // const inputPartList = [];
174
- // if (!inputText) return [];
175
- // const splittedBold = inputText.split("**");
176
- // let isBold = false;
177
- // for (let i = 0; i < splittedBold.length; i++) {
178
- // let isUnderline = false;
179
- // const splittedUnderline = splittedBold[i].split("__");
180
- // for (let j = 0; j < splittedUnderline.length; j++) {
181
- // let isEquation = false;
182
- // const splittedEquation = splittedUnderline[j].split("$$");
183
- // for (let k = 0; k < splittedEquation.length; k++) {
184
- // inputPartList.push({
185
- // value: splittedEquation[k],
186
- // isEquation,
187
- // isUnderline,
188
- // isBold,
189
- // });
190
- // isEquation = !isEquation;
191
- // }
192
- // isUnderline = !isUnderline;
193
- // }
194
- // isBold = !isBold;
195
- // }
196
- // return inputPartList;
197
- // };
198
-
199
112
  export const constructInputWithSpecialExpressionList = (inputText: string) => {
200
113
  const inputPartList = [];
201
114
  if (!inputText) return [];
@@ -1477,45 +1390,45 @@ export const findBestFitActivity = (
1477
1390
  activity;
1478
1391
  const parsedData = JSON.parse(data);
1479
1392
  const {
1480
- orderingTaxonomyMap,
1481
- dropdownTaxonomyMap,
1482
- MCSATaxonomyMap,
1483
- MCMATaxonomyMap,
1484
- matchingTaxonomyMap,
1485
- groupingTaxonomyMap,
1486
- fillInTheBlanksTaxonomyMap,
1487
- openEndedTaxonomyMap,
1488
- trueFalseTaxonomyMap,
1393
+ orderingDifficulty,
1394
+ dropdownDifficulty,
1395
+ MCSADifficulty,
1396
+ MCMADifficulty,
1397
+ matchingDifficulty,
1398
+ groupingDifficulty,
1399
+ fillInTheBlanksDifficulty,
1400
+ openEndedDifficulty,
1401
+ trueFalseDifficulty,
1489
1402
  } = parsedData;
1490
- const taxonomyMap: any = {};
1491
- if (orderingTaxonomyMap) {
1492
- taxonomyMap["orderingTaxonomyMap"] = JSON.parse(orderingTaxonomyMap);
1403
+ const difficultyMap: any = {};
1404
+ if (orderingDifficulty) {
1405
+ difficultyMap["orderingDifficulty"] = JSON.parse(orderingDifficulty);
1493
1406
  }
1494
- if (dropdownTaxonomyMap) {
1495
- taxonomyMap["dropdownTaxonomyMap"] = JSON.parse(dropdownTaxonomyMap);
1407
+ if (dropdownDifficulty) {
1408
+ difficultyMap["dropdownDifficulty"] = JSON.parse(dropdownDifficulty);
1496
1409
  }
1497
- if (MCSATaxonomyMap) {
1498
- taxonomyMap["MCSATaxonomyMap"] = JSON.parse(MCSATaxonomyMap);
1410
+ if (MCSADifficulty) {
1411
+ difficultyMap["MCSADifficulty"] = JSON.parse(MCSADifficulty);
1499
1412
  }
1500
- if (MCMATaxonomyMap) {
1501
- taxonomyMap["MCMATaxonomyMap"] = JSON.parse(MCMATaxonomyMap);
1413
+ if (MCMADifficulty) {
1414
+ difficultyMap["MCMADifficulty"] = JSON.parse(MCMADifficulty);
1502
1415
  }
1503
- if (matchingTaxonomyMap) {
1504
- taxonomyMap["matchingTaxonomyMap"] = JSON.parse(matchingTaxonomyMap);
1416
+ if (matchingDifficulty) {
1417
+ difficultyMap["matchingDifficulty"] = JSON.parse(matchingDifficulty);
1505
1418
  }
1506
- if (groupingTaxonomyMap) {
1507
- taxonomyMap["groupingTaxonomyMap"] = JSON.parse(groupingTaxonomyMap);
1419
+ if (groupingDifficulty) {
1420
+ difficultyMap["groupingDifficulty"] = JSON.parse(groupingDifficulty);
1508
1421
  }
1509
- if (fillInTheBlanksTaxonomyMap) {
1510
- taxonomyMap["fillInTheBlanksTaxonomyMap"] = JSON.parse(
1511
- fillInTheBlanksTaxonomyMap
1422
+ if (fillInTheBlanksDifficulty) {
1423
+ difficultyMap["fillInTheBlanksDifficulty"] = JSON.parse(
1424
+ fillInTheBlanksDifficulty
1512
1425
  );
1513
1426
  }
1514
- if (trueFalseTaxonomyMap) {
1515
- taxonomyMap["trueFalseTaxonomyMap"] = JSON.parse(trueFalseTaxonomyMap);
1427
+ if (trueFalseDifficulty) {
1428
+ difficultyMap["trueFalseDifficulty"] = JSON.parse(trueFalseDifficulty);
1516
1429
  }
1517
- if (openEndedTaxonomyMap) {
1518
- taxonomyMap["openEndedTaxonomyMap"] = JSON.parse(openEndedTaxonomyMap);
1430
+ if (openEndedDifficulty) {
1431
+ difficultyMap["openEndedDifficulty"] = JSON.parse(openEndedDifficulty);
1519
1432
  }
1520
1433
  let coterieField = "VERBAL";
1521
1434
  if (
@@ -1550,40 +1463,28 @@ export const findBestFitActivity = (
1550
1463
  const activityTemplateValueMap: any = {};
1551
1464
  for (const activityTemplateDTO of activityTemplateDTOList) {
1552
1465
  const { type } = activityTemplateDTO;
1553
- let currentTaxonomyMap;
1466
+ let currentDifficulty: string = "";
1554
1467
  if (type === "ORDERING") {
1555
- currentTaxonomyMap = taxonomyMap["orderingTaxonomyMap"];
1468
+ currentDifficulty = difficultyMap["orderingDifficulty"];
1556
1469
  } else if (type === "DROPDOWN") {
1557
- currentTaxonomyMap = taxonomyMap["dropdownTaxonomyMap"];
1470
+ currentDifficulty = difficultyMap["dropdownDifficulty"];
1558
1471
  } else if (type === "MCSA") {
1559
- currentTaxonomyMap = taxonomyMap["MCSATaxonomyMap"];
1472
+ currentDifficulty = difficultyMap["MCSADifficulty"];
1560
1473
  } else if (type === "MCMA") {
1561
- currentTaxonomyMap = taxonomyMap["MCMATaxonomyMap"];
1474
+ currentDifficulty = difficultyMap["MCMADifficulty"];
1562
1475
  } else if (type === "MATCHING") {
1563
- currentTaxonomyMap = taxonomyMap["matchingTaxonomyMap"];
1476
+ currentDifficulty = difficultyMap["matchingDifficulty"];
1564
1477
  } else if (type === "GROUPING") {
1565
- currentTaxonomyMap = taxonomyMap["groupingTaxonomyMap"];
1478
+ currentDifficulty = difficultyMap["groupingDifficulty"];
1566
1479
  } else if (type === "FILL_IN_THE_BLANKS") {
1567
- currentTaxonomyMap = taxonomyMap["fillInTheBlanksTaxonomyMap"];
1480
+ currentDifficulty = difficultyMap["fillInTheBlanksDifficulty"];
1568
1481
  } else if (type === "OPEN_ENDED") {
1569
- currentTaxonomyMap = taxonomyMap["openEndedTaxonomyMap"];
1482
+ currentDifficulty = difficultyMap["openEndedDifficulty"];
1570
1483
  } else if (type === "TRUE_FALSE") {
1571
- currentTaxonomyMap = taxonomyMap["trueFalseTaxonomyMap"];
1484
+ currentDifficulty = difficultyMap["trueFalseDifficulty"];
1572
1485
  }
1573
1486
 
1574
- const {
1575
- type: taxonomyType,
1576
- groupName: taxonomyGroupName,
1577
- name: taxonomyName,
1578
- } = currentTaxonomyMap;
1579
- const taxonomyString =
1580
- taxonomyType.toLowerCase() +
1581
- taxonomyGroupName.toLowerCase().charAt(0).toUpperCase() +
1582
- taxonomyGroupName.toLowerCase().substring(1) +
1583
- taxonomyName.toLowerCase().charAt(0).toUpperCase() +
1584
- taxonomyName.toLowerCase().substring(1);
1585
-
1586
- const currentTaxonomyScore = foundModel[taxonomyString];
1487
+ const currentDifficultyScore = foundModel[currentDifficulty];
1587
1488
  const splittedTypeList = type.split("_");
1588
1489
  let activityTemplateString = "";
1589
1490
  for (let i = 0; i < splittedTypeList.length; i++) {
@@ -1596,7 +1497,7 @@ export const findBestFitActivity = (
1596
1497
  }
1597
1498
  }
1598
1499
  const currentActivityTemplateScore = foundModel[activityTemplateString];
1599
- const currentScore = currentTaxonomyScore * currentActivityTemplateScore;
1500
+ const currentScore = currentDifficultyScore * currentActivityTemplateScore;
1600
1501
  activityTemplateValueMap[type] = currentScore;
1601
1502
  if (currentScore < bestScore) {
1602
1503
  bestScore = currentScore;
@@ -2389,3 +2290,30 @@ export const constructActivityItemListSolutionOnly = (solutionMap: any) => {
2389
2290
  });
2390
2291
  return itemList;
2391
2292
  };
2293
+
2294
+ export const retrieveDifficultyByActivityTypeFromData = (
2295
+ type: string,
2296
+ data: any
2297
+ ) => {
2298
+ let difficulty = "";
2299
+ if (type === "ORDERING") {
2300
+ difficulty = data["orderingDifficulty"];
2301
+ } else if (type === "DROPDOWN") {
2302
+ difficulty = data["dropdownDifficulty"];
2303
+ } else if (type === "MCSA") {
2304
+ difficulty = data["MCSADifficulty"];
2305
+ } else if (type === "MCMA") {
2306
+ difficulty = data["MCMADifficulty"];
2307
+ } else if (type === "MATCHING") {
2308
+ difficulty = data["matchingDifficulty"];
2309
+ } else if (type === "GROUPING") {
2310
+ difficulty = data["groupingDifficulty"];
2311
+ } else if (type === "FILL_IN_THE_BLANKS") {
2312
+ difficulty = data["fillInTheBlanksDifficulty"];
2313
+ } else if (type === "OPEN_ENDED") {
2314
+ difficulty = data["openEndedDifficulty"];
2315
+ } else if (type === "TRUE_FALSE") {
2316
+ difficulty = data["trueFalseDifficulty"];
2317
+ }
2318
+ return difficulty;
2319
+ };
@@ -1,16 +1,13 @@
1
1
  const NUMBER_OF_ACTIVITY_TEMPLATE = 9;
2
- const NUMBER_OF_TAXONOMY = 6;
3
- const INITIAL_TAXONOMY_VALUE = 1 / NUMBER_OF_TAXONOMY;
2
+ const NUMBER_OF_DIFFICULTY = 3;
3
+ const INITIAL_DIFFICULTY_VALUE = 1 / NUMBER_OF_DIFFICULTY;
4
4
  const INITIAL_TEMPLATE_VALUE = 1 / NUMBER_OF_ACTIVITY_TEMPLATE;
5
5
 
6
6
  export const constructBaseVerbalIndvidualModel = (userId: any) => {
7
7
  return {
8
- bloomBloomAnalyze: INITIAL_TAXONOMY_VALUE,
9
- bloomBloomApply: INITIAL_TAXONOMY_VALUE,
10
- bloomBloomCreate: INITIAL_TAXONOMY_VALUE,
11
- bloomBloomEvaluate: INITIAL_TAXONOMY_VALUE,
12
- bloomBloomRemember: INITIAL_TAXONOMY_VALUE,
13
- bloomBloomUnderstand: INITIAL_TAXONOMY_VALUE,
8
+ easy: INITIAL_DIFFICULTY_VALUE,
9
+ medium: INITIAL_DIFFICULTY_VALUE,
10
+ hard: INITIAL_DIFFICULTY_VALUE,
14
11
  dropdown: INITIAL_TEMPLATE_VALUE,
15
12
  coterieField: "VERBAL",
16
13
  fillInTheBlanks: INITIAL_TEMPLATE_VALUE,
@@ -27,12 +24,9 @@ export const constructBaseVerbalIndvidualModel = (userId: any) => {
27
24
 
28
25
  export const constructBaseNumericIndividualModel = (userId: any) => {
29
26
  return {
30
- bloomBloomAnalyze: INITIAL_TAXONOMY_VALUE,
31
- bloomBloomApply: INITIAL_TAXONOMY_VALUE,
32
- bloomBloomCreate: INITIAL_TAXONOMY_VALUE,
33
- bloomBloomEvaluate: INITIAL_TAXONOMY_VALUE,
34
- bloomBloomRemember: INITIAL_TAXONOMY_VALUE,
35
- bloomBloomUnderstand: INITIAL_TAXONOMY_VALUE,
27
+ easy: INITIAL_DIFFICULTY_VALUE,
28
+ medium: INITIAL_DIFFICULTY_VALUE,
29
+ hard: INITIAL_DIFFICULTY_VALUE,
36
30
  dropdown: INITIAL_TEMPLATE_VALUE,
37
31
  coterieField: "NUMERIC",
38
32
  fillInTheBlanks: INITIAL_TEMPLATE_VALUE,