@thanh01.pmt/interactive-quiz-kit 1.0.72 → 1.0.73
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/ai.cjs +24 -14
- package/dist/ai.mjs +24 -14
- package/dist/authoring.cjs +24 -14
- package/dist/authoring.mjs +24 -14
- package/dist/react-ui.cjs +24 -14
- package/dist/react-ui.mjs +24 -14
- package/package.json +1 -1
package/dist/ai.cjs
CHANGED
|
@@ -2496,12 +2496,10 @@ function validateConsecutiveTypes(quizPlan) {
|
|
|
2496
2496
|
|
|
2497
2497
|
// src/services/TopicDataService.ts
|
|
2498
2498
|
var TopicDataService = class {
|
|
2499
|
-
// ... saveData, mergeData, getData, clearData methods remain the same ...
|
|
2500
2499
|
static saveData(data) {
|
|
2501
2500
|
try {
|
|
2502
2501
|
if (typeof window === "undefined") return;
|
|
2503
|
-
|
|
2504
|
-
localStorage.setItem(this.STORAGE_KEY, serializedData);
|
|
2502
|
+
localStorage.setItem(this.STORAGE_KEY, JSON.stringify(data));
|
|
2505
2503
|
} catch (error) {
|
|
2506
2504
|
console.error("Error saving learning objectives to Local Storage:", error);
|
|
2507
2505
|
}
|
|
@@ -2512,8 +2510,7 @@ var TopicDataService = class {
|
|
|
2512
2510
|
newData.forEach((newLo) => {
|
|
2513
2511
|
loMap.set(newLo.code, newLo);
|
|
2514
2512
|
});
|
|
2515
|
-
|
|
2516
|
-
this.saveData(mergedData);
|
|
2513
|
+
this.saveData(Array.from(loMap.values()));
|
|
2517
2514
|
}
|
|
2518
2515
|
static getData() {
|
|
2519
2516
|
try {
|
|
@@ -2528,7 +2525,7 @@ var TopicDataService = class {
|
|
|
2528
2525
|
}
|
|
2529
2526
|
static clearData() {
|
|
2530
2527
|
try {
|
|
2531
|
-
if (typeof window
|
|
2528
|
+
if (typeof window !== "undefined") return;
|
|
2532
2529
|
localStorage.removeItem(this.STORAGE_KEY);
|
|
2533
2530
|
} catch (error) {
|
|
2534
2531
|
console.error("Error clearing learning objectives from Local Storage:", error);
|
|
@@ -2542,6 +2539,12 @@ var TopicDataService = class {
|
|
|
2542
2539
|
const headerLine = lines.shift();
|
|
2543
2540
|
const headers = headerLine.split(" ").map((h) => h.trim());
|
|
2544
2541
|
const headerMap = headers.map((h) => this.HEADER_MAP[h] || null);
|
|
2542
|
+
const requiredHeaders = ["LO ID", "LO Name", "Subject", "Subject Code", "Category", "Category Code", "Topic", "Topic Code", "Grade", "Grade Code"];
|
|
2543
|
+
const missingHeaders = requiredHeaders.filter((h) => !headers.includes(h));
|
|
2544
|
+
if (missingHeaders.length > 0) {
|
|
2545
|
+
const errorMsg = `Invalid TSV header. Missing required columns: ${missingHeaders.join(", ")}`;
|
|
2546
|
+
return { data: [], errors: [errorMsg] };
|
|
2547
|
+
}
|
|
2545
2548
|
const data = [];
|
|
2546
2549
|
const errors = [];
|
|
2547
2550
|
lines.forEach((line, index) => {
|
|
@@ -2550,29 +2553,30 @@ var TopicDataService = class {
|
|
|
2550
2553
|
headerMap.forEach((propName, i) => {
|
|
2551
2554
|
if (propName) {
|
|
2552
2555
|
const value = values[i]?.trim() || "";
|
|
2553
|
-
if (
|
|
2556
|
+
if (["keywords", "stemElements", "bloomLevelsGuideline"].includes(propName)) {
|
|
2554
2557
|
rowObject[propName] = value.split(",").map((s) => s.trim()).filter(Boolean);
|
|
2555
2558
|
} else {
|
|
2556
2559
|
rowObject[propName] = value;
|
|
2557
2560
|
}
|
|
2558
2561
|
}
|
|
2559
2562
|
});
|
|
2560
|
-
if (!rowObject.code) {
|
|
2561
|
-
errors.push(`Line ${index + 2}: Missing required
|
|
2563
|
+
if (!rowObject.code || !rowObject.name) {
|
|
2564
|
+
errors.push(`Line ${index + 2}: Missing required values for 'LO ID' or 'LO Name'.`);
|
|
2562
2565
|
return;
|
|
2563
2566
|
}
|
|
2564
|
-
if (!rowObject.name) {
|
|
2565
|
-
rowObject.name = rowObject.code;
|
|
2566
|
-
}
|
|
2567
2567
|
const learningObjective = {
|
|
2568
2568
|
id: generateUniqueId("lo_"),
|
|
2569
2569
|
code: rowObject.code,
|
|
2570
2570
|
name: rowObject.name,
|
|
2571
2571
|
description: rowObject.description,
|
|
2572
2572
|
subject: rowObject.subject || "",
|
|
2573
|
+
subjectCode: rowObject.subjectCode,
|
|
2573
2574
|
category: rowObject.category || "",
|
|
2575
|
+
categoryCode: rowObject.categoryCode,
|
|
2574
2576
|
topic: rowObject.topic || "",
|
|
2577
|
+
topicCode: rowObject.topicCode,
|
|
2575
2578
|
grade: rowObject.grade || "",
|
|
2579
|
+
gradeCode: rowObject.gradeCode,
|
|
2576
2580
|
keywords: rowObject.keywords || [],
|
|
2577
2581
|
stemElements: rowObject.stemElements || [],
|
|
2578
2582
|
bloomLevelsGuideline: rowObject.bloomLevelsGuideline || []
|
|
@@ -2603,17 +2607,23 @@ var TopicDataService = class {
|
|
|
2603
2607
|
}
|
|
2604
2608
|
};
|
|
2605
2609
|
TopicDataService.STORAGE_KEY = "interactive_quiz_kit_learning_objectives";
|
|
2606
|
-
// Define a map for flexible header mapping
|
|
2607
2610
|
TopicDataService.HEADER_MAP = {
|
|
2608
2611
|
"LO ID": "code",
|
|
2609
2612
|
"LO Name": "name",
|
|
2610
|
-
// Ready for future addition
|
|
2611
2613
|
"LO Description": "description",
|
|
2612
2614
|
"Subject": "subject",
|
|
2615
|
+
"Subject Code": "subjectCode",
|
|
2616
|
+
// New
|
|
2613
2617
|
"Category": "category",
|
|
2618
|
+
"Category Code": "categoryCode",
|
|
2619
|
+
// New
|
|
2614
2620
|
"Topic": "topic",
|
|
2621
|
+
"Topic Code": "topicCode",
|
|
2622
|
+
// New
|
|
2615
2623
|
"Keywords": "keywords",
|
|
2616
2624
|
"Grade": "grade",
|
|
2625
|
+
"Grade Code": "gradeCode",
|
|
2626
|
+
// New
|
|
2617
2627
|
"STEM Element(s)": "stemElements",
|
|
2618
2628
|
"Bloom\u2019s Level(s) Guideline": "bloomLevelsGuideline"
|
|
2619
2629
|
};
|
package/dist/ai.mjs
CHANGED
|
@@ -2494,12 +2494,10 @@ function validateConsecutiveTypes(quizPlan) {
|
|
|
2494
2494
|
|
|
2495
2495
|
// src/services/TopicDataService.ts
|
|
2496
2496
|
var TopicDataService = class {
|
|
2497
|
-
// ... saveData, mergeData, getData, clearData methods remain the same ...
|
|
2498
2497
|
static saveData(data) {
|
|
2499
2498
|
try {
|
|
2500
2499
|
if (typeof window === "undefined") return;
|
|
2501
|
-
|
|
2502
|
-
localStorage.setItem(this.STORAGE_KEY, serializedData);
|
|
2500
|
+
localStorage.setItem(this.STORAGE_KEY, JSON.stringify(data));
|
|
2503
2501
|
} catch (error) {
|
|
2504
2502
|
console.error("Error saving learning objectives to Local Storage:", error);
|
|
2505
2503
|
}
|
|
@@ -2510,8 +2508,7 @@ var TopicDataService = class {
|
|
|
2510
2508
|
newData.forEach((newLo) => {
|
|
2511
2509
|
loMap.set(newLo.code, newLo);
|
|
2512
2510
|
});
|
|
2513
|
-
|
|
2514
|
-
this.saveData(mergedData);
|
|
2511
|
+
this.saveData(Array.from(loMap.values()));
|
|
2515
2512
|
}
|
|
2516
2513
|
static getData() {
|
|
2517
2514
|
try {
|
|
@@ -2526,7 +2523,7 @@ var TopicDataService = class {
|
|
|
2526
2523
|
}
|
|
2527
2524
|
static clearData() {
|
|
2528
2525
|
try {
|
|
2529
|
-
if (typeof window
|
|
2526
|
+
if (typeof window !== "undefined") return;
|
|
2530
2527
|
localStorage.removeItem(this.STORAGE_KEY);
|
|
2531
2528
|
} catch (error) {
|
|
2532
2529
|
console.error("Error clearing learning objectives from Local Storage:", error);
|
|
@@ -2540,6 +2537,12 @@ var TopicDataService = class {
|
|
|
2540
2537
|
const headerLine = lines.shift();
|
|
2541
2538
|
const headers = headerLine.split(" ").map((h) => h.trim());
|
|
2542
2539
|
const headerMap = headers.map((h) => this.HEADER_MAP[h] || null);
|
|
2540
|
+
const requiredHeaders = ["LO ID", "LO Name", "Subject", "Subject Code", "Category", "Category Code", "Topic", "Topic Code", "Grade", "Grade Code"];
|
|
2541
|
+
const missingHeaders = requiredHeaders.filter((h) => !headers.includes(h));
|
|
2542
|
+
if (missingHeaders.length > 0) {
|
|
2543
|
+
const errorMsg = `Invalid TSV header. Missing required columns: ${missingHeaders.join(", ")}`;
|
|
2544
|
+
return { data: [], errors: [errorMsg] };
|
|
2545
|
+
}
|
|
2543
2546
|
const data = [];
|
|
2544
2547
|
const errors = [];
|
|
2545
2548
|
lines.forEach((line, index) => {
|
|
@@ -2548,29 +2551,30 @@ var TopicDataService = class {
|
|
|
2548
2551
|
headerMap.forEach((propName, i) => {
|
|
2549
2552
|
if (propName) {
|
|
2550
2553
|
const value = values[i]?.trim() || "";
|
|
2551
|
-
if (
|
|
2554
|
+
if (["keywords", "stemElements", "bloomLevelsGuideline"].includes(propName)) {
|
|
2552
2555
|
rowObject[propName] = value.split(",").map((s) => s.trim()).filter(Boolean);
|
|
2553
2556
|
} else {
|
|
2554
2557
|
rowObject[propName] = value;
|
|
2555
2558
|
}
|
|
2556
2559
|
}
|
|
2557
2560
|
});
|
|
2558
|
-
if (!rowObject.code) {
|
|
2559
|
-
errors.push(`Line ${index + 2}: Missing required
|
|
2561
|
+
if (!rowObject.code || !rowObject.name) {
|
|
2562
|
+
errors.push(`Line ${index + 2}: Missing required values for 'LO ID' or 'LO Name'.`);
|
|
2560
2563
|
return;
|
|
2561
2564
|
}
|
|
2562
|
-
if (!rowObject.name) {
|
|
2563
|
-
rowObject.name = rowObject.code;
|
|
2564
|
-
}
|
|
2565
2565
|
const learningObjective = {
|
|
2566
2566
|
id: generateUniqueId("lo_"),
|
|
2567
2567
|
code: rowObject.code,
|
|
2568
2568
|
name: rowObject.name,
|
|
2569
2569
|
description: rowObject.description,
|
|
2570
2570
|
subject: rowObject.subject || "",
|
|
2571
|
+
subjectCode: rowObject.subjectCode,
|
|
2571
2572
|
category: rowObject.category || "",
|
|
2573
|
+
categoryCode: rowObject.categoryCode,
|
|
2572
2574
|
topic: rowObject.topic || "",
|
|
2575
|
+
topicCode: rowObject.topicCode,
|
|
2573
2576
|
grade: rowObject.grade || "",
|
|
2577
|
+
gradeCode: rowObject.gradeCode,
|
|
2574
2578
|
keywords: rowObject.keywords || [],
|
|
2575
2579
|
stemElements: rowObject.stemElements || [],
|
|
2576
2580
|
bloomLevelsGuideline: rowObject.bloomLevelsGuideline || []
|
|
@@ -2601,17 +2605,23 @@ var TopicDataService = class {
|
|
|
2601
2605
|
}
|
|
2602
2606
|
};
|
|
2603
2607
|
TopicDataService.STORAGE_KEY = "interactive_quiz_kit_learning_objectives";
|
|
2604
|
-
// Define a map for flexible header mapping
|
|
2605
2608
|
TopicDataService.HEADER_MAP = {
|
|
2606
2609
|
"LO ID": "code",
|
|
2607
2610
|
"LO Name": "name",
|
|
2608
|
-
// Ready for future addition
|
|
2609
2611
|
"LO Description": "description",
|
|
2610
2612
|
"Subject": "subject",
|
|
2613
|
+
"Subject Code": "subjectCode",
|
|
2614
|
+
// New
|
|
2611
2615
|
"Category": "category",
|
|
2616
|
+
"Category Code": "categoryCode",
|
|
2617
|
+
// New
|
|
2612
2618
|
"Topic": "topic",
|
|
2619
|
+
"Topic Code": "topicCode",
|
|
2620
|
+
// New
|
|
2613
2621
|
"Keywords": "keywords",
|
|
2614
2622
|
"Grade": "grade",
|
|
2623
|
+
"Grade Code": "gradeCode",
|
|
2624
|
+
// New
|
|
2615
2625
|
"STEM Element(s)": "stemElements",
|
|
2616
2626
|
"Bloom\u2019s Level(s) Guideline": "bloomLevelsGuideline"
|
|
2617
2627
|
};
|
package/dist/authoring.cjs
CHANGED
|
@@ -8832,12 +8832,10 @@ init_react_shim();
|
|
|
8832
8832
|
// src/services/TopicDataService.ts
|
|
8833
8833
|
init_react_shim();
|
|
8834
8834
|
var TopicDataService = class {
|
|
8835
|
-
// ... saveData, mergeData, getData, clearData methods remain the same ...
|
|
8836
8835
|
static saveData(data) {
|
|
8837
8836
|
try {
|
|
8838
8837
|
if (typeof window === "undefined") return;
|
|
8839
|
-
|
|
8840
|
-
localStorage.setItem(this.STORAGE_KEY, serializedData);
|
|
8838
|
+
localStorage.setItem(this.STORAGE_KEY, JSON.stringify(data));
|
|
8841
8839
|
} catch (error) {
|
|
8842
8840
|
console.error("Error saving learning objectives to Local Storage:", error);
|
|
8843
8841
|
}
|
|
@@ -8848,8 +8846,7 @@ var TopicDataService = class {
|
|
|
8848
8846
|
newData.forEach((newLo) => {
|
|
8849
8847
|
loMap.set(newLo.code, newLo);
|
|
8850
8848
|
});
|
|
8851
|
-
|
|
8852
|
-
this.saveData(mergedData);
|
|
8849
|
+
this.saveData(Array.from(loMap.values()));
|
|
8853
8850
|
}
|
|
8854
8851
|
static getData() {
|
|
8855
8852
|
try {
|
|
@@ -8864,7 +8861,7 @@ var TopicDataService = class {
|
|
|
8864
8861
|
}
|
|
8865
8862
|
static clearData() {
|
|
8866
8863
|
try {
|
|
8867
|
-
if (typeof window
|
|
8864
|
+
if (typeof window !== "undefined") return;
|
|
8868
8865
|
localStorage.removeItem(this.STORAGE_KEY);
|
|
8869
8866
|
} catch (error) {
|
|
8870
8867
|
console.error("Error clearing learning objectives from Local Storage:", error);
|
|
@@ -8878,6 +8875,12 @@ var TopicDataService = class {
|
|
|
8878
8875
|
const headerLine = lines.shift();
|
|
8879
8876
|
const headers = headerLine.split(" ").map((h2) => h2.trim());
|
|
8880
8877
|
const headerMap = headers.map((h2) => this.HEADER_MAP[h2] || null);
|
|
8878
|
+
const requiredHeaders = ["LO ID", "LO Name", "Subject", "Subject Code", "Category", "Category Code", "Topic", "Topic Code", "Grade", "Grade Code"];
|
|
8879
|
+
const missingHeaders = requiredHeaders.filter((h2) => !headers.includes(h2));
|
|
8880
|
+
if (missingHeaders.length > 0) {
|
|
8881
|
+
const errorMsg = `Invalid TSV header. Missing required columns: ${missingHeaders.join(", ")}`;
|
|
8882
|
+
return { data: [], errors: [errorMsg] };
|
|
8883
|
+
}
|
|
8881
8884
|
const data = [];
|
|
8882
8885
|
const errors2 = [];
|
|
8883
8886
|
lines.forEach((line, index3) => {
|
|
@@ -8886,29 +8889,30 @@ var TopicDataService = class {
|
|
|
8886
8889
|
headerMap.forEach((propName, i) => {
|
|
8887
8890
|
if (propName) {
|
|
8888
8891
|
const value = values[i]?.trim() || "";
|
|
8889
|
-
if (
|
|
8892
|
+
if (["keywords", "stemElements", "bloomLevelsGuideline"].includes(propName)) {
|
|
8890
8893
|
rowObject[propName] = value.split(",").map((s2) => s2.trim()).filter(Boolean);
|
|
8891
8894
|
} else {
|
|
8892
8895
|
rowObject[propName] = value;
|
|
8893
8896
|
}
|
|
8894
8897
|
}
|
|
8895
8898
|
});
|
|
8896
|
-
if (!rowObject.code) {
|
|
8897
|
-
errors2.push(`Line ${index3 + 2}: Missing required
|
|
8899
|
+
if (!rowObject.code || !rowObject.name) {
|
|
8900
|
+
errors2.push(`Line ${index3 + 2}: Missing required values for 'LO ID' or 'LO Name'.`);
|
|
8898
8901
|
return;
|
|
8899
8902
|
}
|
|
8900
|
-
if (!rowObject.name) {
|
|
8901
|
-
rowObject.name = rowObject.code;
|
|
8902
|
-
}
|
|
8903
8903
|
const learningObjective = {
|
|
8904
8904
|
id: generateUniqueId("lo_"),
|
|
8905
8905
|
code: rowObject.code,
|
|
8906
8906
|
name: rowObject.name,
|
|
8907
8907
|
description: rowObject.description,
|
|
8908
8908
|
subject: rowObject.subject || "",
|
|
8909
|
+
subjectCode: rowObject.subjectCode,
|
|
8909
8910
|
category: rowObject.category || "",
|
|
8911
|
+
categoryCode: rowObject.categoryCode,
|
|
8910
8912
|
topic: rowObject.topic || "",
|
|
8913
|
+
topicCode: rowObject.topicCode,
|
|
8911
8914
|
grade: rowObject.grade || "",
|
|
8915
|
+
gradeCode: rowObject.gradeCode,
|
|
8912
8916
|
keywords: rowObject.keywords || [],
|
|
8913
8917
|
stemElements: rowObject.stemElements || [],
|
|
8914
8918
|
bloomLevelsGuideline: rowObject.bloomLevelsGuideline || []
|
|
@@ -8939,17 +8943,23 @@ var TopicDataService = class {
|
|
|
8939
8943
|
}
|
|
8940
8944
|
};
|
|
8941
8945
|
TopicDataService.STORAGE_KEY = "interactive_quiz_kit_learning_objectives";
|
|
8942
|
-
// Define a map for flexible header mapping
|
|
8943
8946
|
TopicDataService.HEADER_MAP = {
|
|
8944
8947
|
"LO ID": "code",
|
|
8945
8948
|
"LO Name": "name",
|
|
8946
|
-
// Ready for future addition
|
|
8947
8949
|
"LO Description": "description",
|
|
8948
8950
|
"Subject": "subject",
|
|
8951
|
+
"Subject Code": "subjectCode",
|
|
8952
|
+
// New
|
|
8949
8953
|
"Category": "category",
|
|
8954
|
+
"Category Code": "categoryCode",
|
|
8955
|
+
// New
|
|
8950
8956
|
"Topic": "topic",
|
|
8957
|
+
"Topic Code": "topicCode",
|
|
8958
|
+
// New
|
|
8951
8959
|
"Keywords": "keywords",
|
|
8952
8960
|
"Grade": "grade",
|
|
8961
|
+
"Grade Code": "gradeCode",
|
|
8962
|
+
// New
|
|
8953
8963
|
"STEM Element(s)": "stemElements",
|
|
8954
8964
|
"Bloom\u2019s Level(s) Guideline": "bloomLevelsGuideline"
|
|
8955
8965
|
};
|
package/dist/authoring.mjs
CHANGED
|
@@ -8767,12 +8767,10 @@ init_react_shim();
|
|
|
8767
8767
|
// src/services/TopicDataService.ts
|
|
8768
8768
|
init_react_shim();
|
|
8769
8769
|
var TopicDataService = class {
|
|
8770
|
-
// ... saveData, mergeData, getData, clearData methods remain the same ...
|
|
8771
8770
|
static saveData(data) {
|
|
8772
8771
|
try {
|
|
8773
8772
|
if (typeof window === "undefined") return;
|
|
8774
|
-
|
|
8775
|
-
localStorage.setItem(this.STORAGE_KEY, serializedData);
|
|
8773
|
+
localStorage.setItem(this.STORAGE_KEY, JSON.stringify(data));
|
|
8776
8774
|
} catch (error) {
|
|
8777
8775
|
console.error("Error saving learning objectives to Local Storage:", error);
|
|
8778
8776
|
}
|
|
@@ -8783,8 +8781,7 @@ var TopicDataService = class {
|
|
|
8783
8781
|
newData.forEach((newLo) => {
|
|
8784
8782
|
loMap.set(newLo.code, newLo);
|
|
8785
8783
|
});
|
|
8786
|
-
|
|
8787
|
-
this.saveData(mergedData);
|
|
8784
|
+
this.saveData(Array.from(loMap.values()));
|
|
8788
8785
|
}
|
|
8789
8786
|
static getData() {
|
|
8790
8787
|
try {
|
|
@@ -8799,7 +8796,7 @@ var TopicDataService = class {
|
|
|
8799
8796
|
}
|
|
8800
8797
|
static clearData() {
|
|
8801
8798
|
try {
|
|
8802
|
-
if (typeof window
|
|
8799
|
+
if (typeof window !== "undefined") return;
|
|
8803
8800
|
localStorage.removeItem(this.STORAGE_KEY);
|
|
8804
8801
|
} catch (error) {
|
|
8805
8802
|
console.error("Error clearing learning objectives from Local Storage:", error);
|
|
@@ -8813,6 +8810,12 @@ var TopicDataService = class {
|
|
|
8813
8810
|
const headerLine = lines.shift();
|
|
8814
8811
|
const headers = headerLine.split(" ").map((h2) => h2.trim());
|
|
8815
8812
|
const headerMap = headers.map((h2) => this.HEADER_MAP[h2] || null);
|
|
8813
|
+
const requiredHeaders = ["LO ID", "LO Name", "Subject", "Subject Code", "Category", "Category Code", "Topic", "Topic Code", "Grade", "Grade Code"];
|
|
8814
|
+
const missingHeaders = requiredHeaders.filter((h2) => !headers.includes(h2));
|
|
8815
|
+
if (missingHeaders.length > 0) {
|
|
8816
|
+
const errorMsg = `Invalid TSV header. Missing required columns: ${missingHeaders.join(", ")}`;
|
|
8817
|
+
return { data: [], errors: [errorMsg] };
|
|
8818
|
+
}
|
|
8816
8819
|
const data = [];
|
|
8817
8820
|
const errors2 = [];
|
|
8818
8821
|
lines.forEach((line, index3) => {
|
|
@@ -8821,29 +8824,30 @@ var TopicDataService = class {
|
|
|
8821
8824
|
headerMap.forEach((propName, i) => {
|
|
8822
8825
|
if (propName) {
|
|
8823
8826
|
const value = values[i]?.trim() || "";
|
|
8824
|
-
if (
|
|
8827
|
+
if (["keywords", "stemElements", "bloomLevelsGuideline"].includes(propName)) {
|
|
8825
8828
|
rowObject[propName] = value.split(",").map((s2) => s2.trim()).filter(Boolean);
|
|
8826
8829
|
} else {
|
|
8827
8830
|
rowObject[propName] = value;
|
|
8828
8831
|
}
|
|
8829
8832
|
}
|
|
8830
8833
|
});
|
|
8831
|
-
if (!rowObject.code) {
|
|
8832
|
-
errors2.push(`Line ${index3 + 2}: Missing required
|
|
8834
|
+
if (!rowObject.code || !rowObject.name) {
|
|
8835
|
+
errors2.push(`Line ${index3 + 2}: Missing required values for 'LO ID' or 'LO Name'.`);
|
|
8833
8836
|
return;
|
|
8834
8837
|
}
|
|
8835
|
-
if (!rowObject.name) {
|
|
8836
|
-
rowObject.name = rowObject.code;
|
|
8837
|
-
}
|
|
8838
8838
|
const learningObjective = {
|
|
8839
8839
|
id: generateUniqueId("lo_"),
|
|
8840
8840
|
code: rowObject.code,
|
|
8841
8841
|
name: rowObject.name,
|
|
8842
8842
|
description: rowObject.description,
|
|
8843
8843
|
subject: rowObject.subject || "",
|
|
8844
|
+
subjectCode: rowObject.subjectCode,
|
|
8844
8845
|
category: rowObject.category || "",
|
|
8846
|
+
categoryCode: rowObject.categoryCode,
|
|
8845
8847
|
topic: rowObject.topic || "",
|
|
8848
|
+
topicCode: rowObject.topicCode,
|
|
8846
8849
|
grade: rowObject.grade || "",
|
|
8850
|
+
gradeCode: rowObject.gradeCode,
|
|
8847
8851
|
keywords: rowObject.keywords || [],
|
|
8848
8852
|
stemElements: rowObject.stemElements || [],
|
|
8849
8853
|
bloomLevelsGuideline: rowObject.bloomLevelsGuideline || []
|
|
@@ -8874,17 +8878,23 @@ var TopicDataService = class {
|
|
|
8874
8878
|
}
|
|
8875
8879
|
};
|
|
8876
8880
|
TopicDataService.STORAGE_KEY = "interactive_quiz_kit_learning_objectives";
|
|
8877
|
-
// Define a map for flexible header mapping
|
|
8878
8881
|
TopicDataService.HEADER_MAP = {
|
|
8879
8882
|
"LO ID": "code",
|
|
8880
8883
|
"LO Name": "name",
|
|
8881
|
-
// Ready for future addition
|
|
8882
8884
|
"LO Description": "description",
|
|
8883
8885
|
"Subject": "subject",
|
|
8886
|
+
"Subject Code": "subjectCode",
|
|
8887
|
+
// New
|
|
8884
8888
|
"Category": "category",
|
|
8889
|
+
"Category Code": "categoryCode",
|
|
8890
|
+
// New
|
|
8885
8891
|
"Topic": "topic",
|
|
8892
|
+
"Topic Code": "topicCode",
|
|
8893
|
+
// New
|
|
8886
8894
|
"Keywords": "keywords",
|
|
8887
8895
|
"Grade": "grade",
|
|
8896
|
+
"Grade Code": "gradeCode",
|
|
8897
|
+
// New
|
|
8888
8898
|
"STEM Element(s)": "stemElements",
|
|
8889
8899
|
"Bloom\u2019s Level(s) Guideline": "bloomLevelsGuideline"
|
|
8890
8900
|
};
|
package/dist/react-ui.cjs
CHANGED
|
@@ -101917,12 +101917,10 @@ init_react_shim();
|
|
|
101917
101917
|
// src/services/TopicDataService.ts
|
|
101918
101918
|
init_react_shim();
|
|
101919
101919
|
var TopicDataService = class {
|
|
101920
|
-
// ... saveData, mergeData, getData, clearData methods remain the same ...
|
|
101921
101920
|
static saveData(data) {
|
|
101922
101921
|
try {
|
|
101923
101922
|
if (typeof window === "undefined") return;
|
|
101924
|
-
|
|
101925
|
-
localStorage.setItem(this.STORAGE_KEY, serializedData);
|
|
101923
|
+
localStorage.setItem(this.STORAGE_KEY, JSON.stringify(data));
|
|
101926
101924
|
} catch (error) {
|
|
101927
101925
|
console.error("Error saving learning objectives to Local Storage:", error);
|
|
101928
101926
|
}
|
|
@@ -101933,8 +101931,7 @@ var TopicDataService = class {
|
|
|
101933
101931
|
newData.forEach((newLo) => {
|
|
101934
101932
|
loMap.set(newLo.code, newLo);
|
|
101935
101933
|
});
|
|
101936
|
-
|
|
101937
|
-
this.saveData(mergedData);
|
|
101934
|
+
this.saveData(Array.from(loMap.values()));
|
|
101938
101935
|
}
|
|
101939
101936
|
static getData() {
|
|
101940
101937
|
try {
|
|
@@ -101949,7 +101946,7 @@ var TopicDataService = class {
|
|
|
101949
101946
|
}
|
|
101950
101947
|
static clearData() {
|
|
101951
101948
|
try {
|
|
101952
|
-
if (typeof window
|
|
101949
|
+
if (typeof window !== "undefined") return;
|
|
101953
101950
|
localStorage.removeItem(this.STORAGE_KEY);
|
|
101954
101951
|
} catch (error) {
|
|
101955
101952
|
console.error("Error clearing learning objectives from Local Storage:", error);
|
|
@@ -101963,6 +101960,12 @@ var TopicDataService = class {
|
|
|
101963
101960
|
const headerLine = lines.shift();
|
|
101964
101961
|
const headers = headerLine.split(" ").map((h3) => h3.trim());
|
|
101965
101962
|
const headerMap = headers.map((h3) => this.HEADER_MAP[h3] || null);
|
|
101963
|
+
const requiredHeaders = ["LO ID", "LO Name", "Subject", "Subject Code", "Category", "Category Code", "Topic", "Topic Code", "Grade", "Grade Code"];
|
|
101964
|
+
const missingHeaders = requiredHeaders.filter((h3) => !headers.includes(h3));
|
|
101965
|
+
if (missingHeaders.length > 0) {
|
|
101966
|
+
const errorMsg = `Invalid TSV header. Missing required columns: ${missingHeaders.join(", ")}`;
|
|
101967
|
+
return { data: [], errors: [errorMsg] };
|
|
101968
|
+
}
|
|
101966
101969
|
const data = [];
|
|
101967
101970
|
const errors2 = [];
|
|
101968
101971
|
lines.forEach((line, index3) => {
|
|
@@ -101971,29 +101974,30 @@ var TopicDataService = class {
|
|
|
101971
101974
|
headerMap.forEach((propName, i2) => {
|
|
101972
101975
|
if (propName) {
|
|
101973
101976
|
const value = values[i2]?.trim() || "";
|
|
101974
|
-
if (
|
|
101977
|
+
if (["keywords", "stemElements", "bloomLevelsGuideline"].includes(propName)) {
|
|
101975
101978
|
rowObject[propName] = value.split(",").map((s4) => s4.trim()).filter(Boolean);
|
|
101976
101979
|
} else {
|
|
101977
101980
|
rowObject[propName] = value;
|
|
101978
101981
|
}
|
|
101979
101982
|
}
|
|
101980
101983
|
});
|
|
101981
|
-
if (!rowObject.code) {
|
|
101982
|
-
errors2.push(`Line ${index3 + 2}: Missing required
|
|
101984
|
+
if (!rowObject.code || !rowObject.name) {
|
|
101985
|
+
errors2.push(`Line ${index3 + 2}: Missing required values for 'LO ID' or 'LO Name'.`);
|
|
101983
101986
|
return;
|
|
101984
101987
|
}
|
|
101985
|
-
if (!rowObject.name) {
|
|
101986
|
-
rowObject.name = rowObject.code;
|
|
101987
|
-
}
|
|
101988
101988
|
const learningObjective = {
|
|
101989
101989
|
id: generateUniqueId("lo_"),
|
|
101990
101990
|
code: rowObject.code,
|
|
101991
101991
|
name: rowObject.name,
|
|
101992
101992
|
description: rowObject.description,
|
|
101993
101993
|
subject: rowObject.subject || "",
|
|
101994
|
+
subjectCode: rowObject.subjectCode,
|
|
101994
101995
|
category: rowObject.category || "",
|
|
101996
|
+
categoryCode: rowObject.categoryCode,
|
|
101995
101997
|
topic: rowObject.topic || "",
|
|
101998
|
+
topicCode: rowObject.topicCode,
|
|
101996
101999
|
grade: rowObject.grade || "",
|
|
102000
|
+
gradeCode: rowObject.gradeCode,
|
|
101997
102001
|
keywords: rowObject.keywords || [],
|
|
101998
102002
|
stemElements: rowObject.stemElements || [],
|
|
101999
102003
|
bloomLevelsGuideline: rowObject.bloomLevelsGuideline || []
|
|
@@ -102024,17 +102028,23 @@ var TopicDataService = class {
|
|
|
102024
102028
|
}
|
|
102025
102029
|
};
|
|
102026
102030
|
TopicDataService.STORAGE_KEY = "interactive_quiz_kit_learning_objectives";
|
|
102027
|
-
// Define a map for flexible header mapping
|
|
102028
102031
|
TopicDataService.HEADER_MAP = {
|
|
102029
102032
|
"LO ID": "code",
|
|
102030
102033
|
"LO Name": "name",
|
|
102031
|
-
// Ready for future addition
|
|
102032
102034
|
"LO Description": "description",
|
|
102033
102035
|
"Subject": "subject",
|
|
102036
|
+
"Subject Code": "subjectCode",
|
|
102037
|
+
// New
|
|
102034
102038
|
"Category": "category",
|
|
102039
|
+
"Category Code": "categoryCode",
|
|
102040
|
+
// New
|
|
102035
102041
|
"Topic": "topic",
|
|
102042
|
+
"Topic Code": "topicCode",
|
|
102043
|
+
// New
|
|
102036
102044
|
"Keywords": "keywords",
|
|
102037
102045
|
"Grade": "grade",
|
|
102046
|
+
"Grade Code": "gradeCode",
|
|
102047
|
+
// New
|
|
102038
102048
|
"STEM Element(s)": "stemElements",
|
|
102039
102049
|
"Bloom\u2019s Level(s) Guideline": "bloomLevelsGuideline"
|
|
102040
102050
|
};
|
package/dist/react-ui.mjs
CHANGED
|
@@ -101851,12 +101851,10 @@ init_react_shim();
|
|
|
101851
101851
|
// src/services/TopicDataService.ts
|
|
101852
101852
|
init_react_shim();
|
|
101853
101853
|
var TopicDataService = class {
|
|
101854
|
-
// ... saveData, mergeData, getData, clearData methods remain the same ...
|
|
101855
101854
|
static saveData(data) {
|
|
101856
101855
|
try {
|
|
101857
101856
|
if (typeof window === "undefined") return;
|
|
101858
|
-
|
|
101859
|
-
localStorage.setItem(this.STORAGE_KEY, serializedData);
|
|
101857
|
+
localStorage.setItem(this.STORAGE_KEY, JSON.stringify(data));
|
|
101860
101858
|
} catch (error) {
|
|
101861
101859
|
console.error("Error saving learning objectives to Local Storage:", error);
|
|
101862
101860
|
}
|
|
@@ -101867,8 +101865,7 @@ var TopicDataService = class {
|
|
|
101867
101865
|
newData.forEach((newLo) => {
|
|
101868
101866
|
loMap.set(newLo.code, newLo);
|
|
101869
101867
|
});
|
|
101870
|
-
|
|
101871
|
-
this.saveData(mergedData);
|
|
101868
|
+
this.saveData(Array.from(loMap.values()));
|
|
101872
101869
|
}
|
|
101873
101870
|
static getData() {
|
|
101874
101871
|
try {
|
|
@@ -101883,7 +101880,7 @@ var TopicDataService = class {
|
|
|
101883
101880
|
}
|
|
101884
101881
|
static clearData() {
|
|
101885
101882
|
try {
|
|
101886
|
-
if (typeof window
|
|
101883
|
+
if (typeof window !== "undefined") return;
|
|
101887
101884
|
localStorage.removeItem(this.STORAGE_KEY);
|
|
101888
101885
|
} catch (error) {
|
|
101889
101886
|
console.error("Error clearing learning objectives from Local Storage:", error);
|
|
@@ -101897,6 +101894,12 @@ var TopicDataService = class {
|
|
|
101897
101894
|
const headerLine = lines.shift();
|
|
101898
101895
|
const headers = headerLine.split(" ").map((h3) => h3.trim());
|
|
101899
101896
|
const headerMap = headers.map((h3) => this.HEADER_MAP[h3] || null);
|
|
101897
|
+
const requiredHeaders = ["LO ID", "LO Name", "Subject", "Subject Code", "Category", "Category Code", "Topic", "Topic Code", "Grade", "Grade Code"];
|
|
101898
|
+
const missingHeaders = requiredHeaders.filter((h3) => !headers.includes(h3));
|
|
101899
|
+
if (missingHeaders.length > 0) {
|
|
101900
|
+
const errorMsg = `Invalid TSV header. Missing required columns: ${missingHeaders.join(", ")}`;
|
|
101901
|
+
return { data: [], errors: [errorMsg] };
|
|
101902
|
+
}
|
|
101900
101903
|
const data = [];
|
|
101901
101904
|
const errors2 = [];
|
|
101902
101905
|
lines.forEach((line, index3) => {
|
|
@@ -101905,29 +101908,30 @@ var TopicDataService = class {
|
|
|
101905
101908
|
headerMap.forEach((propName, i2) => {
|
|
101906
101909
|
if (propName) {
|
|
101907
101910
|
const value = values[i2]?.trim() || "";
|
|
101908
|
-
if (
|
|
101911
|
+
if (["keywords", "stemElements", "bloomLevelsGuideline"].includes(propName)) {
|
|
101909
101912
|
rowObject[propName] = value.split(",").map((s4) => s4.trim()).filter(Boolean);
|
|
101910
101913
|
} else {
|
|
101911
101914
|
rowObject[propName] = value;
|
|
101912
101915
|
}
|
|
101913
101916
|
}
|
|
101914
101917
|
});
|
|
101915
|
-
if (!rowObject.code) {
|
|
101916
|
-
errors2.push(`Line ${index3 + 2}: Missing required
|
|
101918
|
+
if (!rowObject.code || !rowObject.name) {
|
|
101919
|
+
errors2.push(`Line ${index3 + 2}: Missing required values for 'LO ID' or 'LO Name'.`);
|
|
101917
101920
|
return;
|
|
101918
101921
|
}
|
|
101919
|
-
if (!rowObject.name) {
|
|
101920
|
-
rowObject.name = rowObject.code;
|
|
101921
|
-
}
|
|
101922
101922
|
const learningObjective = {
|
|
101923
101923
|
id: generateUniqueId("lo_"),
|
|
101924
101924
|
code: rowObject.code,
|
|
101925
101925
|
name: rowObject.name,
|
|
101926
101926
|
description: rowObject.description,
|
|
101927
101927
|
subject: rowObject.subject || "",
|
|
101928
|
+
subjectCode: rowObject.subjectCode,
|
|
101928
101929
|
category: rowObject.category || "",
|
|
101930
|
+
categoryCode: rowObject.categoryCode,
|
|
101929
101931
|
topic: rowObject.topic || "",
|
|
101932
|
+
topicCode: rowObject.topicCode,
|
|
101930
101933
|
grade: rowObject.grade || "",
|
|
101934
|
+
gradeCode: rowObject.gradeCode,
|
|
101931
101935
|
keywords: rowObject.keywords || [],
|
|
101932
101936
|
stemElements: rowObject.stemElements || [],
|
|
101933
101937
|
bloomLevelsGuideline: rowObject.bloomLevelsGuideline || []
|
|
@@ -101958,17 +101962,23 @@ var TopicDataService = class {
|
|
|
101958
101962
|
}
|
|
101959
101963
|
};
|
|
101960
101964
|
TopicDataService.STORAGE_KEY = "interactive_quiz_kit_learning_objectives";
|
|
101961
|
-
// Define a map for flexible header mapping
|
|
101962
101965
|
TopicDataService.HEADER_MAP = {
|
|
101963
101966
|
"LO ID": "code",
|
|
101964
101967
|
"LO Name": "name",
|
|
101965
|
-
// Ready for future addition
|
|
101966
101968
|
"LO Description": "description",
|
|
101967
101969
|
"Subject": "subject",
|
|
101970
|
+
"Subject Code": "subjectCode",
|
|
101971
|
+
// New
|
|
101968
101972
|
"Category": "category",
|
|
101973
|
+
"Category Code": "categoryCode",
|
|
101974
|
+
// New
|
|
101969
101975
|
"Topic": "topic",
|
|
101976
|
+
"Topic Code": "topicCode",
|
|
101977
|
+
// New
|
|
101970
101978
|
"Keywords": "keywords",
|
|
101971
101979
|
"Grade": "grade",
|
|
101980
|
+
"Grade Code": "gradeCode",
|
|
101981
|
+
// New
|
|
101972
101982
|
"STEM Element(s)": "stemElements",
|
|
101973
101983
|
"Bloom\u2019s Level(s) Guideline": "bloomLevelsGuideline"
|
|
101974
101984
|
};
|
package/package.json
CHANGED