@thanh01.pmt/interactive-quiz-kit 1.0.31 → 1.0.33
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 +124 -65
- package/dist/ai.mjs +124 -65
- package/dist/authoring.cjs +143 -81
- package/dist/authoring.d.cts +1 -1
- package/dist/authoring.d.ts +1 -1
- package/dist/authoring.mjs +143 -81
- package/dist/index.cjs +13 -8
- package/dist/index.mjs +13 -8
- package/dist/player.cjs +13 -8
- package/dist/player.mjs +13 -8
- package/dist/react-ui.cjs +140 -184
- package/dist/react-ui.d.cts +1 -1
- package/dist/react-ui.d.ts +1 -1
- package/dist/react-ui.mjs +140 -184
- package/dist/{toaster-Blf5k3DP.d.cts → toaster-D1bLqmd_.d.cts} +1 -1
- package/dist/{toaster-BrChkQ23.d.ts → toaster-eWZIxSVc.d.ts} +1 -1
- package/package.json +1 -1
package/dist/authoring.cjs
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var zod = require('zod');
|
|
4
|
-
var genkit = require('genkit');
|
|
5
|
-
var googleai = require('@genkit-ai/googleai');
|
|
6
|
-
var JSZip = require('jszip');
|
|
7
4
|
var genai = require('@google/genai');
|
|
5
|
+
var JSZip = require('jszip');
|
|
8
6
|
var React96 = require('react');
|
|
9
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
8
|
var ReactDOM4 = require('react-dom');
|
|
@@ -2789,10 +2787,7 @@ var EvaluateUserCodeOutputSchema = AIEvaluationOutputSchema;
|
|
|
2789
2787
|
// src/ai/flows/evaluate-user-code.ts
|
|
2790
2788
|
async function evaluateUserCode(clientInput, apiKey) {
|
|
2791
2789
|
try {
|
|
2792
|
-
const
|
|
2793
|
-
plugins: [googleai.googleAI({ apiKey })],
|
|
2794
|
-
model: googleai.gemini20Flash
|
|
2795
|
-
});
|
|
2790
|
+
const genAI = new genai.GoogleGenAI({ apiKey });
|
|
2796
2791
|
const { language: language3, problemPrompt, userCode, testCase } = clientInput;
|
|
2797
2792
|
const promptText = `
|
|
2798
2793
|
You are an expert Code Judge and Teaching Assistant for a ${language3} programming course.
|
|
@@ -2829,8 +2824,17 @@ Return ONLY the JSON object with this EXACT structure.
|
|
|
2829
2824
|
\`\`\`
|
|
2830
2825
|
|
|
2831
2826
|
Return only the JSON response.`;
|
|
2832
|
-
const
|
|
2833
|
-
const
|
|
2827
|
+
const modelName = "gemini-1.5-flash";
|
|
2828
|
+
const contents = [{ role: "user", parts: [{ text: promptText }] }];
|
|
2829
|
+
const result = await genAI.models.generateContent({
|
|
2830
|
+
model: modelName,
|
|
2831
|
+
contents
|
|
2832
|
+
});
|
|
2833
|
+
const response = result;
|
|
2834
|
+
const rawText = response.candidates?.[0]?.content?.parts?.[0]?.text || "";
|
|
2835
|
+
if (!rawText) {
|
|
2836
|
+
throw new Error("AI returned an empty response.");
|
|
2837
|
+
}
|
|
2834
2838
|
const jsonText = extractJsonFromMarkdown(rawText);
|
|
2835
2839
|
const aiGeneratedContent = JSON.parse(jsonText);
|
|
2836
2840
|
return EvaluateUserCodeOutputSchema.parse(aiGeneratedContent);
|
|
@@ -10436,10 +10440,7 @@ var AIQuizReviewOutputSchema = zod.z.object({
|
|
|
10436
10440
|
// src/ai/flows/generate-quiz-review.ts
|
|
10437
10441
|
async function generateQuizReview(clientInput, apiKey) {
|
|
10438
10442
|
try {
|
|
10439
|
-
const
|
|
10440
|
-
plugins: [googleai.googleAI({ apiKey })],
|
|
10441
|
-
model: googleai.gemini20Flash
|
|
10442
|
-
});
|
|
10443
|
+
const genAI = new genai.GoogleGenAI({ apiKey });
|
|
10443
10444
|
const resultsString = JSON.stringify(clientInput.questionResults, null, 2);
|
|
10444
10445
|
const promptText = `
|
|
10445
10446
|
You are an expert educational tutor. Your task is to analyze a student's quiz results and provide a detailed, helpful review in ${clientInput.language}.
|
|
@@ -10476,8 +10477,17 @@ Return a single, valid JSON object with this EXACT format.
|
|
|
10476
10477
|
\`\`\`
|
|
10477
10478
|
|
|
10478
10479
|
Return only the valid JSON response.`;
|
|
10479
|
-
const
|
|
10480
|
-
const
|
|
10480
|
+
const modelName = "gemini-1.5-flash";
|
|
10481
|
+
const contents = [{ role: "user", parts: [{ text: promptText }] }];
|
|
10482
|
+
const result = await genAI.models.generateContent({
|
|
10483
|
+
model: modelName,
|
|
10484
|
+
contents
|
|
10485
|
+
});
|
|
10486
|
+
const response = result;
|
|
10487
|
+
const rawText = response.candidates?.[0]?.content?.parts?.[0]?.text || "";
|
|
10488
|
+
if (!rawText) {
|
|
10489
|
+
throw new Error("AI returned an empty response.");
|
|
10490
|
+
}
|
|
10481
10491
|
const jsonText = extractJsonFromMarkdown(rawText);
|
|
10482
10492
|
const aiGeneratedContent = JSON.parse(jsonText);
|
|
10483
10493
|
const validatedOutput = AIQuizReviewOutputSchema.parse(aiGeneratedContent);
|
|
@@ -10524,10 +10534,7 @@ var PracticeSuggestionOutputSchema = zod.z.object({
|
|
|
10524
10534
|
});
|
|
10525
10535
|
async function generatePracticeSuggestion(clientInput, apiKey) {
|
|
10526
10536
|
try {
|
|
10527
|
-
const
|
|
10528
|
-
plugins: [googleai.googleAI({ apiKey })],
|
|
10529
|
-
model: googleai.gemini20Flash
|
|
10530
|
-
});
|
|
10537
|
+
const genAI = new genai.GoogleGenAI({ apiKey });
|
|
10531
10538
|
const { language: language3, userName, performanceByTopic, recentHistory, allAvailableTopics } = clientInput;
|
|
10532
10539
|
const promptText = `
|
|
10533
10540
|
You are a friendly and insightful AI Learning Coach. Your goal is to provide a personalized practice suggestion for a student named ${userName || "there"}.
|
|
@@ -10566,8 +10573,17 @@ Return a single, valid JSON object in this exact format. All text must be in ${l
|
|
|
10566
10573
|
}
|
|
10567
10574
|
|
|
10568
10575
|
Return only the JSON response.`;
|
|
10569
|
-
const
|
|
10570
|
-
const
|
|
10576
|
+
const modelName = "gemini-1.5-flash";
|
|
10577
|
+
const contents = [{ role: "user", parts: [{ text: promptText }] }];
|
|
10578
|
+
const result = await genAI.models.generateContent({
|
|
10579
|
+
model: modelName,
|
|
10580
|
+
contents
|
|
10581
|
+
});
|
|
10582
|
+
const response = result;
|
|
10583
|
+
const rawText = response.candidates?.[0]?.content?.parts?.[0]?.text || "";
|
|
10584
|
+
if (!rawText) {
|
|
10585
|
+
throw new Error("AI returned an empty response.");
|
|
10586
|
+
}
|
|
10571
10587
|
const jsonText = extractJsonFromMarkdown(rawText);
|
|
10572
10588
|
const aiGeneratedContent = JSON.parse(jsonText);
|
|
10573
10589
|
const validatedOutput = PracticeSuggestionOutputSchema.parse(aiGeneratedContent);
|
|
@@ -10632,10 +10648,7 @@ var LearningAnalysisOutputSchema = zod.z.object({
|
|
|
10632
10648
|
// src/ai/flows/generate-learning-analysis.ts
|
|
10633
10649
|
async function generateLearningAnalysis(clientInput, apiKey) {
|
|
10634
10650
|
try {
|
|
10635
|
-
const
|
|
10636
|
-
plugins: [googleai.googleAI({ apiKey })],
|
|
10637
|
-
model: googleai.gemini20Flash
|
|
10638
|
-
});
|
|
10651
|
+
const genAI = new genai.GoogleGenAI({ apiKey });
|
|
10639
10652
|
const {
|
|
10640
10653
|
language: language3,
|
|
10641
10654
|
userName = "learner",
|
|
@@ -10723,8 +10736,17 @@ The 'suggestedDifficulty' field MUST ALWAYS be one of these exact English string
|
|
|
10723
10736
|
}
|
|
10724
10737
|
\`\`\`
|
|
10725
10738
|
`;
|
|
10726
|
-
const
|
|
10727
|
-
const
|
|
10739
|
+
const modelName = "gemini-1.5-flash";
|
|
10740
|
+
const contents = [{ role: "user", parts: [{ text: promptText }] }];
|
|
10741
|
+
const result = await genAI.models.generateContent({
|
|
10742
|
+
model: modelName,
|
|
10743
|
+
contents
|
|
10744
|
+
});
|
|
10745
|
+
const response = result;
|
|
10746
|
+
const rawText = response.candidates?.[0]?.content?.parts?.[0]?.text || "";
|
|
10747
|
+
if (!rawText) {
|
|
10748
|
+
throw new Error("AI returned an empty response.");
|
|
10749
|
+
}
|
|
10728
10750
|
const jsonText = extractJsonFromMarkdown(rawText);
|
|
10729
10751
|
const aiGeneratedContent = JSON.parse(jsonText);
|
|
10730
10752
|
const validatedOutput = LearningAnalysisOutputSchema.parse(aiGeneratedContent);
|
|
@@ -10755,10 +10777,7 @@ var GenerateMotivationalQuoteOutputSchema = zod.z.object({
|
|
|
10755
10777
|
// src/ai/flows/generate-motivational-quote.ts
|
|
10756
10778
|
async function generateMotivationalQuote(clientInput, apiKey) {
|
|
10757
10779
|
try {
|
|
10758
|
-
const
|
|
10759
|
-
plugins: [googleai.googleAI({ apiKey })],
|
|
10760
|
-
model: googleai.gemini20Flash
|
|
10761
|
-
});
|
|
10780
|
+
const genAI = new genai.GoogleGenAI({ apiKey });
|
|
10762
10781
|
const { language: language3, userName, currentStreak, weakestTopic } = clientInput;
|
|
10763
10782
|
let contextPrompt = "";
|
|
10764
10783
|
if (userName) {
|
|
@@ -10791,8 +10810,17 @@ Return the response as a single, valid JSON object with this EXACT format:
|
|
|
10791
10810
|
|
|
10792
10811
|
Return only the JSON response.`;
|
|
10793
10812
|
try {
|
|
10794
|
-
const
|
|
10795
|
-
const
|
|
10813
|
+
const modelName = "gemini-1.5-flash";
|
|
10814
|
+
const contents = [{ role: "user", parts: [{ text: promptText }] }];
|
|
10815
|
+
const result = await genAI.models.generateContent({
|
|
10816
|
+
model: modelName,
|
|
10817
|
+
contents
|
|
10818
|
+
});
|
|
10819
|
+
const response = result;
|
|
10820
|
+
const rawText = response.candidates?.[0]?.content?.parts?.[0]?.text || "";
|
|
10821
|
+
if (!rawText) {
|
|
10822
|
+
throw new Error("AI returned an empty response.");
|
|
10823
|
+
}
|
|
10796
10824
|
const jsonText = extractJsonFromMarkdown(rawText);
|
|
10797
10825
|
const aiGeneratedContent = JSON.parse(jsonText);
|
|
10798
10826
|
const validatedOutput = GenerateMotivationalQuoteOutputSchema.parse(aiGeneratedContent);
|
|
@@ -10818,10 +10846,7 @@ var PlanKnowledgeCardsOutputSchema = zod.z.object({
|
|
|
10818
10846
|
// src/ai/flows/plan-knowledge-cards.ts
|
|
10819
10847
|
async function planKnowledgeCards(clientInput, apiKey) {
|
|
10820
10848
|
try {
|
|
10821
|
-
const
|
|
10822
|
-
plugins: [googleai.googleAI({ apiKey })],
|
|
10823
|
-
model: googleai.gemini20Flash
|
|
10824
|
-
});
|
|
10849
|
+
const genAI = new genai.GoogleGenAI({ apiKey });
|
|
10825
10850
|
const { language: language3, learningObjectivesContent, overallSubject } = clientInput;
|
|
10826
10851
|
const promptText = `
|
|
10827
10852
|
You are an expert curriculum designer specializing in the subject of "${overallSubject}".
|
|
@@ -10841,18 +10866,28 @@ ${learningObjectivesContent}
|
|
|
10841
10866
|
|
|
10842
10867
|
**JSON OUTPUT FORMAT:**
|
|
10843
10868
|
Return a single, valid JSON object with this EXACT format:
|
|
10869
|
+
\`\`\`json
|
|
10844
10870
|
{
|
|
10845
10871
|
"concepts": [
|
|
10846
10872
|
"First Concept",
|
|
10847
10873
|
"Second Concept",
|
|
10848
|
-
"Third Concept"
|
|
10849
|
-
...
|
|
10874
|
+
"Third Concept"
|
|
10850
10875
|
]
|
|
10851
10876
|
}
|
|
10877
|
+
\`\`\`
|
|
10852
10878
|
|
|
10853
10879
|
Return only the JSON response.`;
|
|
10854
|
-
const
|
|
10855
|
-
const
|
|
10880
|
+
const modelName = "gemini-1.5-flash";
|
|
10881
|
+
const contents = [{ role: "user", parts: [{ text: promptText }] }];
|
|
10882
|
+
const result = await genAI.models.generateContent({
|
|
10883
|
+
model: modelName,
|
|
10884
|
+
contents
|
|
10885
|
+
});
|
|
10886
|
+
const response = result;
|
|
10887
|
+
const rawText = response.candidates?.[0]?.content?.parts?.[0]?.text || "";
|
|
10888
|
+
if (!rawText) {
|
|
10889
|
+
throw new Error("AI returned an empty response.");
|
|
10890
|
+
}
|
|
10856
10891
|
const jsonText = extractJsonFromMarkdown(rawText);
|
|
10857
10892
|
const aiGeneratedContent = JSON.parse(jsonText);
|
|
10858
10893
|
const validatedOutput = PlanKnowledgeCardsOutputSchema.parse(aiGeneratedContent);
|
|
@@ -10879,30 +10914,48 @@ var GenerateSingleKnowledgeCardOutputSchema = zod.z.object({
|
|
|
10879
10914
|
|
|
10880
10915
|
// src/ai/flows/generate-single-knowledge-card.ts
|
|
10881
10916
|
async function generateSingleKnowledgeCard(clientInput, apiKey) {
|
|
10882
|
-
const ai = genkit.genkit({
|
|
10883
|
-
plugins: [googleai.googleAI({ apiKey })],
|
|
10884
|
-
model: googleai.gemini20Flash
|
|
10885
|
-
});
|
|
10886
10917
|
try {
|
|
10887
|
-
const
|
|
10918
|
+
const genAI = new genai.GoogleGenAI({ apiKey });
|
|
10919
|
+
const { language: language3, concept, overallSubject } = clientInput;
|
|
10888
10920
|
const promptText = `
|
|
10889
|
-
You are an expert educator for "${overallSubject}".
|
|
10890
|
-
|
|
10891
|
-
|
|
10892
|
-
|
|
10893
|
-
|
|
10894
|
-
|
|
10895
|
-
|
|
10896
|
-
|
|
10897
|
-
|
|
10898
|
-
|
|
10899
|
-
|
|
10900
|
-
|
|
10921
|
+
You are an expert educator for "${overallSubject}". Your task is to create content for a single knowledge card based on the provided concept.
|
|
10922
|
+
|
|
10923
|
+
**Target Concept:**
|
|
10924
|
+
${concept}
|
|
10925
|
+
|
|
10926
|
+
**Instructions:**
|
|
10927
|
+
1. **Definition:** Write a concise definition for the concept (under 40 words).
|
|
10928
|
+
2. **Example:** Provide a practical example (code or real-world scenario) relevant to "${overallSubject}".
|
|
10929
|
+
3. **Language:** All content must be in ${language3}.
|
|
10930
|
+
4. **Format:** You MUST return ONLY a single, valid JSON object that strictly follows the provided schema. Do not include any extra text, comments, or markdown formatting.
|
|
10931
|
+
|
|
10932
|
+
**Required JSON Output Format:**
|
|
10933
|
+
Your response must be ONLY the JSON object, matching this exact structure. The 'concept' field must exactly match the Target Concept provided above.
|
|
10934
|
+
|
|
10935
|
+
{
|
|
10936
|
+
"concept": "${concept}",
|
|
10937
|
+
"definition": "A concise explanation of the concept goes here, in ${language3}.",
|
|
10938
|
+
"example": "A practical code snippet or real-world example goes here, in ${language3}."
|
|
10939
|
+
}
|
|
10940
|
+
|
|
10941
|
+
Now, generate the JSON for the requested knowledge card.`;
|
|
10942
|
+
const modelName = "gemini-1.5-flash";
|
|
10943
|
+
const config2 = {
|
|
10944
|
+
responseMimeType: "application/json"
|
|
10945
|
+
};
|
|
10946
|
+
const contents = [{ role: "user", parts: [{ text: promptText }] }];
|
|
10947
|
+
const result = await genAI.models.generateContent({
|
|
10948
|
+
model: modelName,
|
|
10949
|
+
contents,
|
|
10950
|
+
config: config2
|
|
10901
10951
|
});
|
|
10902
|
-
const
|
|
10903
|
-
|
|
10952
|
+
const response = result;
|
|
10953
|
+
const rawText = response.candidates?.[0]?.content?.parts?.[0]?.text || "";
|
|
10954
|
+
if (!rawText) {
|
|
10904
10955
|
throw new Error("AI did not return a valid structured output.");
|
|
10905
10956
|
}
|
|
10957
|
+
const aiGeneratedContent = JSON.parse(rawText);
|
|
10958
|
+
const validatedOutput = GenerateSingleKnowledgeCardOutputSchema.parse(aiGeneratedContent);
|
|
10906
10959
|
return validatedOutput;
|
|
10907
10960
|
} catch (error) {
|
|
10908
10961
|
console.error(`Error generating knowledge card for concept "${clientInput.concept}":`, error);
|
|
@@ -10938,10 +10991,7 @@ var AssessAndMapDocumentOutputSchema = zod.z.object({
|
|
|
10938
10991
|
// src/ai/flows/assess-and-map-document.ts
|
|
10939
10992
|
async function assessAndMapDocument(clientInput, apiKey) {
|
|
10940
10993
|
try {
|
|
10941
|
-
const
|
|
10942
|
-
plugins: [googleai.googleAI({ apiKey })],
|
|
10943
|
-
model: googleai.gemini20Flash
|
|
10944
|
-
});
|
|
10994
|
+
const genAI = new genai.GoogleGenAI({ apiKey });
|
|
10945
10995
|
const { language: language3, documentContent, learningObjectives } = clientInput;
|
|
10946
10996
|
const relevanceThreshold = 40;
|
|
10947
10997
|
const promptText = `
|
|
@@ -10989,8 +11039,17 @@ Return a single, valid JSON object in this EXACT format. Do not include any othe
|
|
|
10989
11039
|
|
|
10990
11040
|
If the document is not relevant at all, the "mappedLOs" array should be empty, and the "relevanceScore" should be low.
|
|
10991
11041
|
`;
|
|
10992
|
-
const
|
|
10993
|
-
const
|
|
11042
|
+
const modelName = "gemini-1.5-flash";
|
|
11043
|
+
const contents = [{ role: "user", parts: [{ text: promptText }] }];
|
|
11044
|
+
const result = await genAI.models.generateContent({
|
|
11045
|
+
model: modelName,
|
|
11046
|
+
contents
|
|
11047
|
+
});
|
|
11048
|
+
const response = result;
|
|
11049
|
+
const rawText = response.candidates?.[0]?.content?.parts?.[0]?.text || "";
|
|
11050
|
+
if (!rawText) {
|
|
11051
|
+
throw new Error("AI returned an empty response.");
|
|
11052
|
+
}
|
|
10994
11053
|
const jsonText = extractJsonFromMarkdown(rawText);
|
|
10995
11054
|
const aiGeneratedContent = JSON.parse(jsonText);
|
|
10996
11055
|
const validatedOutput = AssessAndMapDocumentOutputSchema.parse(aiGeneratedContent);
|
|
@@ -11022,10 +11081,7 @@ var GenerateQuizFromTextOutputSchema = zod.z.object({
|
|
|
11022
11081
|
var AnyGeneratedQuestionSchema2 = GenerateQuizFromTextOutputSchema.shape.generatedQuestions.element;
|
|
11023
11082
|
async function generateQuizFromText(clientInput, apiKey) {
|
|
11024
11083
|
try {
|
|
11025
|
-
const
|
|
11026
|
-
plugins: [googleai.googleAI({ apiKey })],
|
|
11027
|
-
model: googleai.gemini20Flash
|
|
11028
|
-
});
|
|
11084
|
+
const genAI = new genai.GoogleGenAI({ apiKey });
|
|
11029
11085
|
const { language: language3, documentContent, numQuestions, questionTypes } = clientInput;
|
|
11030
11086
|
const allowedTypes = questionTypes || ["multiple_choice", "true_false"];
|
|
11031
11087
|
const promptText = `
|
|
@@ -11079,8 +11135,17 @@ Return the response as a single JSON object with a key "generatedQuestions" cont
|
|
|
11079
11135
|
\`\`\`
|
|
11080
11136
|
|
|
11081
11137
|
Now, generate the JSON response.`;
|
|
11082
|
-
const
|
|
11083
|
-
const
|
|
11138
|
+
const modelName = "gemini-1.5-flash";
|
|
11139
|
+
const contents = [{ role: "user", parts: [{ text: promptText }] }];
|
|
11140
|
+
const result = await genAI.models.generateContent({
|
|
11141
|
+
model: modelName,
|
|
11142
|
+
contents
|
|
11143
|
+
});
|
|
11144
|
+
const response = result;
|
|
11145
|
+
const rawText = response.candidates?.[0]?.content?.parts?.[0]?.text || "";
|
|
11146
|
+
if (!rawText) {
|
|
11147
|
+
throw new Error("AI returned an empty response.");
|
|
11148
|
+
}
|
|
11084
11149
|
const jsonText = extractJsonFromMarkdown(rawText);
|
|
11085
11150
|
const aiGeneratedContent = JSON.parse(jsonText);
|
|
11086
11151
|
if (!aiGeneratedContent.generatedQuestions || !Array.isArray(aiGeneratedContent.generatedQuestions)) {
|
|
@@ -103625,9 +103690,11 @@ function QuestionFormDialog({
|
|
|
103625
103690
|
toast2({ title: "Validation Error", description: "Question content is missing. Please create or edit the question details.", variant: "destructive" });
|
|
103626
103691
|
return;
|
|
103627
103692
|
}
|
|
103628
|
-
startTransition(() => {
|
|
103693
|
+
startTransition(async () => {
|
|
103629
103694
|
try {
|
|
103630
103695
|
const finalDataPayload = {
|
|
103696
|
+
id: questionToEdit?.id || "",
|
|
103697
|
+
// Will be ignored for new items, used for updates
|
|
103631
103698
|
code: code4,
|
|
103632
103699
|
text: questionConfig.prompt.replace(/<[^>]*>?/gm, "").substring(0, 200),
|
|
103633
103700
|
subjectCode,
|
|
@@ -103636,6 +103703,8 @@ function QuestionFormDialog({
|
|
|
103636
103703
|
bloomLevelCode,
|
|
103637
103704
|
questionTypeCode: questionConfig.questionType,
|
|
103638
103705
|
difficulty: questionConfig.difficulty,
|
|
103706
|
+
lastModified: (/* @__PURE__ */ new Date()).toISOString(),
|
|
103707
|
+
// This will be set by the saving service
|
|
103639
103708
|
questionConfig: {
|
|
103640
103709
|
...questionConfig,
|
|
103641
103710
|
subject: subjectCode,
|
|
@@ -103644,14 +103713,7 @@ function QuestionFormDialog({
|
|
|
103644
103713
|
bloomLevel: bloomLevelCode
|
|
103645
103714
|
}
|
|
103646
103715
|
};
|
|
103647
|
-
|
|
103648
|
-
QuestionBankService.updateQuestion(questionToEdit.id, finalDataPayload);
|
|
103649
|
-
toast2({ title: "Success", description: "Question updated." });
|
|
103650
|
-
} else {
|
|
103651
|
-
QuestionBankService.addQuestion(finalDataPayload);
|
|
103652
|
-
toast2({ title: "Success", description: "Question added." });
|
|
103653
|
-
}
|
|
103654
|
-
onSave();
|
|
103716
|
+
await onSave(finalDataPayload);
|
|
103655
103717
|
onOpenChange(false);
|
|
103656
103718
|
} catch (error) {
|
|
103657
103719
|
toast2({ title: "Error", description: error.message || "Failed to save question.", variant: "destructive" });
|
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-DCPvHU4-.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 { a as AIFullQuizGeneratorModal, A as AIQuestionGeneratorModal, b as APIKeyManagerModal, i as ApproachManager, B as BloomLevelManager, C as CategoryManager, h as ContextManager, E as EditQuestionModal, G as GradeLevelManager, I as ImportQuestionsModal, L as LearningObjectiveManager, M as MetadataTabs, d as QuestionFilters, e as QuestionFormDialog, c as QuestionList, g as QuestionTypeManager, Q as QuizAuthoringTool, S as SCORMExportModal, f as SubjectManager, j as Toaster, T as TopicManager, t as toast, u as useToast } from './toaster-
|
|
5
|
+
export { a as AIFullQuizGeneratorModal, A as AIQuestionGeneratorModal, b as APIKeyManagerModal, i as ApproachManager, B as BloomLevelManager, C as CategoryManager, h as ContextManager, E as EditQuestionModal, G as GradeLevelManager, I as ImportQuestionsModal, L as LearningObjectiveManager, M as MetadataTabs, d as QuestionFilters, e as QuestionFormDialog, c as QuestionList, g as QuestionTypeManager, Q as QuizAuthoringTool, S as SCORMExportModal, f as SubjectManager, j as Toaster, T as TopicManager, t as toast, u as useToast } from './toaster-D1bLqmd_.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-D6vuLxnS.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 { a as AIFullQuizGeneratorModal, A as AIQuestionGeneratorModal, b as APIKeyManagerModal, i as ApproachManager, B as BloomLevelManager, C as CategoryManager, h as ContextManager, E as EditQuestionModal, G as GradeLevelManager, I as ImportQuestionsModal, L as LearningObjectiveManager, M as MetadataTabs, d as QuestionFilters, e as QuestionFormDialog, c as QuestionList, g as QuestionTypeManager, Q as QuizAuthoringTool, S as SCORMExportModal, f as SubjectManager, j as Toaster, T as TopicManager, t as toast, u as useToast } from './toaster-
|
|
5
|
+
export { a as AIFullQuizGeneratorModal, A as AIQuestionGeneratorModal, b as APIKeyManagerModal, i as ApproachManager, B as BloomLevelManager, C as CategoryManager, h as ContextManager, E as EditQuestionModal, G as GradeLevelManager, I as ImportQuestionsModal, L as LearningObjectiveManager, M as MetadataTabs, d as QuestionFilters, e as QuestionFormDialog, c as QuestionList, g as QuestionTypeManager, Q as QuizAuthoringTool, S as SCORMExportModal, f as SubjectManager, j as Toaster, T as TopicManager, t as toast, u as useToast } from './toaster-eWZIxSVc.js';
|
|
6
6
|
import 'clsx';
|
|
7
7
|
import 'zod';
|
|
8
8
|
import 'react';
|