@thanh01.pmt/interactive-quiz-kit 1.0.64 → 1.0.66

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.
@@ -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,122 @@ 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
- // <-- NHẬN PROP
73033
+ language: language3,
73034
+ questionType: questionTypeProp,
73035
+ subjects = [],
73036
+ topics = [],
73037
+ gradeLevels = [],
73038
+ bloomLevels = []
73093
73039
  }) => {
73094
- const [topic, setTopic] = React95.useState("");
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();
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");
73103
73049
  const [numberOfOptions, setNumberOfOptions] = React95.useState(4);
73104
- const [minCorrectAnswers, setMinCorrectAnswers] = React95.useState(1);
73105
- const [maxCorrectAnswers, setMaxCorrectAnswers] = React95.useState(2);
73050
+ const [minCorrectAnswers, setMinCorrectAnswers] = React95.useState(2);
73051
+ const [maxCorrectAnswers, setMaxCorrectAnswers] = React95.useState(3);
73106
73052
  const [isCaseSensitive, setIsCaseSensitive] = React95.useState(false);
73107
73053
  const [numberOfBlanks, setNumberOfBlanks] = React95.useState(2);
73108
73054
  const [numberOfSequenceItems, setNumberOfSequenceItems] = React95.useState(4);
73109
73055
  const [numberOfMatchingPairs, setNumberOfMatchingPairs] = React95.useState(4);
73110
73056
  const [isApiKeyManagerModalOpen, setIsApiKeyManagerModalOpen] = React95.useState(false);
73111
73057
  const [geminiApiKeyExists, setGeminiApiKeyExists] = React95.useState(false);
73058
+ const finalQuestionType = questionTypeProp || selectedQuestionType;
73112
73059
  React95.useEffect(() => {
73113
73060
  if (isOpen) {
73114
- setTopic("");
73115
- setSelectedContextId("__none__");
73116
- setCustomContextInput("");
73117
- setQuestionType("multiple_choice");
73118
- setSelectedBloomLevel("remembering");
73061
+ setPrompt("");
73119
73062
  setError(null);
73120
73063
  setIsLoading(false);
73121
- setNumberOfOptions(4);
73122
- setMinCorrectAnswers(1);
73123
- setMaxCorrectAnswers(2);
73124
- setIsCaseSensitive(false);
73125
- setNumberOfBlanks(2);
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);
73064
+ setSubjectCode("");
73065
+ setTopicCode("");
73066
+ setGradeBand("");
73067
+ setBloomLevelCode("");
73068
+ setSelectedQuestionType(questionTypeProp || "multiple_choice");
73135
73069
  setGeminiApiKeyExists(APIKeyService.hasAPIKey(GEMINI_API_KEY_SERVICE_NAME));
73136
73070
  }
73137
- }, [selectedContextId, selectedBloomLevel, questionType, customContextInput, isOpen]);
73071
+ }, [isOpen, questionTypeProp]);
73072
+ const filteredTopics = React95.useMemo(() => {
73073
+ if (!subjectCode) return [];
73074
+ return topics.filter((t2) => t2.subjectCode === subjectCode);
73075
+ }, [subjectCode, topics]);
73138
73076
  const handleApiKeyModalClose = () => {
73139
73077
  setIsApiKeyManagerModalOpen(false);
73140
73078
  setGeminiApiKeyExists(APIKeyService.hasAPIKey(GEMINI_API_KEY_SERVICE_NAME));
73141
73079
  };
73142
73080
  const handleSubmit = async () => {
73143
- if (!topic.trim()) {
73144
- setError("Please provide a topic for the question.");
73081
+ if (!prompt.trim()) {
73082
+ setError("Please provide a prompt for the question.");
73145
73083
  return;
73146
73084
  }
73147
73085
  const geminiKey = APIKeyService.getAPIKey(GEMINI_API_KEY_SERVICE_NAME);
73148
73086
  if (!geminiKey) {
73149
- setError("Gemini API Key is not set. Please set it via the settings icon in the header or the button below.");
73087
+ setError("Gemini API Key is not set. Please configure it.");
73150
73088
  setGeminiApiKeyExists(false);
73151
73089
  return;
73152
73090
  }
73153
73091
  setGeminiApiKeyExists(true);
73154
73092
  setError(null);
73155
73093
  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
73094
  try {
73165
- let generatedQuestionData = null;
73095
+ const quizContext = {
73096
+ plannedTopic: prompt,
73097
+ originalSubject: subjectCode,
73098
+ originalTopic: topicCode,
73099
+ gradeBand,
73100
+ plannedBloomLevel: bloomLevelCode
73101
+ };
73166
73102
  const baseClientInput = {
73167
- topic,
73168
73103
  language: language3,
73169
- // <-- SỬ DỤNG PROP
73170
- difficulty: finalDifficultyForAI,
73171
- contextDescription: contextDescriptionForAI,
73172
- selectedContextId: selectedContextId !== "__none__" && selectedContextId !== "__custom__" ? selectedContextId : selectedContextId === "__custom__" && customContextInput.trim() ? "__custom__" : void 0
73104
+ difficulty: "medium",
73105
+ quizContext
73173
73106
  };
73174
- switch (questionType) {
73107
+ let generatedResult = {};
73108
+ switch (finalQuestionType) {
73175
73109
  case "true_false":
73176
- generatedQuestionData = await generateTrueFalseQuestion(baseClientInput, geminiKey);
73110
+ generatedResult = await generateTrueFalseQuestion(baseClientInput, geminiKey);
73177
73111
  break;
73178
73112
  case "multiple_choice":
73179
- generatedQuestionData = await generateMCQQuestion({ ...baseClientInput, numberOfOptions }, geminiKey);
73113
+ generatedResult = await generateMCQQuestion({ ...baseClientInput, numberOfOptions }, geminiKey);
73180
73114
  break;
73181
73115
  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);
73116
+ generatedResult = await generateMRQQuestion({ ...baseClientInput, numberOfOptions, minCorrectAnswers, maxCorrectAnswers }, geminiKey);
73186
73117
  break;
73187
73118
  case "short_answer":
73188
- generatedQuestionData = await generateShortAnswerQuestion({ ...baseClientInput, isCaseSensitive }, geminiKey);
73119
+ generatedResult = await generateShortAnswerQuestion({ ...baseClientInput, isCaseSensitive }, geminiKey);
73189
73120
  break;
73190
73121
  case "numeric":
73191
- generatedQuestionData = await generateNumericQuestion({ ...baseClientInput, allowDecimals: true, tolerance: 0 }, geminiKey);
73122
+ generatedResult = await generateNumericQuestion({ ...baseClientInput, allowDecimals: true, tolerance: 0 }, geminiKey);
73192
73123
  break;
73193
73124
  case "fill_in_the_blanks":
73194
- generatedQuestionData = await generateFillInTheBlanksQuestion({ ...baseClientInput, numberOfBlanks, isCaseSensitive }, geminiKey);
73125
+ generatedResult = await generateFillInTheBlanksQuestion({ ...baseClientInput, numberOfBlanks, isCaseSensitive }, geminiKey);
73195
73126
  break;
73196
73127
  case "sequence":
73197
- generatedQuestionData = await generateSequenceQuestion({ ...baseClientInput, numberOfItems: numberOfSequenceItems }, geminiKey);
73128
+ generatedResult = await generateSequenceQuestion({ ...baseClientInput, numberOfItems: numberOfSequenceItems }, geminiKey);
73198
73129
  break;
73199
73130
  case "matching":
73200
- generatedQuestionData = await generateMatchingQuestion({ ...baseClientInput, numberOfPairs: numberOfMatchingPairs, shuffleOptions: true }, geminiKey);
73131
+ generatedResult = await generateMatchingQuestion({ ...baseClientInput, numberOfPairs: numberOfMatchingPairs, shuffleOptions: true }, geminiKey);
73201
73132
  break;
73202
73133
  default:
73203
- const _exhaustiveCheck = questionType;
73204
- throw new Error(`AI generation for question type "${_exhaustiveCheck}" is not implemented yet.`);
73205
- }
73206
- if (generatedQuestionData && generatedQuestionData.question) {
73207
- const completeQuestion = generatedQuestionData.question;
73208
- completeQuestion.difficulty = finalDifficultyForAI;
73209
- completeQuestion.bloomLevel = selectedBloomLevel;
73210
- completeQuestion.topic = completeQuestion.topic || topic;
73134
+ throw new Error(`AI generation for '${finalQuestionType}' is not implemented in this flow.`);
73135
+ }
73136
+ if (generatedResult.error) {
73137
+ throw new Error(generatedResult.error);
73138
+ }
73139
+ if (generatedResult.question) {
73140
+ const completeQuestion = generatedResult.question;
73141
+ completeQuestion.subject = subjectCode;
73142
+ completeQuestion.topic = topicCode;
73143
+ completeQuestion.gradeBand = gradeBand;
73144
+ completeQuestion.bloomLevel = bloomLevelCode;
73211
73145
  if (completeQuestion.points === void 0) completeQuestion.points = 10;
73212
73146
  onQuestionGenerated(completeQuestion);
73213
73147
  toast2({ title: "AI Question Generated", description: "Review and edit the generated question." });
@@ -73217,9 +73151,9 @@ var AIQuestionGeneratorModal = ({
73217
73151
  }
73218
73152
  } catch (e2) {
73219
73153
  console.error("AI Question Generation Error:", e2);
73220
- let errorMessage = e2.message || "An unknown error occurred during AI question generation.";
73221
- if (typeof errorMessage === "string" && (errorMessage.includes("API key not valid") || errorMessage.startsWith("FAILED_PRECONDITION"))) {
73222
- errorMessage = "The provided Google Gemini API Key is invalid or not configured correctly. Please check your API key in the settings.";
73154
+ let errorMessage = e2.message || "An unknown error occurred.";
73155
+ if (typeof errorMessage === "string" && errorMessage.includes("API key not valid")) {
73156
+ errorMessage = "The provided Google Gemini API Key is invalid. Please check it.";
73223
73157
  setGeminiApiKeyExists(false);
73224
73158
  }
73225
73159
  setError(errorMessage);
@@ -73228,11 +73162,17 @@ var AIQuestionGeneratorModal = ({
73228
73162
  setIsLoading(false);
73229
73163
  }
73230
73164
  };
73165
+ const comboboxOptions = {
73166
+ subjects: subjects.map((s2) => ({ value: s2.code, label: s2.name })),
73167
+ topics: filteredTopics.map((t2) => ({ value: t2.code, label: t2.name })),
73168
+ gradeLevels: gradeLevels.map((g) => ({ value: g.code, label: g.name })),
73169
+ bloomLevels: bloomLevels.map((b) => ({ value: b.code, label: b.name }))
73170
+ };
73231
73171
  const renderSpecificParams = () => {
73232
- switch (questionType) {
73172
+ switch (finalQuestionType) {
73233
73173
  case "multiple_choice":
73234
73174
  case "multiple_response":
73235
- return /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, { htmlFor: "ai-num-options" }, "Number of Options (2-6 for MCQ, 2-8 for MRQ)"), /* @__PURE__ */ React95__namespace.default.createElement(
73175
+ return /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2 pt-4 border-t" }, /* @__PURE__ */ React95__namespace.default.createElement(Label2, { htmlFor: "ai-num-options" }, "Number of Options (2-8)"), /* @__PURE__ */ React95__namespace.default.createElement(
73236
73176
  Input,
73237
73177
  {
73238
73178
  id: "ai-num-options",
@@ -73240,80 +73180,54 @@ var AIQuestionGeneratorModal = ({
73240
73180
  value: numberOfOptions,
73241
73181
  onChange: (e2) => setNumberOfOptions(parseInt(e2.target.value, 10)),
73242
73182
  min: 2,
73243
- max: questionType === "multiple_choice" ? 6 : 8
73183
+ max: 8
73244
73184
  }
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 })));
73185
+ ), finalQuestionType === "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"), /* @__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"), /* @__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
73186
  case "short_answer":
73247
73187
  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 })));
73188
+ return /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "flex items-center space-x-2 pt-4 border-t" }, /* @__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"), finalQuestionType === "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" }, "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
73189
  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 }));
73190
+ return /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2 pt-4 border-t" }, /* @__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
73191
  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 }));
73192
+ return /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-2 pt-4 border-t" }, /* @__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
73193
  default:
73254
73194
  return null;
73255
73195
  }
73256
73196
  };
73257
73197
  return /* @__PURE__ */ React95__namespace.default.createElement(React95__namespace.default.Fragment, null, /* @__PURE__ */ React95__namespace.default.createElement(Dialog2, { open: isOpen, onOpenChange: (open) => {
73258
73198
  if (!open) onClose();
73259
- } }, /* @__PURE__ */ React95__namespace.default.createElement(DialogContent2, { className: "sm:max-w-[550px]" }, /* @__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 inputs and let AI generate a question for you.")), /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "space-y-4 py-4 max-h-[60vh] overflow-y-auto pl-2 pr-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" }, /* @__PURE__ */ React95__namespace.default.createElement("div", { className: "flex items-start" }, /* @__PURE__ */ React95__namespace.default.createElement(TriangleAlert, { className: "h-5 w-5 mr-2 mt-0.5 flex-shrink-0" }), /* @__PURE__ */ React95__namespace.default.createElement("div", null, /* @__PURE__ */ React95__namespace.default.createElement("p", { className: "font-semibold" }, "Gemini API Key Required"), /* @__PURE__ */ React95__namespace.default.createElement("p", { className: "text-xs" }, "To use AI question generation, please set your Google Gemini API Key."), /* @__PURE__ */ React95__namespace.default.createElement(
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(
73199
+ } }, /* @__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
73200
  Textarea,
73289
73201
  {
73290
- id: "ai-custom-context",
73291
- value: customContextInput,
73292
- onChange: (e2) => setCustomContextInput(e2.target.value),
73293
- placeholder: "Enter your specific context here...",
73294
- className: "min-h-[60px]"
73202
+ id: "ai-prompt",
73203
+ value: prompt,
73204
+ onChange: (e2) => setPrompt(e2.target.value),
73205
+ placeholder: "e.g., The process of photosynthesis, The causes of World War II, Basic Algebra Equations",
73206
+ className: "min-h-[100px]"
73295
73207
  }
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, { htmlFor: "ai-question-type" }, "Question Type"), /* @__PURE__ */ React95__namespace.default.createElement(
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 }));
73208
+ )), /* @__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..." }))), renderSpecificParams(), 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
73209
  };
73314
73210
 
73315
73211
  // src/react-ui/components/authoring/AIFullQuizGeneratorModal.tsx
73316
73212
  init_react_shim();
73213
+
73214
+ // src/data/contextOptions.ts
73215
+ init_react_shim();
73216
+ var contextOptions = [
73217
+ { 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" },
73218
+ { 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" },
73219
+ { 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" },
73220
+ { 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" },
73221
+ { 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" },
73222
+ { 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" },
73223
+ { 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" },
73224
+ { 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" },
73225
+ { 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" },
73226
+ { 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" },
73227
+ { shortContextId: "__custom__", contextId: "__custom__", contextDescription: "Other (Custom Input)", contextExample: "", keywords: "custom, other, specific" }
73228
+ ];
73229
+
73230
+ // src/react-ui/components/authoring/AIFullQuizGeneratorModal.tsx
73317
73231
  var availableQuestionTypesForFullQuiz = [
73318
73232
  { value: "true_false", label: "True/False" },
73319
73233
  { value: "multiple_choice", label: "Multiple Choice" },
@@ -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-FX787Evl.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-CKS4zoRY.cjs';
6
6
  import 'clsx';
7
7
  import 'zod';
8
8
  import 'react';
@@ -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-BTfAUpDp.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-DLJ_2W9u.js';
6
6
  import 'clsx';
7
7
  import 'zod';
8
8
  import 'react';