mario-education 2.4.516-feedback → 2.4.518-feedback

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
@@ -6083,7 +6083,7 @@ var useCSVImport = function useCSVImport() {
6083
6083
  setStudentDataFile = _useState5[1];
6084
6084
 
6085
6085
  var domainName = window.location.hostname;
6086
- var isCheckDomainIBS = domainName.includes('isb') || domainName.includes('stage') || domainName.includes("localhost");
6086
+ var isCheckDomainIBS = domainName.includes('isb') || domainName.includes('stage');
6087
6087
 
6088
6088
  var _useState6 = React.useState(0),
6089
6089
  defaultTeacher = _useState6[0],
@@ -6170,37 +6170,34 @@ var useCSVImport = function useCSVImport() {
6170
6170
  if (type == CSVType.AllUser) {
6171
6171
  console.log("📌 Type 1:", type.toString());
6172
6172
  return Promise.resolve(file.text()).then(function (fileTextRaw) {
6173
+ console.log("📌 fileTextRaw:", fileTextRaw);
6173
6174
  var fileText = fileTextRaw.trim();
6174
- var headerIndex = 0;
6175
6175
  var rows = fileText.split("\n").map(function (row) {
6176
6176
  return row.trim();
6177
6177
  });
6178
-
6179
- for (var _i = 0; _i < rows.length; _i++) {
6180
- var cols = rows[_i].split(",");
6181
-
6182
- if (cols.includes("FirstName")) {
6183
- headerIndex = _i;
6184
- return;
6185
- }
6186
- }
6178
+ console.log("📌 rows:", rows);
6179
+ var headerIndex = rows.findIndex(function (row) {
6180
+ return row.split(",").includes("FirstName");
6181
+ });
6187
6182
 
6188
6183
  if (headerIndex === 0) {
6189
6184
  throw new Error("Invalid CSV: Missing header row.");
6190
6185
  }
6191
6186
 
6192
6187
  fileText = rows.slice(headerIndex).join("\n");
6188
+ console.log("📌 fileText:", fileText);
6193
6189
  var parsedData = Papa.parse(fileText, {
6194
6190
  header: true,
6195
6191
  skipEmptyLines: true
6196
6192
  });
6197
6193
  var header = parsedData.meta.fields;
6198
6194
  var dataRows = parsedData.data;
6195
+ console.log("📌 dataRows:", dataRows);
6199
6196
  var chunkSize = 20;
6200
6197
  var chunks = [];
6201
6198
 
6202
- for (var _i2 = 0; _i2 < dataRows.length; _i2 += chunkSize) {
6203
- var chunkData = dataRows.slice(_i2, _i2 + chunkSize);
6199
+ for (var _i = 0; _i < dataRows.length; _i += chunkSize) {
6200
+ var chunkData = dataRows.slice(_i, _i + chunkSize);
6204
6201
  var csvChunk = Papa.unparse({
6205
6202
  fields: header,
6206
6203
  data: chunkData