mario-education 2.4.515-feedback → 2.4.517-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 +20 -2
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +20 -2
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6163,15 +6163,29 @@ var useCSVImport = function useCSVImport() {
|
|
|
6163
6163
|
|
|
6164
6164
|
var formData = new FormData();
|
|
6165
6165
|
formData.append("file", file, file.name);
|
|
6166
|
+
console.log("run");
|
|
6167
|
+
console.log("📌 Type run:", type.toString());
|
|
6166
6168
|
|
|
6167
6169
|
var _temp8 = function () {
|
|
6168
6170
|
if (type == CSVType.AllUser) {
|
|
6169
|
-
|
|
6171
|
+
console.log("📌 Type 1:", type.toString());
|
|
6172
|
+
return Promise.resolve(new Promise(function (resolve, reject) {
|
|
6173
|
+
var reader = new FileReader();
|
|
6174
|
+
|
|
6175
|
+
reader.onload = function () {
|
|
6176
|
+
return resolve(reader.result);
|
|
6177
|
+
};
|
|
6178
|
+
|
|
6179
|
+
reader.onerror = reject;
|
|
6180
|
+
reader.readAsText(file);
|
|
6181
|
+
})).then(function (fileTextRaw) {
|
|
6182
|
+
console.log("📌 fileTextRaw:", fileTextRaw);
|
|
6170
6183
|
var fileText = fileTextRaw.trim();
|
|
6171
6184
|
var headerIndex = 0;
|
|
6172
6185
|
var rows = fileText.split("\n").map(function (row) {
|
|
6173
6186
|
return row.trim();
|
|
6174
6187
|
});
|
|
6188
|
+
console.log("📌 rows:", rows);
|
|
6175
6189
|
|
|
6176
6190
|
for (var _i = 0; _i < rows.length; _i++) {
|
|
6177
6191
|
var cols = rows[_i].split(",");
|
|
@@ -6187,13 +6201,14 @@ var useCSVImport = function useCSVImport() {
|
|
|
6187
6201
|
}
|
|
6188
6202
|
|
|
6189
6203
|
fileText = rows.slice(headerIndex).join("\n");
|
|
6204
|
+
console.log("📌 fileText:", fileText);
|
|
6190
6205
|
var parsedData = Papa.parse(fileText, {
|
|
6191
6206
|
header: true,
|
|
6192
6207
|
skipEmptyLines: true
|
|
6193
6208
|
});
|
|
6194
6209
|
var header = parsedData.meta.fields;
|
|
6195
|
-
console.log("📌 CSV Header:", header);
|
|
6196
6210
|
var dataRows = parsedData.data;
|
|
6211
|
+
console.log("📌 dataRows:", dataRows);
|
|
6197
6212
|
var chunkSize = 20;
|
|
6198
6213
|
var chunks = [];
|
|
6199
6214
|
|
|
@@ -6220,6 +6235,8 @@ var useCSVImport = function useCSVImport() {
|
|
|
6220
6235
|
} else {
|
|
6221
6236
|
var _temp14 = function () {
|
|
6222
6237
|
if (isCheckDomainIBS) {
|
|
6238
|
+
console.log("📌 Type if:", type.toString());
|
|
6239
|
+
|
|
6223
6240
|
var _temp15 = function () {
|
|
6224
6241
|
if (type == CSVType.ClassReflection) {
|
|
6225
6242
|
return Promise.resolve(importClassReflectionCSV(formData)).then(function () {});
|
|
@@ -6228,6 +6245,7 @@ var useCSVImport = function useCSVImport() {
|
|
|
6228
6245
|
|
|
6229
6246
|
if (_temp15 && _temp15.then) return _temp15.then(function () {});
|
|
6230
6247
|
} else {
|
|
6248
|
+
console.log("📌 Type else:", type.toString());
|
|
6231
6249
|
return Promise.resolve(importCSV(formData, type.toString())).then(function () {});
|
|
6232
6250
|
}
|
|
6233
6251
|
}();
|