@thanh01.pmt/interactive-quiz-kit 1.0.72 → 1.0.74
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 +89 -87
- package/dist/authoring.d.cts +1 -1
- package/dist/authoring.d.ts +1 -1
- package/dist/authoring.mjs +89 -87
- package/dist/react-ui.cjs +89 -87
- package/dist/react-ui.d.cts +1 -1
- package/dist/react-ui.d.ts +1 -1
- package/dist/react-ui.mjs +89 -87
- package/dist/{toaster-DAXYZdrz.d.ts → toaster-B2MPZYhi.d.ts} +2 -1
- package/dist/{toaster-6AR8w2TO.d.cts → toaster-Bvhmyef9.d.cts} +2 -1
- 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
|
};
|
|
@@ -71661,21 +71671,30 @@ var EditableCombobox = ({
|
|
|
71661
71671
|
disabled = false
|
|
71662
71672
|
}) => {
|
|
71663
71673
|
const [open, setOpen] = React119__namespace.useState(false);
|
|
71664
|
-
const [inputValue, setInputValue] = React119__namespace.useState(
|
|
71674
|
+
const [inputValue, setInputValue] = React119__namespace.useState("");
|
|
71665
71675
|
React119__namespace.useEffect(() => {
|
|
71666
|
-
|
|
71667
|
-
|
|
71668
|
-
|
|
71669
|
-
|
|
71670
|
-
|
|
71671
|
-
|
|
71676
|
+
if (value) {
|
|
71677
|
+
const selectedOption = options.find((option) => option.value.toLowerCase() === value.toLowerCase());
|
|
71678
|
+
setInputValue(selectedOption ? selectedOption.label : value);
|
|
71679
|
+
} else {
|
|
71680
|
+
setInputValue("");
|
|
71681
|
+
}
|
|
71682
|
+
}, [value, options, open]);
|
|
71683
|
+
const handleSelect = (selectedValue) => {
|
|
71684
|
+
onChange(selectedValue);
|
|
71672
71685
|
setOpen(false);
|
|
71673
71686
|
};
|
|
71674
|
-
const
|
|
71675
|
-
|
|
71687
|
+
const handleOpenChange = (isOpen) => {
|
|
71688
|
+
if (!isOpen) {
|
|
71689
|
+
const match2 = options.find((option) => option.label.toLowerCase() === inputValue.toLowerCase());
|
|
71690
|
+
if (!match2 && inputValue !== (options.find((opt) => opt.value === value)?.label || value)) {
|
|
71691
|
+
onChange(inputValue);
|
|
71692
|
+
}
|
|
71693
|
+
}
|
|
71694
|
+
setOpen(isOpen);
|
|
71676
71695
|
};
|
|
71677
71696
|
const displayLabel = options.find((option) => option.value.toLowerCase() === value?.toLowerCase())?.label || value;
|
|
71678
|
-
return /* @__PURE__ */ React119__namespace.createElement(Popover2, { open, onOpenChange:
|
|
71697
|
+
return /* @__PURE__ */ React119__namespace.createElement(Popover2, { open, onOpenChange: handleOpenChange }, /* @__PURE__ */ React119__namespace.createElement(PopoverTrigger2, { asChild: true }, /* @__PURE__ */ React119__namespace.createElement(
|
|
71679
71698
|
Button,
|
|
71680
71699
|
{
|
|
71681
71700
|
variant: "outline",
|
|
@@ -71691,8 +71710,7 @@ var EditableCombobox = ({
|
|
|
71691
71710
|
{
|
|
71692
71711
|
placeholder: searchPlaceholder,
|
|
71693
71712
|
value: inputValue,
|
|
71694
|
-
onValueChange: setInputValue
|
|
71695
|
-
onBlur: handleBlur
|
|
71713
|
+
onValueChange: setInputValue
|
|
71696
71714
|
}
|
|
71697
71715
|
), /* @__PURE__ */ React119__namespace.createElement(CommandList, null, /* @__PURE__ */ React119__namespace.createElement(CommandEmpty, null, noResultsMessage), /* @__PURE__ */ React119__namespace.createElement(CommandGroup, null, options.map((option) => /* @__PURE__ */ React119__namespace.createElement(
|
|
71698
71716
|
CommandItem,
|
|
@@ -72991,6 +73009,10 @@ var supportedQuestionTypesForAI = [
|
|
|
72991
73009
|
{ value: "sequence", label: "Sequence" },
|
|
72992
73010
|
{ value: "matching", label: "Matching" }
|
|
72993
73011
|
];
|
|
73012
|
+
var availableLanguages = [
|
|
73013
|
+
{ value: "English", label: "English" },
|
|
73014
|
+
{ value: "Vietnamese", label: "Ti\u1EBFng Vi\u1EC7t" }
|
|
73015
|
+
];
|
|
72994
73016
|
var AIQuestionGeneratorModal = ({
|
|
72995
73017
|
isOpen,
|
|
72996
73018
|
onClose,
|
|
@@ -73000,51 +73022,65 @@ var AIQuestionGeneratorModal = ({
|
|
|
73000
73022
|
subjects = [],
|
|
73001
73023
|
topics = [],
|
|
73002
73024
|
gradeLevels = [],
|
|
73003
|
-
bloomLevels = []
|
|
73025
|
+
bloomLevels = [],
|
|
73026
|
+
categories = []
|
|
73004
73027
|
}) => {
|
|
73005
|
-
const [
|
|
73028
|
+
const [additionalInfo, setAdditionalInfo] = React119.useState("");
|
|
73006
73029
|
const [isLoading, setIsLoading] = React119.useState(false);
|
|
73007
73030
|
const [error, setError] = React119.useState(null);
|
|
73008
73031
|
const { toast: toast2 } = useToast();
|
|
73009
73032
|
const [subjectCode, setSubjectCode] = React119.useState("");
|
|
73033
|
+
const [categoryCode, setCategoryCode] = React119.useState("");
|
|
73010
73034
|
const [topicCode, setTopicCode] = React119.useState("");
|
|
73011
73035
|
const [gradeBand, setGradeBand] = React119.useState("");
|
|
73012
73036
|
const [bloomLevelCode, setBloomLevelCode] = React119.useState("");
|
|
73013
73037
|
const [selectedQuestionType, setSelectedQuestionType] = React119.useState("multiple_choice");
|
|
73038
|
+
const [selectedLanguage, setSelectedLanguage] = React119.useState(language3);
|
|
73014
73039
|
const [numberOfOptions, setNumberOfOptions] = React119.useState(4);
|
|
73015
|
-
const [minCorrectAnswers, setMinCorrectAnswers] = React119.useState(2);
|
|
73016
|
-
const [maxCorrectAnswers, setMaxCorrectAnswers] = React119.useState(3);
|
|
73017
|
-
const [isCaseSensitive, setIsCaseSensitive] = React119.useState(false);
|
|
73018
|
-
const [numberOfBlanks, setNumberOfBlanks] = React119.useState(2);
|
|
73019
|
-
const [numberOfSequenceItems, setNumberOfSequenceItems] = React119.useState(4);
|
|
73020
|
-
const [numberOfMatchingPairs, setNumberOfMatchingPairs] = React119.useState(4);
|
|
73021
73040
|
const [isApiKeyManagerModalOpen, setIsApiKeyManagerModalOpen] = React119.useState(false);
|
|
73022
73041
|
const [geminiApiKeyExists, setGeminiApiKeyExists] = React119.useState(false);
|
|
73023
73042
|
const finalQuestionType = questionTypeProp || selectedQuestionType;
|
|
73024
73043
|
React119.useEffect(() => {
|
|
73025
73044
|
if (isOpen) {
|
|
73026
|
-
|
|
73045
|
+
setAdditionalInfo("");
|
|
73027
73046
|
setError(null);
|
|
73028
73047
|
setIsLoading(false);
|
|
73029
73048
|
setSubjectCode("");
|
|
73049
|
+
setCategoryCode("");
|
|
73030
73050
|
setTopicCode("");
|
|
73031
73051
|
setGradeBand("");
|
|
73032
73052
|
setBloomLevelCode("");
|
|
73033
73053
|
setSelectedQuestionType(questionTypeProp || "multiple_choice");
|
|
73054
|
+
setSelectedLanguage(language3);
|
|
73034
73055
|
setGeminiApiKeyExists(APIKeyService.hasAPIKey(GEMINI_API_KEY_SERVICE_NAME));
|
|
73035
73056
|
}
|
|
73036
|
-
}, [isOpen, questionTypeProp]);
|
|
73057
|
+
}, [isOpen, questionTypeProp, language3]);
|
|
73058
|
+
const filteredCategories = React119.useMemo(() => {
|
|
73059
|
+
return categories;
|
|
73060
|
+
}, [categories]);
|
|
73037
73061
|
const filteredTopics = React119.useMemo(() => {
|
|
73038
|
-
if (!subjectCode) return [];
|
|
73039
|
-
return topics.filter(
|
|
73040
|
-
|
|
73062
|
+
if (!subjectCode || !categoryCode) return [];
|
|
73063
|
+
return topics.filter(
|
|
73064
|
+
(t2) => t2.subjectCode === subjectCode
|
|
73065
|
+
/* && t.categoryCode === categoryCode */
|
|
73066
|
+
);
|
|
73067
|
+
}, [subjectCode, categoryCode, topics]);
|
|
73068
|
+
const handleSubjectChange = (newSubjectCode) => {
|
|
73069
|
+
setSubjectCode(newSubjectCode);
|
|
73070
|
+
setCategoryCode("");
|
|
73071
|
+
setTopicCode("");
|
|
73072
|
+
};
|
|
73073
|
+
const handleCategoryChange = (newCategoryCode) => {
|
|
73074
|
+
setCategoryCode(newCategoryCode);
|
|
73075
|
+
setTopicCode("");
|
|
73076
|
+
};
|
|
73041
73077
|
const handleApiKeyModalClose = () => {
|
|
73042
73078
|
setIsApiKeyManagerModalOpen(false);
|
|
73043
73079
|
setGeminiApiKeyExists(APIKeyService.hasAPIKey(GEMINI_API_KEY_SERVICE_NAME));
|
|
73044
73080
|
};
|
|
73045
73081
|
const handleSubmit = async () => {
|
|
73046
|
-
if (!
|
|
73047
|
-
setError("Please
|
|
73082
|
+
if (!subjectCode || !categoryCode || !topicCode || !gradeBand || !bloomLevelCode) {
|
|
73083
|
+
setError("Please fill in all required metadata fields: Subject, Category, Topic, Grade Level, and Bloom's Level.");
|
|
73048
73084
|
return;
|
|
73049
73085
|
}
|
|
73050
73086
|
const geminiKey = APIKeyService.getAPIKey(GEMINI_API_KEY_SERVICE_NAME);
|
|
@@ -73058,14 +73094,15 @@ var AIQuestionGeneratorModal = ({
|
|
|
73058
73094
|
setIsLoading(true);
|
|
73059
73095
|
try {
|
|
73060
73096
|
const quizContext = {
|
|
73061
|
-
plannedTopic:
|
|
73097
|
+
plannedTopic: additionalInfo.trim() || topicCode,
|
|
73062
73098
|
originalSubject: subjectCode,
|
|
73063
73099
|
originalTopic: topicCode,
|
|
73100
|
+
originalCategory: categoryCode,
|
|
73064
73101
|
gradeBand,
|
|
73065
73102
|
plannedBloomLevel: bloomLevelCode
|
|
73066
73103
|
};
|
|
73067
73104
|
const baseClientInput = {
|
|
73068
|
-
language:
|
|
73105
|
+
language: selectedLanguage,
|
|
73069
73106
|
difficulty: "Medium",
|
|
73070
73107
|
quizContext
|
|
73071
73108
|
};
|
|
@@ -73078,33 +73115,32 @@ var AIQuestionGeneratorModal = ({
|
|
|
73078
73115
|
generatedResult = await generateMCQQuestion({ ...baseClientInput, numberOfOptions }, geminiKey);
|
|
73079
73116
|
break;
|
|
73080
73117
|
case "multiple_response":
|
|
73081
|
-
generatedResult = await generateMRQQuestion({ ...baseClientInput, numberOfOptions, minCorrectAnswers, maxCorrectAnswers }, geminiKey);
|
|
73118
|
+
generatedResult = await generateMRQQuestion({ ...baseClientInput, numberOfOptions: 5, minCorrectAnswers: 2, maxCorrectAnswers: 3 }, geminiKey);
|
|
73082
73119
|
break;
|
|
73083
73120
|
case "short_answer":
|
|
73084
|
-
generatedResult = await generateShortAnswerQuestion({ ...baseClientInput, isCaseSensitive }, geminiKey);
|
|
73121
|
+
generatedResult = await generateShortAnswerQuestion({ ...baseClientInput, isCaseSensitive: false }, geminiKey);
|
|
73085
73122
|
break;
|
|
73086
73123
|
case "numeric":
|
|
73087
73124
|
generatedResult = await generateNumericQuestion({ ...baseClientInput, allowDecimals: true, tolerance: 0 }, geminiKey);
|
|
73088
73125
|
break;
|
|
73089
73126
|
case "fill_in_the_blanks":
|
|
73090
|
-
generatedResult = await generateFillInTheBlanksQuestion({ ...baseClientInput, numberOfBlanks, isCaseSensitive }, geminiKey);
|
|
73127
|
+
generatedResult = await generateFillInTheBlanksQuestion({ ...baseClientInput, numberOfBlanks: 2, isCaseSensitive: false }, geminiKey);
|
|
73091
73128
|
break;
|
|
73092
73129
|
case "sequence":
|
|
73093
|
-
generatedResult = await generateSequenceQuestion({ ...baseClientInput, numberOfItems:
|
|
73130
|
+
generatedResult = await generateSequenceQuestion({ ...baseClientInput, numberOfItems: 4 }, geminiKey);
|
|
73094
73131
|
break;
|
|
73095
73132
|
case "matching":
|
|
73096
|
-
generatedResult = await generateMatchingQuestion({ ...baseClientInput, numberOfPairs:
|
|
73133
|
+
generatedResult = await generateMatchingQuestion({ ...baseClientInput, numberOfPairs: 4, shuffleOptions: true }, geminiKey);
|
|
73097
73134
|
break;
|
|
73098
73135
|
default:
|
|
73099
73136
|
throw new Error(`AI generation for '${finalQuestionType}' is not implemented in this flow.`);
|
|
73100
73137
|
}
|
|
73101
|
-
if (generatedResult.error)
|
|
73102
|
-
throw new Error(generatedResult.error);
|
|
73103
|
-
}
|
|
73138
|
+
if (generatedResult.error) throw new Error(generatedResult.error);
|
|
73104
73139
|
if (generatedResult.question) {
|
|
73105
73140
|
const completeQuestion = generatedResult.question;
|
|
73106
73141
|
completeQuestion.subject = subjectCode;
|
|
73107
73142
|
completeQuestion.topic = topicCode;
|
|
73143
|
+
completeQuestion.category = categoryCode;
|
|
73108
73144
|
completeQuestion.gradeBand = gradeBand;
|
|
73109
73145
|
completeQuestion.bloomLevel = bloomLevelCode;
|
|
73110
73146
|
if (completeQuestion.points === void 0) completeQuestion.points = 10;
|
|
@@ -73130,47 +73166,13 @@ var AIQuestionGeneratorModal = ({
|
|
|
73130
73166
|
const comboboxOptions = {
|
|
73131
73167
|
subjects: subjects.map((s2) => ({ value: s2.code, label: s2.name })),
|
|
73132
73168
|
topics: filteredTopics.map((t2) => ({ value: t2.code, label: t2.name })),
|
|
73169
|
+
categories: filteredCategories.map((c2) => ({ value: c2.code, label: c2.name })),
|
|
73133
73170
|
gradeLevels: gradeLevels.map((g) => ({ value: g.code, label: g.name })),
|
|
73134
73171
|
bloomLevels: bloomLevels.map((b) => ({ value: b.code, label: b.name }))
|
|
73135
73172
|
};
|
|
73136
|
-
const renderSpecificParams = () => {
|
|
73137
|
-
switch (finalQuestionType) {
|
|
73138
|
-
case "multiple_choice":
|
|
73139
|
-
case "multiple_response":
|
|
73140
|
-
return /* @__PURE__ */ React119__namespace.default.createElement("div", { className: "space-y-2 pt-4 border-t" }, /* @__PURE__ */ React119__namespace.default.createElement(Label2, { htmlFor: "ai-num-options" }, "Number of Options (2-8)"), /* @__PURE__ */ React119__namespace.default.createElement(
|
|
73141
|
-
Input,
|
|
73142
|
-
{
|
|
73143
|
-
id: "ai-num-options",
|
|
73144
|
-
type: "number",
|
|
73145
|
-
value: numberOfOptions,
|
|
73146
|
-
onChange: (e2) => setNumberOfOptions(parseInt(e2.target.value, 10)),
|
|
73147
|
-
min: 2,
|
|
73148
|
-
max: 8
|
|
73149
|
-
}
|
|
73150
|
-
), finalQuestionType === "multiple_response" && /* @__PURE__ */ React119__namespace.default.createElement(React119__namespace.default.Fragment, null, /* @__PURE__ */ React119__namespace.default.createElement(Label2, { htmlFor: "ai-min-correct" }, "Min Correct Answers"), /* @__PURE__ */ React119__namespace.default.createElement(Input, { id: "ai-min-correct", type: "number", value: minCorrectAnswers, onChange: (e2) => setMinCorrectAnswers(parseInt(e2.target.value, 10)), min: 1, max: numberOfOptions }), /* @__PURE__ */ React119__namespace.default.createElement(Label2, { htmlFor: "ai-max-correct" }, "Max Correct Answers"), /* @__PURE__ */ React119__namespace.default.createElement(Input, { id: "ai-max-correct", type: "number", value: maxCorrectAnswers, onChange: (e2) => setMaxCorrectAnswers(parseInt(e2.target.value, 10)), min: minCorrectAnswers, max: numberOfOptions })));
|
|
73151
|
-
case "short_answer":
|
|
73152
|
-
case "fill_in_the_blanks":
|
|
73153
|
-
return /* @__PURE__ */ React119__namespace.default.createElement("div", { className: "flex items-center space-x-2 pt-4 border-t" }, /* @__PURE__ */ React119__namespace.default.createElement("input", { type: "checkbox", id: "ai-case-sensitive", checked: isCaseSensitive, onChange: (e2) => setIsCaseSensitive(e2.target.checked), className: "h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary" }), /* @__PURE__ */ React119__namespace.default.createElement(Label2, { htmlFor: "ai-case-sensitive" }, "Case Sensitive Answers"), finalQuestionType === "fill_in_the_blanks" && /* @__PURE__ */ React119__namespace.default.createElement("div", { className: "space-y-1 ml-4" }, /* @__PURE__ */ React119__namespace.default.createElement(Label2, { htmlFor: "ai-num-blanks" }, "Number of Blanks (1-5)"), /* @__PURE__ */ React119__namespace.default.createElement(Input, { id: "ai-num-blanks", type: "number", value: numberOfBlanks, onChange: (e2) => setNumberOfBlanks(parseInt(e2.target.value, 10)), min: 1, max: 5 })));
|
|
73154
|
-
case "sequence":
|
|
73155
|
-
return /* @__PURE__ */ React119__namespace.default.createElement("div", { className: "space-y-2 pt-4 border-t" }, /* @__PURE__ */ React119__namespace.default.createElement(Label2, { htmlFor: "ai-num-seq-items" }, "Number of Items to Sequence (2-10)"), /* @__PURE__ */ React119__namespace.default.createElement(Input, { id: "ai-num-seq-items", type: "number", value: numberOfSequenceItems, onChange: (e2) => setNumberOfSequenceItems(parseInt(e2.target.value, 10)), min: 2, max: 10 }));
|
|
73156
|
-
case "matching":
|
|
73157
|
-
return /* @__PURE__ */ React119__namespace.default.createElement("div", { className: "space-y-2 pt-4 border-t" }, /* @__PURE__ */ React119__namespace.default.createElement(Label2, { htmlFor: "ai-num-match-pairs" }, "Number of Pairs to Match (2-8)"), /* @__PURE__ */ React119__namespace.default.createElement(Input, { id: "ai-num-match-pairs", type: "number", value: numberOfMatchingPairs, onChange: (e2) => setNumberOfMatchingPairs(parseInt(e2.target.value, 10)), min: 2, max: 8 }));
|
|
73158
|
-
default:
|
|
73159
|
-
return null;
|
|
73160
|
-
}
|
|
73161
|
-
};
|
|
73162
73173
|
return /* @__PURE__ */ React119__namespace.default.createElement(React119__namespace.default.Fragment, null, /* @__PURE__ */ React119__namespace.default.createElement(Dialog2, { open: isOpen, onOpenChange: (open) => {
|
|
73163
73174
|
if (!open) onClose();
|
|
73164
|
-
} }, /* @__PURE__ */ React119__namespace.default.createElement(DialogContent2, { className: "sm:max-w-[
|
|
73165
|
-
Textarea,
|
|
73166
|
-
{
|
|
73167
|
-
id: "ai-prompt",
|
|
73168
|
-
value: prompt,
|
|
73169
|
-
onChange: (e2) => setPrompt(e2.target.value),
|
|
73170
|
-
placeholder: "e.g., The process of photosynthesis, The causes of World War II, Basic Algebra Equations",
|
|
73171
|
-
className: "min-h-[100px]"
|
|
73172
|
-
}
|
|
73173
|
-
)), /* @__PURE__ */ React119__namespace.default.createElement("div", { className: "grid grid-cols-2 gap-4" }, /* @__PURE__ */ React119__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React119__namespace.default.createElement(Label2, null, "Subject"), /* @__PURE__ */ React119__namespace.default.createElement(EditableCombobox, { options: comboboxOptions.subjects, value: subjectCode, onChange: setSubjectCode, placeholder: "Select or type a Subject..." })), /* @__PURE__ */ React119__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React119__namespace.default.createElement(Label2, null, "Topic"), /* @__PURE__ */ React119__namespace.default.createElement(EditableCombobox, { options: comboboxOptions.topics, value: topicCode, onChange: setTopicCode, placeholder: "Select or type a Topic...", disabled: !subjectCode })), /* @__PURE__ */ React119__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React119__namespace.default.createElement(Label2, null, "Grade Level"), /* @__PURE__ */ React119__namespace.default.createElement(EditableCombobox, { options: comboboxOptions.gradeLevels, value: gradeBand, onChange: setGradeBand, placeholder: "Select or type a Grade..." })), /* @__PURE__ */ React119__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React119__namespace.default.createElement(Label2, null, "Bloom's Level"), /* @__PURE__ */ React119__namespace.default.createElement(EditableCombobox, { options: comboboxOptions.bloomLevels, value: bloomLevelCode, onChange: setBloomLevelCode, placeholder: "Select a Bloom's Level..." }))), renderSpecificParams(), error && /* @__PURE__ */ React119__namespace.default.createElement("p", { className: "text-sm text-destructive flex items-center mt-2" }, /* @__PURE__ */ React119__namespace.default.createElement(TriangleAlert, { className: "mr-1 h-4 w-4" }), " ", error)), /* @__PURE__ */ React119__namespace.default.createElement(DialogFooter, null, /* @__PURE__ */ React119__namespace.default.createElement(DialogClose2, { asChild: true }, /* @__PURE__ */ React119__namespace.default.createElement(Button, { type: "button", variant: "outline" }, "Cancel")), /* @__PURE__ */ React119__namespace.default.createElement(Button, { type: "button", onClick: handleSubmit, disabled: isLoading || !prompt.trim() || !geminiApiKeyExists }, isLoading ? /* @__PURE__ */ React119__namespace.default.createElement(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ React119__namespace.default.createElement(WandSparkles, { className: "mr-2 h-4 w-4" }), "Generate Question")))), /* @__PURE__ */ React119__namespace.default.createElement(APIKeyManagerModal, { isOpen: isApiKeyManagerModalOpen, onClose: handleApiKeyModalClose }));
|
|
73175
|
+
} }, /* @__PURE__ */ React119__namespace.default.createElement(DialogContent2, { className: "sm:max-w-[700px]" }, /* @__PURE__ */ React119__namespace.default.createElement(DialogHeader, null, /* @__PURE__ */ React119__namespace.default.createElement(DialogTitle2, { className: "flex items-center font-headline text-2xl" }, /* @__PURE__ */ React119__namespace.default.createElement(WandSparkles, { className: "mr-2 h-6 w-6 text-primary" }), " AI Question Generator"), /* @__PURE__ */ React119__namespace.default.createElement(DialogDescription2, null, "Provide metadata and optional info to generate a '", finalQuestionType, "' question.")), /* @__PURE__ */ React119__namespace.default.createElement("div", { className: "space-y-4 py-4 max-h-[60vh] overflow-y-auto px-2" }, /* @__PURE__ */ React119__namespace.default.createElement("div", { className: "grid grid-cols-2 gap-4" }, !questionTypeProp && /* @__PURE__ */ React119__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React119__namespace.default.createElement(Label2, null, "Question Type"), /* @__PURE__ */ React119__namespace.default.createElement(Select2, { value: selectedQuestionType, onValueChange: (v) => setSelectedQuestionType(v) }, /* @__PURE__ */ React119__namespace.default.createElement(SelectTrigger2, null, /* @__PURE__ */ React119__namespace.default.createElement(SelectValue2, null)), /* @__PURE__ */ React119__namespace.default.createElement(SelectContent2, null, supportedQuestionTypesForAI.map((type) => /* @__PURE__ */ React119__namespace.default.createElement(SelectItem2, { key: type.value, value: type.value }, type.label))))), /* @__PURE__ */ React119__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React119__namespace.default.createElement(Label2, null, "Language"), /* @__PURE__ */ React119__namespace.default.createElement(Select2, { value: selectedLanguage, onValueChange: setSelectedLanguage }, /* @__PURE__ */ React119__namespace.default.createElement(SelectTrigger2, null, /* @__PURE__ */ React119__namespace.default.createElement(SelectValue2, null)), /* @__PURE__ */ React119__namespace.default.createElement(SelectContent2, null, availableLanguages.map((lang) => /* @__PURE__ */ React119__namespace.default.createElement(SelectItem2, { key: lang.value, value: lang.value }, lang.label)))))), /* @__PURE__ */ React119__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React119__namespace.default.createElement(Label2, { htmlFor: "ai-additional-info" }, "Additional Info (Optional)"), /* @__PURE__ */ React119__namespace.default.createElement(Textarea, { id: "ai-additional-info", value: additionalInfo, onChange: (e2) => setAdditionalInfo(e2.target.value), placeholder: "Provide extra context, a specific topic, or a detailed prompt for the AI...", className: "min-h-[100px]" })), /* @__PURE__ */ React119__namespace.default.createElement("div", { className: "grid grid-cols-2 gap-4" }, /* @__PURE__ */ React119__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React119__namespace.default.createElement(Label2, null, "Subject *"), /* @__PURE__ */ React119__namespace.default.createElement(EditableCombobox, { options: comboboxOptions.subjects, value: subjectCode, onChange: handleSubjectChange, placeholder: "Select Subject..." })), /* @__PURE__ */ React119__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React119__namespace.default.createElement(Label2, null, "Category *"), /* @__PURE__ */ React119__namespace.default.createElement(EditableCombobox, { options: comboboxOptions.categories, value: categoryCode, onChange: handleCategoryChange, placeholder: "Select Category...", disabled: !subjectCode })), /* @__PURE__ */ React119__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React119__namespace.default.createElement(Label2, null, "Topic *"), /* @__PURE__ */ React119__namespace.default.createElement(EditableCombobox, { options: comboboxOptions.topics, value: topicCode, onChange: setTopicCode, placeholder: "Select Topic...", disabled: !categoryCode })), /* @__PURE__ */ React119__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React119__namespace.default.createElement(Label2, null, "Grade Level *"), /* @__PURE__ */ React119__namespace.default.createElement(EditableCombobox, { options: comboboxOptions.gradeLevels, value: gradeBand, onChange: setGradeBand, placeholder: "Select Grade..." })), /* @__PURE__ */ React119__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React119__namespace.default.createElement(Label2, null, "Bloom's Level *"), /* @__PURE__ */ React119__namespace.default.createElement(EditableCombobox, { options: comboboxOptions.bloomLevels, value: bloomLevelCode, onChange: setBloomLevelCode, placeholder: "Select Bloom's Level..." }))), finalQuestionType === "multiple_choice" && /* @__PURE__ */ React119__namespace.default.createElement("div", { className: "space-y-2 pt-4 border-t" }, /* @__PURE__ */ React119__namespace.default.createElement(Label2, { htmlFor: "ai-num-options" }, "Number of Options (2-8)"), /* @__PURE__ */ React119__namespace.default.createElement(Input, { id: "ai-num-options", type: "number", value: numberOfOptions, onChange: (e2) => setNumberOfOptions(parseInt(e2.target.value, 10)), min: 2, max: 8 })), error && /* @__PURE__ */ React119__namespace.default.createElement("p", { className: "text-sm text-destructive flex items-center mt-2" }, /* @__PURE__ */ React119__namespace.default.createElement(TriangleAlert, { className: "mr-1 h-4 w-4" }), " ", error)), /* @__PURE__ */ React119__namespace.default.createElement(DialogFooter, null, /* @__PURE__ */ React119__namespace.default.createElement(DialogClose2, { asChild: true }, /* @__PURE__ */ React119__namespace.default.createElement(Button, { type: "button", variant: "outline" }, "Cancel")), /* @__PURE__ */ React119__namespace.default.createElement(Button, { type: "button", onClick: handleSubmit, disabled: isLoading || !geminiApiKeyExists || !subjectCode || !categoryCode || !topicCode || !gradeBand || !bloomLevelCode }, isLoading ? /* @__PURE__ */ React119__namespace.default.createElement(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ React119__namespace.default.createElement(WandSparkles, { className: "mr-2 h-4 w-4" }), "Generate Question")))), /* @__PURE__ */ React119__namespace.default.createElement(APIKeyManagerModal, { isOpen: isApiKeyManagerModalOpen, onClose: handleApiKeyModalClose }));
|
|
73174
73176
|
};
|
|
73175
73177
|
|
|
73176
73178
|
// src/react-ui/components/authoring/AIFullQuizGeneratorModal.tsx
|
package/dist/authoring.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ export { B as BaseQuestion, e as BlocklyProgrammingQuestion, C as CodingQuestion
|
|
|
2
2
|
export { APIKeyService, AchievementService, Approach, ApproachTableRawDifficulty, BloomLevelName, BloomLevelType, Category, CodeNamedEntity, Context, GEMINI_API_KEY_SERVICE_NAME, GradeLevel, KnowledgeCardService, KnowledgeDimension, LearningObjective, MetadataService, PracticeHistoryService, QuestionBankService, QuestionImportService, QuestionInBank, QuestionTypeType, QuizEditorService, QuizEngine, QuizEngineCallbacks, QuizEngineConstructorOptions, QuoteService, SCORMService, StandardDifficulty, Subject, Topic, UserConfigService, cn, emptyQuiz, exportQuizAsSCORMZip, generateLauncherHTML, generateSCORMManifest, generateUniqueId, sampleQuiz } from './index.cjs';
|
|
3
3
|
export { i as Achievement, j as AchievementDefinition, r as ActivityCalendarData, u as AnalysisReport, A as AnswerDetail, x as ChatContext, C as ChatMessage, v as DashboardCardConfig, D as DashboardCardId, w as DashboardLayout, y as Goal, G as GoalType, t as ImageContextItem, I as ImportError, K as KnowledgeCard, L as LearningAnalysis, e as PerformanceByBloomLevel, b as PerformanceByCategory, d as PerformanceByDifficulty, P as PerformanceByLearningObjective, c as PerformanceByTopic, f as PerformanceMetric, s as PerformanceSummary, k as PracticeDifficulty, n as PracticeSession, p as PracticeSessionSummary, o as PracticeStats, m as PracticeSuggestion, l as PracticeSuggestionTopic, q as PracticeTopicSummary, g as QuestionReview, Q as QuizResultType, h as QuizReviewContent, R as RoadmapItem, T as TestCaseResult, U as UserAnswerType, a as UserAnswers, W as WeeklyRoadmap } from './ai-ecosystem-DyQYZbyX.cjs';
|
|
4
4
|
export { AssessAndMapDocumentClientInput, AssessAndMapDocumentOutput, BloomLevelStringsForAI, GenerateCodingQuestionClientInput, GenerateCodingQuestionOutput, GenerateFillInTheBlanksQuestionClientInput, GenerateFillInTheBlanksQuestionOutput, GenerateLearningAnalysisClientInput, GenerateLearningAnalysisOutput, GenerateMCQQuestionClientInput, GenerateMCQQuestionOutput, GenerateMRQQuestionClientInput, GenerateMRQQuestionOutput, GenerateMatchingQuestionClientInput, GenerateMatchingQuestionOutput, GenerateMotivationalQuoteClientInput, GenerateMotivationalQuoteOutput, GenerateNumericQuestionClientInput, GenerateNumericQuestionOutput, GeneratePracticeSuggestionClientInput, GeneratePracticeSuggestionOutput, GenerateQuestionsFromQuizPlanClientInput, GenerateQuestionsFromQuizPlanOutput, GenerateQuizFromTextClientInput, GenerateQuizFromTextOutput, GenerateQuizPlanClientInput, GenerateQuizPlanOutput, GenerateQuizReviewClientInput, GenerateQuizReviewOutput, GenerateSequenceQuestionClientInput, GenerateSequenceQuestionOutput, GenerateShortAnswerQuestionClientInput, GenerateShortAnswerQuestionOutput, GenerateSingleKnowledgeCardClientInput, GenerateSingleKnowledgeCardOutput, GenerateTrueFalseQuestionClientInput, GenerateTrueFalseQuestionOutput, PlanKnowledgeCardsClientInput, PlanKnowledgeCardsOutput, PlannedQuestion, assessAndMapDocument, generateCodingQuestion, generateFillInTheBlanksQuestion, generateLearningAnalysis, generateMCQQuestion, generateMRQQuestion, generateMatchingQuestion, generateMotivationalQuote, generateNumericQuestion, generatePracticeSuggestion, generateQuestionsFromQuizPlan, generateQuizFromText, generateQuizPlan, generateQuizReview, generateSequenceQuestion, generateShortAnswerQuestion, generateSingleKnowledgeCard, generateTrueFalseQuestion, planKnowledgeCards } from './ai.cjs';
|
|
5
|
-
export { c as AIFullQuizGeneratorModal, A as AIQuestionGeneratorModal, e as APIKeyManagerModal, f as ApiKeySettings, m as ApproachManager, B as BloomLevelManager, C as CategoryManager, l as ContextManager, E as EditQuestionModal, G as GradeLevelManager, I as ImportQuestionsModal, L as LearningObjectiveManager, n as MetadataImportControls, M as MetadataTabs, h as QuestionFilters, i as QuestionFormDialog, g as QuestionList, a as QuestionPreviewModal, k as QuestionTypeManager, Q as QuizAuthoringTool, b as QuizSettingsForm, d as SCORMExportModal, S as SelectedQuestionsPanel, j as SubjectManager, o as Toaster, T as TopicManager, t as toast, u as useToast } from './toaster-
|
|
5
|
+
export { c as AIFullQuizGeneratorModal, A as AIQuestionGeneratorModal, e as APIKeyManagerModal, f as ApiKeySettings, m as ApproachManager, B as BloomLevelManager, C as CategoryManager, l as ContextManager, E as EditQuestionModal, G as GradeLevelManager, I as ImportQuestionsModal, L as LearningObjectiveManager, n as MetadataImportControls, M as MetadataTabs, h as QuestionFilters, i as QuestionFormDialog, g as QuestionList, a as QuestionPreviewModal, k as QuestionTypeManager, Q as QuizAuthoringTool, b as QuizSettingsForm, d as SCORMExportModal, S as SelectedQuestionsPanel, j as SubjectManager, o as Toaster, T as TopicManager, t as toast, u as useToast } from './toaster-Bvhmyef9.cjs';
|
|
6
6
|
import 'clsx';
|
|
7
7
|
import 'zod';
|
|
8
8
|
import 'react';
|
package/dist/authoring.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { B as BaseQuestion, e as BlocklyProgrammingQuestion, C as CodingQuestion
|
|
|
2
2
|
export { APIKeyService, AchievementService, Approach, ApproachTableRawDifficulty, BloomLevelName, BloomLevelType, Category, CodeNamedEntity, Context, GEMINI_API_KEY_SERVICE_NAME, GradeLevel, KnowledgeCardService, KnowledgeDimension, LearningObjective, MetadataService, PracticeHistoryService, QuestionBankService, QuestionImportService, QuestionInBank, QuestionTypeType, QuizEditorService, QuizEngine, QuizEngineCallbacks, QuizEngineConstructorOptions, QuoteService, SCORMService, StandardDifficulty, Subject, Topic, UserConfigService, cn, emptyQuiz, exportQuizAsSCORMZip, generateLauncherHTML, generateSCORMManifest, generateUniqueId, sampleQuiz } from './index.js';
|
|
3
3
|
export { i as Achievement, j as AchievementDefinition, r as ActivityCalendarData, u as AnalysisReport, A as AnswerDetail, x as ChatContext, C as ChatMessage, v as DashboardCardConfig, D as DashboardCardId, w as DashboardLayout, y as Goal, G as GoalType, t as ImageContextItem, I as ImportError, K as KnowledgeCard, L as LearningAnalysis, e as PerformanceByBloomLevel, b as PerformanceByCategory, d as PerformanceByDifficulty, P as PerformanceByLearningObjective, c as PerformanceByTopic, f as PerformanceMetric, s as PerformanceSummary, k as PracticeDifficulty, n as PracticeSession, p as PracticeSessionSummary, o as PracticeStats, m as PracticeSuggestion, l as PracticeSuggestionTopic, q as PracticeTopicSummary, g as QuestionReview, Q as QuizResultType, h as QuizReviewContent, R as RoadmapItem, T as TestCaseResult, U as UserAnswerType, a as UserAnswers, W as WeeklyRoadmap } from './ai-ecosystem-Qa_SdE2T.js';
|
|
4
4
|
export { AssessAndMapDocumentClientInput, AssessAndMapDocumentOutput, BloomLevelStringsForAI, GenerateCodingQuestionClientInput, GenerateCodingQuestionOutput, GenerateFillInTheBlanksQuestionClientInput, GenerateFillInTheBlanksQuestionOutput, GenerateLearningAnalysisClientInput, GenerateLearningAnalysisOutput, GenerateMCQQuestionClientInput, GenerateMCQQuestionOutput, GenerateMRQQuestionClientInput, GenerateMRQQuestionOutput, GenerateMatchingQuestionClientInput, GenerateMatchingQuestionOutput, GenerateMotivationalQuoteClientInput, GenerateMotivationalQuoteOutput, GenerateNumericQuestionClientInput, GenerateNumericQuestionOutput, GeneratePracticeSuggestionClientInput, GeneratePracticeSuggestionOutput, GenerateQuestionsFromQuizPlanClientInput, GenerateQuestionsFromQuizPlanOutput, GenerateQuizFromTextClientInput, GenerateQuizFromTextOutput, GenerateQuizPlanClientInput, GenerateQuizPlanOutput, GenerateQuizReviewClientInput, GenerateQuizReviewOutput, GenerateSequenceQuestionClientInput, GenerateSequenceQuestionOutput, GenerateShortAnswerQuestionClientInput, GenerateShortAnswerQuestionOutput, GenerateSingleKnowledgeCardClientInput, GenerateSingleKnowledgeCardOutput, GenerateTrueFalseQuestionClientInput, GenerateTrueFalseQuestionOutput, PlanKnowledgeCardsClientInput, PlanKnowledgeCardsOutput, PlannedQuestion, assessAndMapDocument, generateCodingQuestion, generateFillInTheBlanksQuestion, generateLearningAnalysis, generateMCQQuestion, generateMRQQuestion, generateMatchingQuestion, generateMotivationalQuote, generateNumericQuestion, generatePracticeSuggestion, generateQuestionsFromQuizPlan, generateQuizFromText, generateQuizPlan, generateQuizReview, generateSequenceQuestion, generateShortAnswerQuestion, generateSingleKnowledgeCard, generateTrueFalseQuestion, planKnowledgeCards } from './ai.js';
|
|
5
|
-
export { c as AIFullQuizGeneratorModal, A as AIQuestionGeneratorModal, e as APIKeyManagerModal, f as ApiKeySettings, m as ApproachManager, B as BloomLevelManager, C as CategoryManager, l as ContextManager, E as EditQuestionModal, G as GradeLevelManager, I as ImportQuestionsModal, L as LearningObjectiveManager, n as MetadataImportControls, M as MetadataTabs, h as QuestionFilters, i as QuestionFormDialog, g as QuestionList, a as QuestionPreviewModal, k as QuestionTypeManager, Q as QuizAuthoringTool, b as QuizSettingsForm, d as SCORMExportModal, S as SelectedQuestionsPanel, j as SubjectManager, o as Toaster, T as TopicManager, t as toast, u as useToast } from './toaster-
|
|
5
|
+
export { c as AIFullQuizGeneratorModal, A as AIQuestionGeneratorModal, e as APIKeyManagerModal, f as ApiKeySettings, m as ApproachManager, B as BloomLevelManager, C as CategoryManager, l as ContextManager, E as EditQuestionModal, G as GradeLevelManager, I as ImportQuestionsModal, L as LearningObjectiveManager, n as MetadataImportControls, M as MetadataTabs, h as QuestionFilters, i as QuestionFormDialog, g as QuestionList, a as QuestionPreviewModal, k as QuestionTypeManager, Q as QuizAuthoringTool, b as QuizSettingsForm, d as SCORMExportModal, S as SelectedQuestionsPanel, j as SubjectManager, o as Toaster, T as TopicManager, t as toast, u as useToast } from './toaster-B2MPZYhi.js';
|
|
6
6
|
import 'clsx';
|
|
7
7
|
import 'zod';
|
|
8
8
|
import 'react';
|