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 +10 -13
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +10 -13
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
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')
|
|
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
|
-
|
|
6180
|
-
|
|
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
|
|
6203
|
-
var chunkData = dataRows.slice(
|
|
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
|