catchup-library-web 2.0.15 → 2.0.17

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.js CHANGED
@@ -2374,36 +2374,37 @@ var retrieveCurrentDefaultDataMap = (activityTemplateType, activityData) => {
2374
2374
  return {};
2375
2375
  };
2376
2376
  var constructActivityAnswerMap = (activityTemplate, activityData) => {
2377
- if (activityTemplate.type === "ORDERING") {
2378
- activityData.orderingMaterialMap = JSON.parse(
2379
- activityData.orderingMaterialMap
2377
+ const type = activityTemplate.type;
2378
+ if (type === "ORDERING") {
2379
+ return retrieveDefaultOrderingDataMap(
2380
+ JSON.parse(activityData.orderingMaterialMap)
2380
2381
  );
2381
- } else if (activityTemplate.type === "DROPDOWN") {
2382
- activityData.dropdownMaterialMap = JSON.parse(
2383
- activityData.dropdownMaterialMap
2382
+ } else if (type === "DROPDOWN") {
2383
+ return retrieveDefaultDropdownMap(
2384
+ JSON.parse(activityData.dropdownMaterialMap)
2384
2385
  );
2385
- } else if (activityTemplate.type === "MCSA") {
2386
- activityData.MCSAMaterialMap = JSON.parse(activityData.MCSAMaterialMap);
2387
- } else if (activityTemplate.type === "MCMA") {
2388
- activityData.MCMAMaterialMap = JSON.parse(activityData.MCMAMaterialMap);
2389
- } else if (activityTemplate.type === "MATCHING") {
2390
- activityData.matchingMaterialMap = JSON.parse(
2391
- activityData.matchingMaterialMap
2386
+ } else if (type === "MCSA") {
2387
+ return retrieveDefaultMCSAMap(JSON.parse(activityData.MCSAMaterialMap));
2388
+ } else if (type === "MCMA") {
2389
+ return retrieveDefaultMCMAMap(JSON.parse(activityData.MCMAMaterialMap));
2390
+ } else if (type === "MATCHING") {
2391
+ return retrieveDefaultMatchingMap(
2392
+ JSON.parse(activityData.matchingMaterialMap)
2392
2393
  );
2393
- } else if (activityTemplate.type === "GROUPING") {
2394
- activityData.groupingMaterialMap = JSON.parse(
2395
- activityData.groupingMaterialMap
2394
+ } else if (type === "GROUPING") {
2395
+ return retrieveDefaultGroupingMap(
2396
+ JSON.parse(activityData.groupingMaterialMap)
2396
2397
  );
2397
- } else if (activityTemplate.type === "FILL_IN_THE_BLANKS") {
2398
- activityData.fillInTheBlanksMaterialMap = JSON.parse(
2399
- activityData.fillInTheBlanksMaterialMap
2398
+ } else if (type === "FILL_IN_THE_BLANKS") {
2399
+ return retrieveDefaultFillInTheBlanksMap(
2400
+ JSON.parse(activityData.fillInTheBlanksMaterialMap)
2400
2401
  );
2401
- } else if (activityTemplate.type === "OPEN_ENDED") {
2402
- activityData.openEndedMaterialMap = {};
2403
- } else if (activityTemplate.type === "TRUE_FALSE") {
2404
- activityData.trueFalseMaterialMap = { trueList: [], falseList: [] };
2402
+ } else if (type === "OPEN_ENDED") {
2403
+ return retrieveDefaultOpenEndedMap();
2404
+ } else if (type === "TRUE_FALSE") {
2405
+ return retrieveDefaultTrueFalseMap();
2405
2406
  }
2406
- return retrieveCurrentDefaultDataMap(activityTemplate.type, activityData);
2407
+ return {};
2407
2408
  };
2408
2409
  var ignoreMathematicalExpression = (inputText) => {
2409
2410
  return inputText.replaceAll("{", "").replaceAll("}", "").replaceAll("_", "").replaceAll("^", "").replaceAll("\\frac", "").replaceAll("\\text", "").replaceAll("\\sqrt", "");
package/dist/index.mjs CHANGED
@@ -2152,36 +2152,37 @@ var retrieveCurrentDefaultDataMap = (activityTemplateType, activityData) => {
2152
2152
  return {};
2153
2153
  };
2154
2154
  var constructActivityAnswerMap = (activityTemplate, activityData) => {
2155
- if (activityTemplate.type === "ORDERING") {
2156
- activityData.orderingMaterialMap = JSON.parse(
2157
- activityData.orderingMaterialMap
2155
+ const type = activityTemplate.type;
2156
+ if (type === "ORDERING") {
2157
+ return retrieveDefaultOrderingDataMap(
2158
+ JSON.parse(activityData.orderingMaterialMap)
2158
2159
  );
2159
- } else if (activityTemplate.type === "DROPDOWN") {
2160
- activityData.dropdownMaterialMap = JSON.parse(
2161
- activityData.dropdownMaterialMap
2160
+ } else if (type === "DROPDOWN") {
2161
+ return retrieveDefaultDropdownMap(
2162
+ JSON.parse(activityData.dropdownMaterialMap)
2162
2163
  );
2163
- } else if (activityTemplate.type === "MCSA") {
2164
- activityData.MCSAMaterialMap = JSON.parse(activityData.MCSAMaterialMap);
2165
- } else if (activityTemplate.type === "MCMA") {
2166
- activityData.MCMAMaterialMap = JSON.parse(activityData.MCMAMaterialMap);
2167
- } else if (activityTemplate.type === "MATCHING") {
2168
- activityData.matchingMaterialMap = JSON.parse(
2169
- activityData.matchingMaterialMap
2164
+ } else if (type === "MCSA") {
2165
+ return retrieveDefaultMCSAMap(JSON.parse(activityData.MCSAMaterialMap));
2166
+ } else if (type === "MCMA") {
2167
+ return retrieveDefaultMCMAMap(JSON.parse(activityData.MCMAMaterialMap));
2168
+ } else if (type === "MATCHING") {
2169
+ return retrieveDefaultMatchingMap(
2170
+ JSON.parse(activityData.matchingMaterialMap)
2170
2171
  );
2171
- } else if (activityTemplate.type === "GROUPING") {
2172
- activityData.groupingMaterialMap = JSON.parse(
2173
- activityData.groupingMaterialMap
2172
+ } else if (type === "GROUPING") {
2173
+ return retrieveDefaultGroupingMap(
2174
+ JSON.parse(activityData.groupingMaterialMap)
2174
2175
  );
2175
- } else if (activityTemplate.type === "FILL_IN_THE_BLANKS") {
2176
- activityData.fillInTheBlanksMaterialMap = JSON.parse(
2177
- activityData.fillInTheBlanksMaterialMap
2176
+ } else if (type === "FILL_IN_THE_BLANKS") {
2177
+ return retrieveDefaultFillInTheBlanksMap(
2178
+ JSON.parse(activityData.fillInTheBlanksMaterialMap)
2178
2179
  );
2179
- } else if (activityTemplate.type === "OPEN_ENDED") {
2180
- activityData.openEndedMaterialMap = {};
2181
- } else if (activityTemplate.type === "TRUE_FALSE") {
2182
- activityData.trueFalseMaterialMap = { trueList: [], falseList: [] };
2180
+ } else if (type === "OPEN_ENDED") {
2181
+ return retrieveDefaultOpenEndedMap();
2182
+ } else if (type === "TRUE_FALSE") {
2183
+ return retrieveDefaultTrueFalseMap();
2183
2184
  }
2184
- return retrieveCurrentDefaultDataMap(activityTemplate.type, activityData);
2185
+ return {};
2185
2186
  };
2186
2187
  var ignoreMathematicalExpression = (inputText) => {
2187
2188
  return inputText.replaceAll("{", "").replaceAll("}", "").replaceAll("_", "").replaceAll("^", "").replaceAll("\\frac", "").replaceAll("\\text", "").replaceAll("\\sqrt", "");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catchup-library-web",
3
- "version": "2.0.15",
3
+ "version": "2.0.17",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1209,36 +1209,38 @@ export const constructActivityAnswerMap = (
1209
1209
  activityTemplate: any,
1210
1210
  activityData: any
1211
1211
  ) => {
1212
- if (activityTemplate.type === "ORDERING") {
1213
- activityData.orderingMaterialMap = JSON.parse(
1214
- activityData.orderingMaterialMap
1215
- );
1216
- } else if (activityTemplate.type === "DROPDOWN") {
1217
- activityData.dropdownMaterialMap = JSON.parse(
1218
- activityData.dropdownMaterialMap
1219
- );
1220
- } else if (activityTemplate.type === "MCSA") {
1221
- activityData.MCSAMaterialMap = JSON.parse(activityData.MCSAMaterialMap);
1222
- } else if (activityTemplate.type === "MCMA") {
1223
- activityData.MCMAMaterialMap = JSON.parse(activityData.MCMAMaterialMap);
1224
- } else if (activityTemplate.type === "MATCHING") {
1225
- activityData.matchingMaterialMap = JSON.parse(
1226
- activityData.matchingMaterialMap
1227
- );
1228
- } else if (activityTemplate.type === "GROUPING") {
1229
- activityData.groupingMaterialMap = JSON.parse(
1230
- activityData.groupingMaterialMap
1231
- );
1232
- } else if (activityTemplate.type === "FILL_IN_THE_BLANKS") {
1233
- activityData.fillInTheBlanksMaterialMap = JSON.parse(
1234
- activityData.fillInTheBlanksMaterialMap
1212
+ const type = activityTemplate.type;
1213
+
1214
+ if (type === "ORDERING") {
1215
+ return retrieveDefaultOrderingDataMap(
1216
+ JSON.parse(activityData.orderingMaterialMap)
1217
+ );
1218
+ } else if (type === "DROPDOWN") {
1219
+ return retrieveDefaultDropdownMap(
1220
+ JSON.parse(activityData.dropdownMaterialMap)
1235
1221
  );
1236
- } else if (activityTemplate.type === "OPEN_ENDED") {
1237
- activityData.openEndedMaterialMap = {};
1238
- } else if (activityTemplate.type === "TRUE_FALSE") {
1239
- activityData.trueFalseMaterialMap = { trueList: [], falseList: [] };
1222
+ } else if (type === "MCSA") {
1223
+ return retrieveDefaultMCSAMap(JSON.parse(activityData.MCSAMaterialMap));
1224
+ } else if (type === "MCMA") {
1225
+ return retrieveDefaultMCMAMap(JSON.parse(activityData.MCMAMaterialMap));
1226
+ } else if (type === "MATCHING") {
1227
+ return retrieveDefaultMatchingMap(
1228
+ JSON.parse(activityData.matchingMaterialMap)
1229
+ );
1230
+ } else if (type === "GROUPING") {
1231
+ return retrieveDefaultGroupingMap(
1232
+ JSON.parse(activityData.groupingMaterialMap)
1233
+ );
1234
+ } else if (type === "FILL_IN_THE_BLANKS") {
1235
+ return retrieveDefaultFillInTheBlanksMap(
1236
+ JSON.parse(activityData.fillInTheBlanksMaterialMap)
1237
+ );
1238
+ } else if (type === "OPEN_ENDED") {
1239
+ return retrieveDefaultOpenEndedMap();
1240
+ } else if (type === "TRUE_FALSE") {
1241
+ return retrieveDefaultTrueFalseMap();
1240
1242
  }
1241
- return retrieveCurrentDefaultDataMap(activityTemplate.type, activityData);
1243
+ return {};
1242
1244
  };
1243
1245
 
1244
1246
  export const ignoreMathematicalExpression = (inputText: string) => {