@thanh01.pmt/interactive-quiz-kit 1.0.64 → 1.0.65
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 +2 -1
- package/dist/ai.d.cts +45 -0
- package/dist/ai.d.ts +45 -0
- package/dist/ai.mjs +2 -1
- package/dist/authoring.cjs +87 -223
- package/dist/authoring.d.cts +1 -1
- package/dist/authoring.d.ts +1 -1
- package/dist/authoring.mjs +87 -223
- package/dist/react-ui.cjs +1705 -1843
- package/dist/react-ui.d.cts +1 -1
- package/dist/react-ui.d.ts +1 -1
- package/dist/react-ui.mjs +1705 -1843
- package/dist/{toaster-FX787Evl.d.cts → toaster-CKS4zoRY.d.cts} +7 -2
- package/dist/{toaster-BTfAUpDp.d.ts → toaster-DLJ_2W9u.d.ts} +7 -2
- package/package.json +1 -1
package/dist/authoring.cjs
CHANGED
|
@@ -6645,7 +6645,8 @@ var QuizContextSchema = zod.z.object({
|
|
|
6645
6645
|
originalSubject: zod.z.string().optional(),
|
|
6646
6646
|
originalCategory: zod.z.string().optional(),
|
|
6647
6647
|
originalTopic: zod.z.string().optional(),
|
|
6648
|
-
loDescription: zod.z.string().optional().describe("The full description of the learning objective for deep context.")
|
|
6648
|
+
loDescription: zod.z.string().optional().describe("The full description of the learning objective for deep context."),
|
|
6649
|
+
gradeBand: zod.z.string().optional()
|
|
6649
6650
|
});
|
|
6650
6651
|
var BaseQuestionGenerationClientInputSchema = zod.z.object({
|
|
6651
6652
|
language: zod.z.string().optional().default("English"),
|
|
@@ -73025,189 +73026,98 @@ var supportedQuestionTypesForAI = [
|
|
|
73025
73026
|
{ value: "sequence", label: "Sequence" },
|
|
73026
73027
|
{ value: "matching", label: "Matching" }
|
|
73027
73028
|
];
|
|
73028
|
-
var contextOptions = [
|
|
73029
|
-
{ shortContextId: "A", contextId: "THEO_ABS", contextDescription: "L\xFD thuy\u1EBFt/Tr\u1EEBu t\u01B0\u1EE3ng", contextExample: '"Ph\xE1t bi\u1EC3u \u0111\u1ECBnh lu\u1EADt III Newton." ho\u1EB7c "Gi\u1EA3i th\xEDch kh\xE1i ni\u1EC7m \u0111\u1EA1o h\xE0m."', keywords: "l\xFD thuy\u1EBFt, tr\u1EEBu t\u01B0\u1EE3ng, \u0111\u1ECBnh ngh\u0129a, kh\xE1i ni\u1EC7m, nguy\xEAn l\xFD, c\xF4ng th\u1EE9c, \u0111\u1ECBnh lu\u1EADt" },
|
|
73030
|
-
{ shortContextId: "B", contextId: "SPEC_CASE", contextDescription: "V\xED d\u1EE5 C\u1EE5 th\u1EC3/Tr\u01B0\u1EDDng h\u1EE3p Ri\xEAng", contextExample: '"T\xEDnh l\u1EF1c t\xE1c d\u1EE5ng l\xEAn v\u1EADt n\u1EB7ng 2kg r\u01A1i t\u1EF1 do." ho\u1EB7c "Cho h\xE0m s\u1ED1 y = x^2, t\xECm \u0111\u1EA1o h\xE0m t\u1EA1i x = 3."', keywords: "v\xED d\u1EE5, c\u1EE5 th\u1EC3, tr\u01B0\u1EDDng h\u1EE3p ri\xEAng, \xE1p d\u1EE5ng, t\xEDnh to\xE1n, minh h\u1ECDa, s\u1ED1 li\u1EC7u c\u1EE5 th\u1EC3" },
|
|
73031
|
-
{ shortContextId: "C", contextId: "NAT_OBS", contextDescription: "Hi\u1EC7n t\u01B0\u1EE3ng T\u1EF1 nhi\xEAn/Quan s\xE1t", contextExample: '"Gi\u1EA3i th\xEDch t\u1EA1i sao c\u1EA7u v\u1ED3ng xu\u1EA5t hi\u1EC7n sau c\u01A1n m\u01B0a." ho\u1EB7c "M\xF4 t\u1EA3 qu\xE1 tr\xECnh quang h\u1EE3p \u1EDF l\xE1 c\xE2y."', keywords: "hi\u1EC7n t\u01B0\u1EE3ng, t\u1EF1 nhi\xEAn, quan s\xE1t, gi\u1EA3i th\xEDch, m\xF4 t\u1EA3, th\u1EBF gi\u1EDBi th\u1EF1c, sinh h\u1ECDc, v\u1EADt l\xFD" },
|
|
73032
|
-
{ shortContextId: "D", contextId: "TECH_ENG", contextDescription: "\u1EE8ng d\u1EE5ng C\xF4ng ngh\u1EC7/K\u1EF9 thu\u1EADt", contextExample: '"Nguy\xEAn l\xFD ho\u1EA1t \u0111\u1ED9ng c\u1EE7a \u0111\u1ED9ng c\u01A1 \u0111\u1ED1t trong l\xE0 g\xEC?" ho\u1EB7c "Pin m\u1EB7t tr\u1EDDi chuy\u1EC3n \u0111\u1ED5i n\u0103ng l\u01B0\u1EE3ng \xE1nh s\xE1ng th\xE0nh \u0111i\u1EC7n n\u0103ng nh\u01B0 th\u1EBF n\xE0o?"', keywords: "\u1EE9ng d\u1EE5ng, c\xF4ng ngh\u1EC7, k\u1EF9 thu\u1EADt, thi\u1EBFt b\u1ECB, m\xE1y m\xF3c, ho\u1EA1t \u0111\u1ED9ng, nguy\xEAn l\xFD, ch\u1EBF t\u1EA1o" },
|
|
73033
|
-
{ shortContextId: "E", contextId: "EXP_INV", contextDescription: "Th\xED nghi\u1EC7m/\u0110i\u1EC1u tra Khoa h\u1ECDc", contextExample: '"Thi\u1EBFt k\u1EBF th\xED nghi\u1EC7m ch\u1EE9ng minh \u0111\u1ECBnh lu\u1EADt b\u1EA3o to\xE0n n\u0103ng l\u01B0\u1EE3ng." ho\u1EB7c "Ph\xE2n t\xEDch k\u1EBFt qu\u1EA3 th\xED nghi\u1EC7m v\u1EC1 t\u1ED1c \u0111\u1ED9 ph\u1EA3n \u1EE9ng."', keywords: "th\xED nghi\u1EC7m, \u0111i\u1EC1u tra, khoa h\u1ECDc, thi\u1EBFt k\u1EBF, quy tr\xECnh, k\u1EBFt qu\u1EA3, ph\xE2n t\xEDch, d\u1EEF li\u1EC7u" },
|
|
73034
|
-
{ shortContextId: "F", contextId: "REAL_PROB", contextDescription: "V\u1EA5n \u0111\u1EC1 Th\u1EF1c t\u1EBF/X\xE3 h\u1ED9i/M\xF4i tr\u01B0\u1EDDng", contextExample: '"\u0110\u1EC1 xu\u1EA5t gi\u1EA3i ph\xE1p gi\u1EA3m thi\u1EC3u \xF4 nhi\u1EC5m kh\xF4ng kh\xED t\u1EA1i \u0111\xF4 th\u1ECB." ho\u1EB7c "Ph\xE2n t\xEDch \u1EA3nh h\u01B0\u1EDFng c\u1EE7a bi\u1EBFn \u0111\u1ED5i kh\xED h\u1EADu \u0111\u1EBFn n\xF4ng nghi\u1EC7p."', keywords: "v\u1EA5n \u0111\u1EC1, th\u1EF1c t\u1EBF, x\xE3 h\u1ED9i, m\xF4i tr\u01B0\u1EDDng, gi\u1EA3i ph\xE1p, ph\xE2n t\xEDch, \u1EA3nh h\u01B0\u1EDFng, b\u1EC1n v\u1EEFng" },
|
|
73035
|
-
{ shortContextId: "G", contextId: "DATA_MOD", contextDescription: "Di\u1EC5n gi\u1EA3i D\u1EEF li\u1EC7u/M\xF4 h\xECnh h\xF3a", contextExample: '"D\u1EF1a v\xE0o bi\u1EC3u \u0111\u1ED3, nh\u1EADn x\xE9t xu h\u01B0\u1EDBng nhi\u1EC7t \u0111\u1ED9 to\xE0n c\u1EA7u." ho\u1EB7c "X\xE2y d\u1EF1ng m\xF4 h\xECnh to\xE1n h\u1ECDc m\xF4 t\u1EA3 s\u1EF1 t\u0103ng tr\u01B0\u1EDFng d\xE2n s\u1ED1."', keywords: "d\u1EEF li\u1EC7u, bi\u1EC3u \u0111\u1ED3, b\u1EA3ng s\u1ED1 li\u1EC7u, m\xF4 h\xECnh, di\u1EC5n gi\u1EA3i, ph\xE2n t\xEDch, xu h\u01B0\u1EDBng, d\u1EF1 \u0111o\xE1n" },
|
|
73036
|
-
{ shortContextId: "H", contextId: "HIST_SCI", contextDescription: "L\u1ECBch s\u1EED/Ph\xE1t tri\u1EC3n Khoa h\u1ECDc", contextExample: '"Tr\xECnh b\xE0y b\u1ED1i c\u1EA3nh ra \u0111\u1EDDi thuy\u1EBFt t\u01B0\u01A1ng \u0111\u1ED1i c\u1EE7a Einstein." ho\u1EB7c "Ai l\xE0 ng\u01B0\u1EDDi \u0111\u1EA7u ti\xEAn ph\xE1t hi\u1EC7n ra c\u1EA5u tr\xFAc DNA?"', keywords: "l\u1ECBch s\u1EED, ph\xE1t tri\u1EC3n, khoa h\u1ECDc, nh\xE0 khoa h\u1ECDc, ph\xE1t minh, kh\xE1m ph\xE1, b\u1ED1i c\u1EA3nh" },
|
|
73037
|
-
{ shortContextId: "I", contextId: "INTERDISC", contextDescription: "Li\xEAn ng\xE0nh (Interdisciplinary)", contextExample: '"S\u1EED d\u1EE5ng ki\u1EBFn th\u1EE9c To\xE1n v\xE0 V\u1EADt l\xFD \u0111\u1EC3 t\xEDnh qu\u1EF9 \u0111\u1EA1o c\u1EE7a v\u1EADt n\xE9m xi\xEAn." ho\u1EB7c "Ph\xE2n t\xEDch c\u01A1 ch\u1EBF h\xF3a sinh c\u1EE7a qu\xE1 tr\xECnh ti\xEAu h\xF3a."', keywords: "li\xEAn ng\xE0nh, t\xEDch h\u1EE3p, To\xE1n-L\xFD, Sinh-H\xF3a, Khoa h\u1ECDc-C\xF4ng ngh\u1EC7, k\u1EBFt n\u1ED1i ki\u1EBFn th\u1EE9c" },
|
|
73038
|
-
{ shortContextId: "J", contextId: "HYPO_COMP", contextDescription: "Gi\u1EA3 \u0111\u1ECBnh/So s\xE1nh T\xECnh hu\u1ED1ng", contextExample: '"N\u1EBFu Tr\xE1i \u0110\u1EA5t kh\xF4ng c\xF3 t\u1EEB tr\u01B0\u1EDDng th\xEC \u0111i\u1EC1u g\xEC s\u1EBD x\u1EA3y ra?" ho\u1EB7c "So s\xE1nh \u01B0u nh\u01B0\u1EE3c \u0111i\u1EC3m c\u1EE7a n\u0103ng l\u01B0\u1EE3ng h\u1EA1t nh\xE2n v\xE0 n\u0103ng l\u01B0\u1EE3ng m\u1EB7t tr\u1EDDi."', keywords: "gi\u1EA3 \u0111\u1ECBnh, so s\xE1nh, t\xECnh hu\u1ED1ng, n\u1EBFu...th\xEC, \u01B0u \u0111i\u1EC3m, nh\u01B0\u1EE3c \u0111i\u1EC3m, ph\xE2n t\xEDch, \u0111\xE1nh gi\xE1" },
|
|
73039
|
-
{ shortContextId: "__custom__", contextId: "__custom__", contextDescription: "Other (Custom Input)", contextExample: "", keywords: "custom, other, specific" }
|
|
73040
|
-
];
|
|
73041
|
-
var bloomLevelOptions = [
|
|
73042
|
-
{ value: "remembering", label: "Nh\u1EDB - D\u1EC5 (Remembering)" },
|
|
73043
|
-
{ value: "understanding", label: "Hi\u1EC3u - Trung B\xECnh (Understanding)" },
|
|
73044
|
-
{ value: "applying", label: "V\u1EADn D\u1EE5ng - Kh\xF3 (Applying)" }
|
|
73045
|
-
];
|
|
73046
|
-
var calculateCombinedDifficulty2 = (contextId, bloomLevel, qType, customContextInput) => {
|
|
73047
|
-
let contextScore = 1;
|
|
73048
|
-
const selectedContext = contextOptions.find((c2) => c2.contextId === contextId);
|
|
73049
|
-
if (selectedContext) {
|
|
73050
|
-
if (["THEO_ABS", "HIST_SCI", "__none__"].includes(selectedContext.contextId) || selectedContext.contextId === "__custom__" && !customContextInput.trim()) {
|
|
73051
|
-
contextScore = 1;
|
|
73052
|
-
} else if (["SPEC_CASE", "NAT_OBS", "DATA_MOD", "INTERDISC", "HYPO_COMP"].includes(selectedContext.contextId) || selectedContext.contextId === "__custom__" && customContextInput.trim()) {
|
|
73053
|
-
contextScore = 2;
|
|
73054
|
-
} else if (["TECH_ENG", "EXP_INV", "REAL_PROB"].includes(selectedContext.contextId)) {
|
|
73055
|
-
contextScore = 3;
|
|
73056
|
-
}
|
|
73057
|
-
} else if (contextId === "__custom__" && customContextInput.trim()) {
|
|
73058
|
-
contextScore = 2;
|
|
73059
|
-
}
|
|
73060
|
-
let bloomScore = 1;
|
|
73061
|
-
if (bloomLevel === "understanding") bloomScore = 2;
|
|
73062
|
-
else if (bloomLevel === "applying") bloomScore = 3;
|
|
73063
|
-
let questionTypeScore = 1;
|
|
73064
|
-
switch (qType) {
|
|
73065
|
-
case "true_false":
|
|
73066
|
-
case "multiple_choice":
|
|
73067
|
-
case "short_answer":
|
|
73068
|
-
questionTypeScore = 1;
|
|
73069
|
-
break;
|
|
73070
|
-
case "matching":
|
|
73071
|
-
case "fill_in_the_blanks":
|
|
73072
|
-
case "numeric":
|
|
73073
|
-
questionTypeScore = 2;
|
|
73074
|
-
break;
|
|
73075
|
-
case "sequence":
|
|
73076
|
-
case "multiple_response":
|
|
73077
|
-
questionTypeScore = 3;
|
|
73078
|
-
break;
|
|
73079
|
-
default:
|
|
73080
|
-
questionTypeScore = 1;
|
|
73081
|
-
}
|
|
73082
|
-
const totalScore = bloomScore + contextScore + questionTypeScore;
|
|
73083
|
-
if (totalScore <= 4) return "easy";
|
|
73084
|
-
if (totalScore <= 6) return "medium";
|
|
73085
|
-
return "hard";
|
|
73086
|
-
};
|
|
73087
73029
|
var AIQuestionGeneratorModal = ({
|
|
73088
73030
|
isOpen,
|
|
73089
73031
|
onClose,
|
|
73090
73032
|
onQuestionGenerated,
|
|
73091
|
-
language: language3
|
|
73092
|
-
|
|
73033
|
+
language: language3,
|
|
73034
|
+
questionType: questionTypeProp,
|
|
73035
|
+
subjects = [],
|
|
73036
|
+
topics = [],
|
|
73037
|
+
gradeLevels = [],
|
|
73038
|
+
bloomLevels = []
|
|
73093
73039
|
}) => {
|
|
73094
|
-
const [
|
|
73095
|
-
const [selectedContextId, setSelectedContextId] = React95.useState("__none__");
|
|
73096
|
-
const [customContextInput, setCustomContextInput] = React95.useState("");
|
|
73097
|
-
const [questionType, setQuestionType] = React95.useState("multiple_choice");
|
|
73098
|
-
const [selectedBloomLevel, setSelectedBloomLevel] = React95.useState("remembering");
|
|
73040
|
+
const [prompt, setPrompt] = React95.useState("");
|
|
73099
73041
|
const [isLoading, setIsLoading] = React95.useState(false);
|
|
73100
73042
|
const [error, setError] = React95.useState(null);
|
|
73101
|
-
const [computedDifficultyForDisplay, setComputedDifficultyForDisplay] = React95.useState(null);
|
|
73102
73043
|
const { toast: toast2 } = useToast();
|
|
73103
|
-
const [
|
|
73104
|
-
const [
|
|
73105
|
-
const [
|
|
73106
|
-
const [
|
|
73107
|
-
const [
|
|
73108
|
-
const [numberOfSequenceItems, setNumberOfSequenceItems] = React95.useState(4);
|
|
73109
|
-
const [numberOfMatchingPairs, setNumberOfMatchingPairs] = React95.useState(4);
|
|
73044
|
+
const [subjectCode, setSubjectCode] = React95.useState("");
|
|
73045
|
+
const [topicCode, setTopicCode] = React95.useState("");
|
|
73046
|
+
const [gradeBand, setGradeBand] = React95.useState("");
|
|
73047
|
+
const [bloomLevelCode, setBloomLevelCode] = React95.useState("");
|
|
73048
|
+
const [selectedQuestionType, setSelectedQuestionType] = React95.useState("multiple_choice");
|
|
73110
73049
|
const [isApiKeyManagerModalOpen, setIsApiKeyManagerModalOpen] = React95.useState(false);
|
|
73111
73050
|
const [geminiApiKeyExists, setGeminiApiKeyExists] = React95.useState(false);
|
|
73051
|
+
const finalQuestionType = questionTypeProp || selectedQuestionType;
|
|
73112
73052
|
React95.useEffect(() => {
|
|
73113
73053
|
if (isOpen) {
|
|
73114
|
-
|
|
73115
|
-
setSelectedContextId("__none__");
|
|
73116
|
-
setCustomContextInput("");
|
|
73117
|
-
setQuestionType("multiple_choice");
|
|
73118
|
-
setSelectedBloomLevel("remembering");
|
|
73054
|
+
setPrompt("");
|
|
73119
73055
|
setError(null);
|
|
73120
73056
|
setIsLoading(false);
|
|
73121
|
-
|
|
73122
|
-
|
|
73123
|
-
|
|
73124
|
-
|
|
73125
|
-
|
|
73126
|
-
setNumberOfSequenceItems(4);
|
|
73127
|
-
setNumberOfMatchingPairs(4);
|
|
73128
|
-
setGeminiApiKeyExists(APIKeyService.hasAPIKey(GEMINI_API_KEY_SERVICE_NAME));
|
|
73129
|
-
}
|
|
73130
|
-
}, [isOpen]);
|
|
73131
|
-
React95.useEffect(() => {
|
|
73132
|
-
if (isOpen) {
|
|
73133
|
-
const difficulty = calculateCombinedDifficulty2(selectedContextId, selectedBloomLevel, questionType, customContextInput);
|
|
73134
|
-
setComputedDifficultyForDisplay(difficulty);
|
|
73057
|
+
setSubjectCode("");
|
|
73058
|
+
setTopicCode("");
|
|
73059
|
+
setGradeBand("");
|
|
73060
|
+
setBloomLevelCode("");
|
|
73061
|
+
setSelectedQuestionType(questionTypeProp || "multiple_choice");
|
|
73135
73062
|
setGeminiApiKeyExists(APIKeyService.hasAPIKey(GEMINI_API_KEY_SERVICE_NAME));
|
|
73136
73063
|
}
|
|
73137
|
-
}, [
|
|
73064
|
+
}, [isOpen, questionTypeProp]);
|
|
73065
|
+
const filteredTopics = React95.useMemo(() => {
|
|
73066
|
+
if (!subjectCode) return [];
|
|
73067
|
+
return topics.filter((t2) => t2.subjectCode === subjectCode);
|
|
73068
|
+
}, [subjectCode, topics]);
|
|
73138
73069
|
const handleApiKeyModalClose = () => {
|
|
73139
73070
|
setIsApiKeyManagerModalOpen(false);
|
|
73140
73071
|
setGeminiApiKeyExists(APIKeyService.hasAPIKey(GEMINI_API_KEY_SERVICE_NAME));
|
|
73141
73072
|
};
|
|
73142
73073
|
const handleSubmit = async () => {
|
|
73143
|
-
if (!
|
|
73144
|
-
setError("Please provide a
|
|
73074
|
+
if (!prompt.trim()) {
|
|
73075
|
+
setError("Please provide a prompt for the question.");
|
|
73145
73076
|
return;
|
|
73146
73077
|
}
|
|
73147
73078
|
const geminiKey = APIKeyService.getAPIKey(GEMINI_API_KEY_SERVICE_NAME);
|
|
73148
73079
|
if (!geminiKey) {
|
|
73149
|
-
setError("Gemini API Key is not set. Please
|
|
73080
|
+
setError("Gemini API Key is not set. Please configure it.");
|
|
73150
73081
|
setGeminiApiKeyExists(false);
|
|
73151
73082
|
return;
|
|
73152
73083
|
}
|
|
73153
73084
|
setGeminiApiKeyExists(true);
|
|
73154
73085
|
setError(null);
|
|
73155
73086
|
setIsLoading(true);
|
|
73156
|
-
let contextDescriptionForAI = void 0;
|
|
73157
|
-
if (selectedContextId === "__custom__") {
|
|
73158
|
-
contextDescriptionForAI = customContextInput.trim() || void 0;
|
|
73159
|
-
} else if (selectedContextId && selectedContextId !== "__none__") {
|
|
73160
|
-
const selectedContextObj = contextOptions.find((c2) => c2.contextId === selectedContextId);
|
|
73161
|
-
contextDescriptionForAI = selectedContextObj?.contextDescription;
|
|
73162
|
-
}
|
|
73163
|
-
const finalDifficultyForAI = calculateCombinedDifficulty2(selectedContextId, selectedBloomLevel, questionType, customContextInput);
|
|
73164
73087
|
try {
|
|
73165
|
-
|
|
73088
|
+
const quizContext = {
|
|
73089
|
+
plannedTopic: prompt,
|
|
73090
|
+
originalSubject: subjectCode,
|
|
73091
|
+
originalTopic: topicCode,
|
|
73092
|
+
gradeBand,
|
|
73093
|
+
plannedBloomLevel: bloomLevelCode
|
|
73094
|
+
};
|
|
73166
73095
|
const baseClientInput = {
|
|
73167
|
-
topic,
|
|
73168
73096
|
language: language3,
|
|
73169
|
-
|
|
73170
|
-
|
|
73171
|
-
contextDescription: contextDescriptionForAI,
|
|
73172
|
-
selectedContextId: selectedContextId !== "__none__" && selectedContextId !== "__custom__" ? selectedContextId : selectedContextId === "__custom__" && customContextInput.trim() ? "__custom__" : void 0
|
|
73097
|
+
difficulty: "medium",
|
|
73098
|
+
quizContext
|
|
73173
73099
|
};
|
|
73174
|
-
|
|
73100
|
+
let generatedResult = {};
|
|
73101
|
+
switch (finalQuestionType) {
|
|
73175
73102
|
case "true_false":
|
|
73176
|
-
|
|
73103
|
+
generatedResult = await generateTrueFalseQuestion(baseClientInput, geminiKey);
|
|
73177
73104
|
break;
|
|
73178
73105
|
case "multiple_choice":
|
|
73179
|
-
|
|
73180
|
-
break;
|
|
73181
|
-
case "multiple_response":
|
|
73182
|
-
if (minCorrectAnswers > maxCorrectAnswers || maxCorrectAnswers > numberOfOptions) {
|
|
73183
|
-
throw new Error("Invalid settings for Multiple Response correct answers count or number of options.");
|
|
73184
|
-
}
|
|
73185
|
-
generatedQuestionData = await generateMRQQuestion({ ...baseClientInput, numberOfOptions, minCorrectAnswers, maxCorrectAnswers }, geminiKey);
|
|
73186
|
-
break;
|
|
73187
|
-
case "short_answer":
|
|
73188
|
-
generatedQuestionData = await generateShortAnswerQuestion({ ...baseClientInput, isCaseSensitive }, geminiKey);
|
|
73189
|
-
break;
|
|
73190
|
-
case "numeric":
|
|
73191
|
-
generatedQuestionData = await generateNumericQuestion({ ...baseClientInput, allowDecimals: true, tolerance: 0 }, geminiKey);
|
|
73192
|
-
break;
|
|
73193
|
-
case "fill_in_the_blanks":
|
|
73194
|
-
generatedQuestionData = await generateFillInTheBlanksQuestion({ ...baseClientInput, numberOfBlanks, isCaseSensitive }, geminiKey);
|
|
73195
|
-
break;
|
|
73196
|
-
case "sequence":
|
|
73197
|
-
generatedQuestionData = await generateSequenceQuestion({ ...baseClientInput, numberOfItems: numberOfSequenceItems }, geminiKey);
|
|
73198
|
-
break;
|
|
73199
|
-
case "matching":
|
|
73200
|
-
generatedQuestionData = await generateMatchingQuestion({ ...baseClientInput, numberOfPairs: numberOfMatchingPairs, shuffleOptions: true }, geminiKey);
|
|
73106
|
+
generatedResult = await generateMCQQuestion({ ...baseClientInput, numberOfOptions: 4 }, geminiKey);
|
|
73201
73107
|
break;
|
|
73108
|
+
// Add other cases as needed
|
|
73202
73109
|
default:
|
|
73203
|
-
|
|
73204
|
-
|
|
73205
|
-
|
|
73206
|
-
|
|
73207
|
-
|
|
73208
|
-
|
|
73209
|
-
completeQuestion
|
|
73210
|
-
completeQuestion.
|
|
73110
|
+
throw new Error(`AI generation for '${finalQuestionType}' is not implemented in this flow.`);
|
|
73111
|
+
}
|
|
73112
|
+
if (generatedResult.error) {
|
|
73113
|
+
throw new Error(generatedResult.error);
|
|
73114
|
+
}
|
|
73115
|
+
if (generatedResult.question) {
|
|
73116
|
+
const completeQuestion = generatedResult.question;
|
|
73117
|
+
completeQuestion.subject = subjectCode;
|
|
73118
|
+
completeQuestion.topic = topicCode;
|
|
73119
|
+
completeQuestion.gradeBand = gradeBand;
|
|
73120
|
+
completeQuestion.bloomLevel = bloomLevelCode;
|
|
73211
73121
|
if (completeQuestion.points === void 0) completeQuestion.points = 10;
|
|
73212
73122
|
onQuestionGenerated(completeQuestion);
|
|
73213
73123
|
toast2({ title: "AI Question Generated", description: "Review and edit the generated question." });
|
|
@@ -73217,9 +73127,9 @@ var AIQuestionGeneratorModal = ({
|
|
|
73217
73127
|
}
|
|
73218
73128
|
} catch (e2) {
|
|
73219
73129
|
console.error("AI Question Generation Error:", e2);
|
|
73220
|
-
let errorMessage = e2.message || "An unknown error occurred
|
|
73221
|
-
if (typeof errorMessage === "string" &&
|
|
73222
|
-
errorMessage = "The provided Google Gemini API Key is invalid
|
|
73130
|
+
let errorMessage = e2.message || "An unknown error occurred.";
|
|
73131
|
+
if (typeof errorMessage === "string" && errorMessage.includes("API key not valid")) {
|
|
73132
|
+
errorMessage = "The provided Google Gemini API Key is invalid. Please check it.";
|
|
73223
73133
|
setGeminiApiKeyExists(false);
|
|
73224
73134
|
}
|
|
73225
73135
|
setError(errorMessage);
|
|
@@ -73228,92 +73138,46 @@ var AIQuestionGeneratorModal = ({
|
|
|
73228
73138
|
setIsLoading(false);
|
|
73229
73139
|
}
|
|
73230
73140
|
};
|
|
73231
|
-
const
|
|
73232
|
-
|
|
73233
|
-
|
|
73234
|
-
|
|
73235
|
-
|
|
73236
|
-
Input,
|
|
73237
|
-
{
|
|
73238
|
-
id: "ai-num-options",
|
|
73239
|
-
type: "number",
|
|
73240
|
-
value: numberOfOptions,
|
|
73241
|
-
onChange: (e2) => setNumberOfOptions(parseInt(e2.target.value, 10)),
|
|
73242
|
-
min: 2,
|
|
73243
|
-
max: questionType === "multiple_choice" ? 6 : 8
|
|
73244
|
-
}
|
|
73245
|
-
), questionType === "multiple_response" && /* @__PURE__ */ React95__namespace.default.createElement(React95__namespace.default.Fragment, null, /* @__PURE__ */ React95__namespace.default.createElement(Label2, { htmlFor: "ai-min-correct" }, "Min Correct Answers (MRQ)"), /* @__PURE__ */ React95__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__ */ React95__namespace.default.createElement(Label2, { htmlFor: "ai-max-correct" }, "Max Correct Answers (MRQ)"), /* @__PURE__ */ React95__namespace.default.createElement(Input, { id: "ai-max-correct", type: "number", value: maxCorrectAnswers, onChange: (e2) => setMaxCorrectAnswers(parseInt(e2.target.value, 10)), min: minCorrectAnswers, max: numberOfOptions })));
|
|
73246
|
-
case "short_answer":
|
|
73247
|
-
case "fill_in_the_blanks":
|
|
73248
|
-
return /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "flex items-center space-x-2" }, /* @__PURE__ */ React95__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__ */ React95__namespace.default.createElement(Label2, { htmlFor: "ai-case-sensitive" }, "Case Sensitive Answers"), questionType === "fill_in_the_blanks" && /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-1 ml-4" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, { htmlFor: "ai-num-blanks" }, "Approx. Number of Blanks (1-5)"), /* @__PURE__ */ React95__namespace.default.createElement(Input, { id: "ai-num-blanks", type: "number", value: numberOfBlanks, onChange: (e2) => setNumberOfBlanks(parseInt(e2.target.value, 10)), min: 1, max: 5 })));
|
|
73249
|
-
case "sequence":
|
|
73250
|
-
return /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, { htmlFor: "ai-num-seq-items" }, "Number of Items to Sequence (2-10)"), /* @__PURE__ */ React95__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 }));
|
|
73251
|
-
case "matching":
|
|
73252
|
-
return /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, { htmlFor: "ai-num-match-pairs" }, "Number of Pairs to Match (2-8)"), /* @__PURE__ */ React95__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 }));
|
|
73253
|
-
default:
|
|
73254
|
-
return null;
|
|
73255
|
-
}
|
|
73141
|
+
const comboboxOptions = {
|
|
73142
|
+
subjects: subjects.map((s2) => ({ value: s2.code, label: s2.name })),
|
|
73143
|
+
topics: filteredTopics.map((t2) => ({ value: t2.code, label: t2.name })),
|
|
73144
|
+
gradeLevels: gradeLevels.map((g) => ({ value: g.code, label: g.name })),
|
|
73145
|
+
bloomLevels: bloomLevels.map((b) => ({ value: b.code, label: b.name }))
|
|
73256
73146
|
};
|
|
73257
73147
|
return /* @__PURE__ */ React95__namespace.default.createElement(React95__namespace.default.Fragment, null, /* @__PURE__ */ React95__namespace.default.createElement(Dialog2, { open: isOpen, onOpenChange: (open) => {
|
|
73258
73148
|
if (!open) onClose();
|
|
73259
|
-
} }, /* @__PURE__ */ React95__namespace.default.createElement(DialogContent2, { className: "sm:max-w-[
|
|
73260
|
-
Button,
|
|
73261
|
-
{
|
|
73262
|
-
variant: "link",
|
|
73263
|
-
className: "p-0 h-auto text-xs text-amber-700 hover:text-amber-800 mt-1",
|
|
73264
|
-
onClick: () => {
|
|
73265
|
-
onClose();
|
|
73266
|
-
setIsApiKeyManagerModalOpen(true);
|
|
73267
|
-
}
|
|
73268
|
-
},
|
|
73269
|
-
"Set API Key Now"
|
|
73270
|
-
)))), /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, { htmlFor: "ai-topic" }, "Topic"), /* @__PURE__ */ React95__namespace.default.createElement(
|
|
73271
|
-
Textarea,
|
|
73272
|
-
{
|
|
73273
|
-
id: "ai-topic",
|
|
73274
|
-
value: topic,
|
|
73275
|
-
onChange: (e2) => setTopic(e2.target.value),
|
|
73276
|
-
placeholder: "e.g., Photosynthesis, World War II History, Basic Algebra Equations",
|
|
73277
|
-
className: "min-h-[80px]"
|
|
73278
|
-
}
|
|
73279
|
-
)), /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, { htmlFor: "ai-context-select" }, "Context (Optional)"), /* @__PURE__ */ React95__namespace.default.createElement(
|
|
73280
|
-
Select2,
|
|
73281
|
-
{
|
|
73282
|
-
value: selectedContextId,
|
|
73283
|
-
onValueChange: (value) => setSelectedContextId(value)
|
|
73284
|
-
},
|
|
73285
|
-
/* @__PURE__ */ React95__namespace.default.createElement(SelectTrigger2, { id: "ai-context-select" }, /* @__PURE__ */ React95__namespace.default.createElement(SelectValue2, { placeholder: "Select a context or choose 'Other'..." })),
|
|
73286
|
-
/* @__PURE__ */ React95__namespace.default.createElement(SelectContent2, null, /* @__PURE__ */ React95__namespace.default.createElement(SelectItem2, { value: "__none__" }, "None (General Topic)"), contextOptions.map((opt) => /* @__PURE__ */ React95__namespace.default.createElement(SelectItem2, { key: opt.contextId, value: opt.contextId }, opt.contextDescription, " ", opt.shortContextId !== "__custom__" ? `(${opt.shortContextId})` : "")))
|
|
73287
|
-
)), selectedContextId === "__custom__" && /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, { htmlFor: "ai-custom-context" }, "Custom Context"), /* @__PURE__ */ React95__namespace.default.createElement(
|
|
73149
|
+
} }, /* @__PURE__ */ React95__namespace.default.createElement(DialogContent2, { className: "sm:max-w-[600px]" }, /* @__PURE__ */ React95__namespace.default.createElement(DialogHeader, null, /* @__PURE__ */ React95__namespace.default.createElement(DialogTitle2, { className: "flex items-center font-headline text-2xl" }, /* @__PURE__ */ React95__namespace.default.createElement(WandSparkles, { className: "mr-2 h-6 w-6 text-primary" }), " AI Question Generator"), /* @__PURE__ */ React95__namespace.default.createElement(DialogDescription2, null, "Provide a prompt and metadata to generate a '", finalQuestionType, "' question.")), /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-4 py-4 max-h-[60vh] overflow-y-auto px-2" }, !geminiApiKeyExists && /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "p-3 mb-4 border border-amber-500 bg-amber-50 rounded-md text-amber-700" }), !questionTypeProp && /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, { htmlFor: "ai-q-type-select" }, "Question Type"), /* @__PURE__ */ React95__namespace.default.createElement(Select2, { value: selectedQuestionType, onValueChange: (v) => setSelectedQuestionType(v) }, /* @__PURE__ */ React95__namespace.default.createElement(SelectTrigger2, { id: "ai-q-type-select" }, /* @__PURE__ */ React95__namespace.default.createElement(SelectValue2, null)), /* @__PURE__ */ React95__namespace.default.createElement(SelectContent2, null, supportedQuestionTypesForAI.map((type) => /* @__PURE__ */ React95__namespace.default.createElement(SelectItem2, { key: type.value, value: type.value }, type.label))))), /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, { htmlFor: "ai-prompt" }, "Prompt / Topic"), /* @__PURE__ */ React95__namespace.default.createElement(
|
|
73288
73150
|
Textarea,
|
|
73289
73151
|
{
|
|
73290
|
-
id: "ai-
|
|
73291
|
-
value:
|
|
73292
|
-
onChange: (e2) =>
|
|
73293
|
-
placeholder: "
|
|
73294
|
-
className: "min-h-[
|
|
73152
|
+
id: "ai-prompt",
|
|
73153
|
+
value: prompt,
|
|
73154
|
+
onChange: (e2) => setPrompt(e2.target.value),
|
|
73155
|
+
placeholder: "e.g., The process of photosynthesis, The causes of World War II, Basic Algebra Equations",
|
|
73156
|
+
className: "min-h-[100px]"
|
|
73295
73157
|
}
|
|
73296
|
-
)), /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "grid grid-cols-2 gap-4" }, /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, {
|
|
73297
|
-
Select2,
|
|
73298
|
-
{
|
|
73299
|
-
value: questionType,
|
|
73300
|
-
onValueChange: (value) => setQuestionType(value)
|
|
73301
|
-
},
|
|
73302
|
-
/* @__PURE__ */ React95__namespace.default.createElement(SelectTrigger2, { id: "ai-question-type" }, /* @__PURE__ */ React95__namespace.default.createElement(SelectValue2, { placeholder: "Select question type" })),
|
|
73303
|
-
/* @__PURE__ */ React95__namespace.default.createElement(SelectContent2, null, supportedQuestionTypesForAI.map((qType) => /* @__PURE__ */ React95__namespace.default.createElement(SelectItem2, { key: qType.value, value: qType.value }, qType.label)))
|
|
73304
|
-
)), /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, { htmlFor: "ai-bloom-level" }, "Bloom Level"), /* @__PURE__ */ React95__namespace.default.createElement(
|
|
73305
|
-
Select2,
|
|
73306
|
-
{
|
|
73307
|
-
value: selectedBloomLevel,
|
|
73308
|
-
onValueChange: (value) => setSelectedBloomLevel(value)
|
|
73309
|
-
},
|
|
73310
|
-
/* @__PURE__ */ React95__namespace.default.createElement(SelectTrigger2, { id: "ai-bloom-level" }, /* @__PURE__ */ React95__namespace.default.createElement(SelectValue2, { placeholder: "Select Bloom Level" })),
|
|
73311
|
-
/* @__PURE__ */ React95__namespace.default.createElement(SelectContent2, null, bloomLevelOptions.map((level) => /* @__PURE__ */ React95__namespace.default.createElement(SelectItem2, { key: level.value, value: level.value }, level.label)))
|
|
73312
|
-
))), renderSpecificParams(), computedDifficultyForDisplay && /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "mt-3 p-3 border rounded-md bg-secondary/50" }, /* @__PURE__ */ React95__namespace.default.createElement("p", { className: "text-sm font-medium text-foreground" }, "Calculated AI Difficulty: ", /* @__PURE__ */ React95__namespace.default.createElement("span", { className: "font-bold text-primary capitalize" }, computedDifficultyForDisplay))), error && /* @__PURE__ */ React95__namespace.default.createElement("p", { className: "text-sm text-destructive flex items-center mt-2" }, /* @__PURE__ */ React95__namespace.default.createElement(TriangleAlert, { className: "mr-1 h-4 w-4" }), " ", error)), /* @__PURE__ */ React95__namespace.default.createElement(DialogFooter, null, /* @__PURE__ */ React95__namespace.default.createElement(DialogClose2, { asChild: true }, /* @__PURE__ */ React95__namespace.default.createElement(Button, { type: "button", variant: "outline" }, "Cancel")), /* @__PURE__ */ React95__namespace.default.createElement(Button, { type: "button", onClick: handleSubmit, disabled: isLoading || !topic.trim() || !geminiApiKeyExists }, isLoading ? /* @__PURE__ */ React95__namespace.default.createElement(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ React95__namespace.default.createElement(WandSparkles, { className: "mr-2 h-4 w-4" }), "Generate Question")))), /* @__PURE__ */ React95__namespace.default.createElement(APIKeyManagerModal, { isOpen: isApiKeyManagerModalOpen, onClose: handleApiKeyModalClose }));
|
|
73158
|
+
)), /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "grid grid-cols-2 gap-4" }, /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, null, "Subject"), /* @__PURE__ */ React95__namespace.default.createElement(EditableCombobox, { options: comboboxOptions.subjects, value: subjectCode, onChange: setSubjectCode, placeholder: "Select or type a Subject..." })), /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, null, "Topic"), /* @__PURE__ */ React95__namespace.default.createElement(EditableCombobox, { options: comboboxOptions.topics, value: topicCode, onChange: setTopicCode, placeholder: "Select or type a Topic...", disabled: !subjectCode })), /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, null, "Grade Level"), /* @__PURE__ */ React95__namespace.default.createElement(EditableCombobox, { options: comboboxOptions.gradeLevels, value: gradeBand, onChange: setGradeBand, placeholder: "Select or type a Grade..." })), /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, null, "Bloom's Level"), /* @__PURE__ */ React95__namespace.default.createElement(EditableCombobox, { options: comboboxOptions.bloomLevels, value: bloomLevelCode, onChange: setBloomLevelCode, placeholder: "Select a Bloom's Level..." }))), error && /* @__PURE__ */ React95__namespace.default.createElement("p", { className: "text-sm text-destructive flex items-center mt-2" }, /* @__PURE__ */ React95__namespace.default.createElement(TriangleAlert, { className: "mr-1 h-4 w-4" }), " ", error)), /* @__PURE__ */ React95__namespace.default.createElement(DialogFooter, null, /* @__PURE__ */ React95__namespace.default.createElement(DialogClose2, { asChild: true }, /* @__PURE__ */ React95__namespace.default.createElement(Button, { type: "button", variant: "outline" }, "Cancel")), /* @__PURE__ */ React95__namespace.default.createElement(Button, { type: "button", onClick: handleSubmit, disabled: isLoading || !prompt.trim() || !geminiApiKeyExists }, isLoading ? /* @__PURE__ */ React95__namespace.default.createElement(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ React95__namespace.default.createElement(WandSparkles, { className: "mr-2 h-4 w-4" }), "Generate Question")))), /* @__PURE__ */ React95__namespace.default.createElement(APIKeyManagerModal, { isOpen: isApiKeyManagerModalOpen, onClose: handleApiKeyModalClose }));
|
|
73313
73159
|
};
|
|
73314
73160
|
|
|
73315
73161
|
// src/react-ui/components/authoring/AIFullQuizGeneratorModal.tsx
|
|
73316
73162
|
init_react_shim();
|
|
73163
|
+
|
|
73164
|
+
// src/data/contextOptions.ts
|
|
73165
|
+
init_react_shim();
|
|
73166
|
+
var contextOptions = [
|
|
73167
|
+
{ shortContextId: "A", contextId: "THEO_ABS", contextDescription: "L\xFD thuy\u1EBFt/Tr\u1EEBu t\u01B0\u1EE3ng", contextExample: '"Ph\xE1t bi\u1EC3u \u0111\u1ECBnh lu\u1EADt III Newton." ho\u1EB7c "Gi\u1EA3i th\xEDch kh\xE1i ni\u1EC7m \u0111\u1EA1o h\xE0m."', keywords: "l\xFD thuy\u1EBFt, tr\u1EEBu t\u01B0\u1EE3ng, \u0111\u1ECBnh ngh\u0129a, kh\xE1i ni\u1EC7m, nguy\xEAn l\xFD, c\xF4ng th\u1EE9c, \u0111\u1ECBnh lu\u1EADt" },
|
|
73168
|
+
{ shortContextId: "B", contextId: "SPEC_CASE", contextDescription: "V\xED d\u1EE5 C\u1EE5 th\u1EC3/Tr\u01B0\u1EDDng h\u1EE3p Ri\xEAng", contextExample: '"T\xEDnh l\u1EF1c t\xE1c d\u1EE5ng l\xEAn v\u1EADt n\u1EB7ng 2kg r\u01A1i t\u1EF1 do." ho\u1EB7c "Cho h\xE0m s\u1ED1 y = x^2, t\xECm \u0111\u1EA1o h\xE0m t\u1EA1i x = 3."', keywords: "v\xED d\u1EE5, c\u1EE5 th\u1EC3, tr\u01B0\u1EDDng h\u1EE3p ri\xEAng, \xE1p d\u1EE5ng, t\xEDnh to\xE1n, minh h\u1ECDa, s\u1ED1 li\u1EC7u c\u1EE5 th\u1EC3" },
|
|
73169
|
+
{ shortContextId: "C", contextId: "NAT_OBS", contextDescription: "Hi\u1EC7n t\u01B0\u1EE3ng T\u1EF1 nhi\xEAn/Quan s\xE1t", contextExample: '"Gi\u1EA3i th\xEDch t\u1EA1i sao c\u1EA7u v\u1ED3ng xu\u1EA5t hi\u1EC7n sau c\u01A1n m\u01B0a." ho\u1EB7c "M\xF4 t\u1EA3 qu\xE1 tr\xECnh quang h\u1EE3p \u1EDF l\xE1 c\xE2y."', keywords: "hi\u1EC7n t\u01B0\u1EE3ng, t\u1EF1 nhi\xEAn, quan s\xE1t, gi\u1EA3i th\xEDch, m\xF4 t\u1EA3, th\u1EBF gi\u1EDBi th\u1EF1c, sinh h\u1ECDc, v\u1EADt l\xFD" },
|
|
73170
|
+
{ shortContextId: "D", contextId: "TECH_ENG", contextDescription: "\u1EE8ng d\u1EE5ng C\xF4ng ngh\u1EC7/K\u1EF9 thu\u1EADt", contextExample: '"Nguy\xEAn l\xFD ho\u1EA1t \u0111\u1ED9ng c\u1EE7a \u0111\u1ED9ng c\u01A1 \u0111\u1ED1t trong l\xE0 g\xEC?" ho\u1EB7c "Pin m\u1EB7t tr\u1EDDi chuy\u1EC3n \u0111\u1ED5i n\u0103ng l\u01B0\u1EE3ng \xE1nh s\xE1ng th\xE0nh \u0111i\u1EC7n n\u0103ng nh\u01B0 th\u1EBF n\xE0o?"', keywords: "\u1EE9ng d\u1EE5ng, c\xF4ng ngh\u1EC7, k\u1EF9 thu\u1EADt, thi\u1EBFt b\u1ECB, m\xE1y m\xF3c, ho\u1EA1t \u0111\u1ED9ng, nguy\xEAn l\xFD, ch\u1EBF t\u1EA1o" },
|
|
73171
|
+
{ shortContextId: "E", contextId: "EXP_INV", contextDescription: "Th\xED nghi\u1EC7m/\u0110i\u1EC1u tra Khoa h\u1ECDc", contextExample: '"Thi\u1EBFt k\u1EBF th\xED nghi\u1EC7m ch\u1EE9ng minh \u0111\u1ECBnh lu\u1EADt b\u1EA3o to\xE0n n\u0103ng l\u01B0\u1EE3ng." ho\u1EB7c "Ph\xE2n t\xEDch k\u1EBFt qu\u1EA3 th\xED nghi\u1EC7m v\u1EC1 t\u1ED1c \u0111\u1ED9 ph\u1EA3n \u1EE9ng."', keywords: "th\xED nghi\u1EC7m, \u0111i\u1EC1u tra, khoa h\u1ECDc, thi\u1EBFt k\u1EBF, quy tr\xECnh, k\u1EBFt qu\u1EA3, ph\xE2n t\xEDch, d\u1EEF li\u1EC7u" },
|
|
73172
|
+
{ shortContextId: "F", contextId: "REAL_PROB", contextDescription: "V\u1EA5n \u0111\u1EC1 Th\u1EF1c t\u1EBF/X\xE3 h\u1ED9i/M\xF4i tr\u01B0\u1EDDng", contextExample: '"\u0110\u1EC1 xu\u1EA5t gi\u1EA3i ph\xE1p gi\u1EA3m thi\u1EC3u \xF4 nhi\u1EC5m kh\xF4ng kh\xED t\u1EA1i \u0111\xF4 th\u1ECB." ho\u1EB7c "Ph\xE2n t\xEDch \u1EA3nh h\u01B0\u1EDFng c\u1EE7a bi\u1EBFn \u0111\u1ED5i kh\xED h\u1EADu \u0111\u1EBFn n\xF4ng nghi\u1EC7p."', keywords: "v\u1EA5n \u0111\u1EC1, th\u1EF1c t\u1EBF, x\xE3 h\u1ED9i, m\xF4i tr\u01B0\u1EDDng, gi\u1EA3i ph\xE1p, ph\xE2n t\xEDch, \u1EA3nh h\u01B0\u1EDFng, b\u1EC1n v\u1EEFng" },
|
|
73173
|
+
{ shortContextId: "G", contextId: "DATA_MOD", contextDescription: "Di\u1EC5n gi\u1EA3i D\u1EEF li\u1EC7u/M\xF4 h\xECnh h\xF3a", contextExample: '"D\u1EF1a v\xE0o bi\u1EC3u \u0111\u1ED3, nh\u1EADn x\xE9t xu h\u01B0\u1EDBng nhi\u1EC7t \u0111\u1ED9 to\xE0n c\u1EA7u." ho\u1EB7c "X\xE2y d\u1EF1ng m\xF4 h\xECnh to\xE1n h\u1ECDc m\xF4 t\u1EA3 s\u1EF1 t\u0103ng tr\u01B0\u1EDFng d\xE2n s\u1ED1."', keywords: "d\u1EEF li\u1EC7u, bi\u1EC3u \u0111\u1ED3, b\u1EA3ng s\u1ED1 li\u1EC7u, m\xF4 h\xECnh, di\u1EC5n gi\u1EA3i, ph\xE2n t\xEDch, xu h\u01B0\u1EDBng, d\u1EF1 \u0111o\xE1n" },
|
|
73174
|
+
{ shortContextId: "H", contextId: "HIST_SCI", contextDescription: "L\u1ECBch s\u1EED/Ph\xE1t tri\u1EC3n Khoa h\u1ECDc", contextExample: '"Tr\xECnh b\xE0y b\u1ED1i c\u1EA3nh ra \u0111\u1EDDi thuy\u1EBFt t\u01B0\u01A1ng \u0111\u1ED1i c\u1EE7a Einstein." ho\u1EB7c "Ai l\xE0 ng\u01B0\u1EDDi \u0111\u1EA7u ti\xEAn ph\xE1t hi\u1EC7n ra c\u1EA5u tr\xFAc DNA?"', keywords: "l\u1ECBch s\u1EED, ph\xE1t tri\u1EC3n, khoa h\u1ECDc, nh\xE0 khoa h\u1ECDc, ph\xE1t minh, kh\xE1m ph\xE1, b\u1ED1i c\u1EA3nh" },
|
|
73175
|
+
{ shortContextId: "I", contextId: "INTERDISC", contextDescription: "Li\xEAn ng\xE0nh (Interdisciplinary)", contextExample: '"S\u1EED d\u1EE5ng ki\u1EBFn th\u1EE9c To\xE1n v\xE0 V\u1EADt l\xFD \u0111\u1EC3 t\xEDnh qu\u1EF9 \u0111\u1EA1o c\u1EE7a v\u1EADt n\xE9m xi\xEAn." ho\u1EB7c "Ph\xE2n t\xEDch c\u01A1 ch\u1EBF h\xF3a sinh c\u1EE7a qu\xE1 tr\xECnh ti\xEAu h\xF3a."', keywords: "li\xEAn ng\xE0nh, t\xEDch h\u1EE3p, To\xE1n-L\xFD, Sinh-H\xF3a, Khoa h\u1ECDc-C\xF4ng ngh\u1EC7, k\u1EBFt n\u1ED1i ki\u1EBFn th\u1EE9c" },
|
|
73176
|
+
{ shortContextId: "J", contextId: "HYPO_COMP", contextDescription: "Gi\u1EA3 \u0111\u1ECBnh/So s\xE1nh T\xECnh hu\u1ED1ng", contextExample: '"N\u1EBFu Tr\xE1i \u0110\u1EA5t kh\xF4ng c\xF3 t\u1EEB tr\u01B0\u1EDDng th\xEC \u0111i\u1EC1u g\xEC s\u1EBD x\u1EA3y ra?" ho\u1EB7c "So s\xE1nh \u01B0u nh\u01B0\u1EE3c \u0111i\u1EC3m c\u1EE7a n\u0103ng l\u01B0\u1EE3ng h\u1EA1t nh\xE2n v\xE0 n\u0103ng l\u01B0\u1EE3ng m\u1EB7t tr\u1EDDi."', keywords: "gi\u1EA3 \u0111\u1ECBnh, so s\xE1nh, t\xECnh hu\u1ED1ng, n\u1EBFu...th\xEC, \u01B0u \u0111i\u1EC3m, nh\u01B0\u1EE3c \u0111i\u1EC3m, ph\xE2n t\xEDch, \u0111\xE1nh gi\xE1" },
|
|
73177
|
+
{ shortContextId: "__custom__", contextId: "__custom__", contextDescription: "Other (Custom Input)", contextExample: "", keywords: "custom, other, specific" }
|
|
73178
|
+
];
|
|
73179
|
+
|
|
73180
|
+
// src/react-ui/components/authoring/AIFullQuizGeneratorModal.tsx
|
|
73317
73181
|
var availableQuestionTypesForFullQuiz = [
|
|
73318
73182
|
{ value: "true_false", label: "True/False" },
|
|
73319
73183
|
{ value: "multiple_choice", label: "Multiple Choice" },
|
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, LearningObjectiveMetadata, 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-DqFRlFU3.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, 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, n 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, 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, n as Toaster, T as TopicManager, t as toast, u as useToast } from './toaster-CKS4zoRY.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, LearningObjectiveMetadata, 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-DqVlSO3r.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, 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, n 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, 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, n as Toaster, T as TopicManager, t as toast, u as useToast } from './toaster-DLJ_2W9u.js';
|
|
6
6
|
import 'clsx';
|
|
7
7
|
import 'zod';
|
|
8
8
|
import 'react';
|