catchup-library-web 2.0.9 → 2.0.11

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 CHANGED
@@ -568,7 +568,7 @@ declare const constructActivityAnswerMap: (activityTemplate: any, activityData:
568
568
  declare const ignoreMathematicalExpression: (inputText: string) => string;
569
569
  declare const constructActivityAnswerStateList: (answerList: any[], activityList: any[]) => any;
570
570
  declare const retrieveActivityAnswerFromAnswerList: (answerList: any[], activity: any) => any;
571
- declare const checkActivityAnswerState: (answerList: any[], activity: any) => "NOT_EXISTS" | "ANSWERED" | "EMPTY";
571
+ declare const checkActivityAnswerState: (answerList: any[], activity: any) => "NOT_EXISTS" | "EMPTY" | "ANSWERED";
572
572
  declare const findBestFitActivity: (activity: any, individualModelList: any, outcomeModelList: any) => {
573
573
  bestScore: number;
574
574
  bestActivityTemplate: any;
package/dist/index.d.ts CHANGED
@@ -568,7 +568,7 @@ declare const constructActivityAnswerMap: (activityTemplate: any, activityData:
568
568
  declare const ignoreMathematicalExpression: (inputText: string) => string;
569
569
  declare const constructActivityAnswerStateList: (answerList: any[], activityList: any[]) => any;
570
570
  declare const retrieveActivityAnswerFromAnswerList: (answerList: any[], activity: any) => any;
571
- declare const checkActivityAnswerState: (answerList: any[], activity: any) => "NOT_EXISTS" | "ANSWERED" | "EMPTY";
571
+ declare const checkActivityAnswerState: (answerList: any[], activity: any) => "NOT_EXISTS" | "EMPTY" | "ANSWERED";
572
572
  declare const findBestFitActivity: (activity: any, individualModelList: any, outcomeModelList: any) => {
573
573
  bestScore: number;
574
574
  bestActivityTemplate: any;
package/dist/index.js CHANGED
@@ -2429,21 +2429,14 @@ var checkActivityAnswerState = (answerList, activity) => {
2429
2429
  answerList,
2430
2430
  activity
2431
2431
  );
2432
- if (!activityAnswer) {
2433
- return "NOT_EXISTS";
2434
- }
2432
+ if (!activityAnswer) return "NOT_EXISTS";
2435
2433
  const { data } = activityAnswer;
2436
2434
  if (!data) return "NOT_EXISTS";
2437
- const parsedData = JSON.parse(data);
2438
- if (parsedData.filter((item) => !item.isEmpty).length === parsedData.length) {
2439
- return "ANSWERED";
2440
- } else {
2441
- return "EMPTY";
2442
- }
2435
+ if (activityAnswer.isEmpty) return "EMPTY";
2436
+ return "ANSWERED";
2443
2437
  };
2444
2438
  var findBestFitActivity = (activity, individualModelList, outcomeModelList) => {
2445
2439
  const { activityTemplateDTOList, data, coterieType, categoryIdList } = activity;
2446
- const parsedData = JSON.parse(data);
2447
2440
  const {
2448
2441
  orderingDifficulty,
2449
2442
  dropdownDifficulty,
@@ -2454,7 +2447,7 @@ var findBestFitActivity = (activity, individualModelList, outcomeModelList) => {
2454
2447
  fillInTheBlanksDifficulty,
2455
2448
  openEndedDifficulty,
2456
2449
  trueFalseDifficulty
2457
- } = parsedData;
2450
+ } = data;
2458
2451
  const difficultyMap = {};
2459
2452
  if (orderingDifficulty) {
2460
2453
  difficultyMap["orderingDifficulty"] = orderingDifficulty;
package/dist/index.mjs CHANGED
@@ -2207,21 +2207,14 @@ var checkActivityAnswerState = (answerList, activity) => {
2207
2207
  answerList,
2208
2208
  activity
2209
2209
  );
2210
- if (!activityAnswer) {
2211
- return "NOT_EXISTS";
2212
- }
2210
+ if (!activityAnswer) return "NOT_EXISTS";
2213
2211
  const { data } = activityAnswer;
2214
2212
  if (!data) return "NOT_EXISTS";
2215
- const parsedData = JSON.parse(data);
2216
- if (parsedData.filter((item) => !item.isEmpty).length === parsedData.length) {
2217
- return "ANSWERED";
2218
- } else {
2219
- return "EMPTY";
2220
- }
2213
+ if (activityAnswer.isEmpty) return "EMPTY";
2214
+ return "ANSWERED";
2221
2215
  };
2222
2216
  var findBestFitActivity = (activity, individualModelList, outcomeModelList) => {
2223
2217
  const { activityTemplateDTOList, data, coterieType, categoryIdList } = activity;
2224
- const parsedData = JSON.parse(data);
2225
2218
  const {
2226
2219
  orderingDifficulty,
2227
2220
  dropdownDifficulty,
@@ -2232,7 +2225,7 @@ var findBestFitActivity = (activity, individualModelList, outcomeModelList) => {
2232
2225
  fillInTheBlanksDifficulty,
2233
2226
  openEndedDifficulty,
2234
2227
  trueFalseDifficulty
2235
- } = parsedData;
2228
+ } = data;
2236
2229
  const difficultyMap = {};
2237
2230
  if (orderingDifficulty) {
2238
2231
  difficultyMap["orderingDifficulty"] = orderingDifficulty;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catchup-library-web",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1281,19 +1281,11 @@ export const checkActivityAnswerState = (answerList: any[], activity: any) => {
1281
1281
  answerList,
1282
1282
  activity
1283
1283
  );
1284
- if (!activityAnswer) {
1285
- return "NOT_EXISTS";
1286
- }
1284
+ if (!activityAnswer) return "NOT_EXISTS";
1287
1285
  const { data } = activityAnswer;
1288
1286
  if (!data) return "NOT_EXISTS";
1289
- const parsedData = JSON.parse(data);
1290
- if (
1291
- parsedData.filter((item: any) => !item.isEmpty).length === parsedData.length
1292
- ) {
1293
- return "ANSWERED";
1294
- } else {
1295
- return "EMPTY";
1296
- }
1287
+ if (activityAnswer.isEmpty) return "EMPTY";
1288
+ return "ANSWERED";
1297
1289
  };
1298
1290
 
1299
1291
  export const findBestFitActivity = (
@@ -1303,7 +1295,6 @@ export const findBestFitActivity = (
1303
1295
  ) => {
1304
1296
  const { activityTemplateDTOList, data, coterieType, categoryIdList } =
1305
1297
  activity;
1306
- const parsedData = JSON.parse(data);
1307
1298
  const {
1308
1299
  orderingDifficulty,
1309
1300
  dropdownDifficulty,
@@ -1314,7 +1305,7 @@ export const findBestFitActivity = (
1314
1305
  fillInTheBlanksDifficulty,
1315
1306
  openEndedDifficulty,
1316
1307
  trueFalseDifficulty,
1317
- } = parsedData;
1308
+ } = data;
1318
1309
  const difficultyMap: any = {};
1319
1310
  if (orderingDifficulty) {
1320
1311
  difficultyMap["orderingDifficulty"] = orderingDifficulty;