@thanh01.pmt/interactive-quiz-kit 1.0.24 → 1.0.25
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-ecosystem-BJ5RR5Ys.d.ts +228 -0
- package/dist/ai-ecosystem-CL30v1Lg.d.cts +228 -0
- package/dist/ai.cjs +181 -227
- package/dist/ai.d.cts +1881 -0
- package/dist/ai.d.ts +1881 -0
- package/dist/ai.js +181 -227
- package/dist/authoring.cjs +5213 -3105
- package/dist/authoring.d.cts +12 -0
- package/dist/authoring.d.ts +12 -0
- package/dist/authoring.js +4978 -2870
- package/dist/index.cjs +126 -182
- package/dist/index.d.cts +444 -0
- package/dist/index.d.ts +444 -0
- package/dist/index.js +126 -182
- package/dist/player.cjs +1491 -1086
- package/dist/player.d.cts +13 -0
- package/dist/player.d.ts +13 -0
- package/dist/player.js +1424 -1019
- package/dist/quiz-config-1gNNhljP.d.cts +197 -0
- package/dist/quiz-config-1gNNhljP.d.ts +197 -0
- package/dist/react-ui.cjs +7473 -4083
- package/dist/react-ui.d.cts +207 -0
- package/dist/react-ui.d.ts +207 -0
- package/dist/react-ui.js +7054 -3664
- package/dist/toaster-CtnxWhfE.d.ts +133 -0
- package/dist/toaster-DUq851l_.d.cts +133 -0
- package/package.json +13 -11
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
type RichContentString = string;
|
|
2
|
+
|
|
3
|
+
type QuestionTypeStrings = 'multiple_choice' | 'multiple_response' | 'fill_in_the_blanks' | 'drag_and_drop' | 'true_false' | 'short_answer' | 'numeric' | 'sequence' | 'matching' | 'hotspot' | 'blockly_programming' | 'scratch_programming' | 'coding';
|
|
4
|
+
interface BaseQuestion {
|
|
5
|
+
id: string;
|
|
6
|
+
questionType: QuestionTypeStrings;
|
|
7
|
+
prompt: RichContentString;
|
|
8
|
+
points?: number;
|
|
9
|
+
explanation?: RichContentString;
|
|
10
|
+
learningObjective?: string;
|
|
11
|
+
glossary?: string[];
|
|
12
|
+
bloomLevel?: string;
|
|
13
|
+
difficulty?: 'easy' | 'medium' | 'hard';
|
|
14
|
+
contextCode?: string;
|
|
15
|
+
gradeBand?: string;
|
|
16
|
+
course?: string;
|
|
17
|
+
subject?: string;
|
|
18
|
+
category?: string;
|
|
19
|
+
topic?: string;
|
|
20
|
+
imageUrl?: string;
|
|
21
|
+
imageAltText?: string;
|
|
22
|
+
}
|
|
23
|
+
interface QuestionOption {
|
|
24
|
+
id: string;
|
|
25
|
+
text: RichContentString;
|
|
26
|
+
}
|
|
27
|
+
interface MultipleChoiceQuestion extends BaseQuestion {
|
|
28
|
+
questionType: 'multiple_choice';
|
|
29
|
+
options: QuestionOption[];
|
|
30
|
+
correctAnswerId: string;
|
|
31
|
+
}
|
|
32
|
+
interface MultipleResponseQuestion extends BaseQuestion {
|
|
33
|
+
questionType: 'multiple_response';
|
|
34
|
+
options: QuestionOption[];
|
|
35
|
+
correctAnswerIds: string[];
|
|
36
|
+
}
|
|
37
|
+
interface FillInTheBlanksQuestion extends BaseQuestion {
|
|
38
|
+
questionType: 'fill_in_the_blanks';
|
|
39
|
+
segments: {
|
|
40
|
+
type: 'text' | 'blank';
|
|
41
|
+
content?: RichContentString;
|
|
42
|
+
id?: string;
|
|
43
|
+
}[];
|
|
44
|
+
answers: {
|
|
45
|
+
blankId: string;
|
|
46
|
+
acceptedValues: string[];
|
|
47
|
+
}[];
|
|
48
|
+
isCaseSensitive?: boolean;
|
|
49
|
+
}
|
|
50
|
+
interface DraggableItem {
|
|
51
|
+
id: string;
|
|
52
|
+
content: RichContentString;
|
|
53
|
+
}
|
|
54
|
+
interface DropZone {
|
|
55
|
+
id: string;
|
|
56
|
+
label: RichContentString;
|
|
57
|
+
}
|
|
58
|
+
interface DragAndDropQuestion extends BaseQuestion {
|
|
59
|
+
questionType: 'drag_and_drop';
|
|
60
|
+
draggableItems: DraggableItem[];
|
|
61
|
+
dropZones: DropZone[];
|
|
62
|
+
answerMap: {
|
|
63
|
+
draggableId: string;
|
|
64
|
+
dropZoneId: string;
|
|
65
|
+
}[];
|
|
66
|
+
backgroundImageUrl?: string;
|
|
67
|
+
imageAltText?: string;
|
|
68
|
+
}
|
|
69
|
+
interface TrueFalseQuestion extends BaseQuestion {
|
|
70
|
+
questionType: 'true_false';
|
|
71
|
+
correctAnswer: boolean;
|
|
72
|
+
}
|
|
73
|
+
interface ShortAnswerQuestion extends BaseQuestion {
|
|
74
|
+
questionType: 'short_answer';
|
|
75
|
+
acceptedAnswers: string[];
|
|
76
|
+
isCaseSensitive?: boolean;
|
|
77
|
+
}
|
|
78
|
+
interface NumericQuestion extends BaseQuestion {
|
|
79
|
+
questionType: 'numeric';
|
|
80
|
+
answer: number;
|
|
81
|
+
tolerance?: number;
|
|
82
|
+
}
|
|
83
|
+
interface SequenceItem {
|
|
84
|
+
id: string;
|
|
85
|
+
content: RichContentString;
|
|
86
|
+
}
|
|
87
|
+
interface SequenceQuestion extends BaseQuestion {
|
|
88
|
+
questionType: 'sequence';
|
|
89
|
+
items: SequenceItem[];
|
|
90
|
+
correctOrder: string[];
|
|
91
|
+
}
|
|
92
|
+
interface MatchPromptItem {
|
|
93
|
+
id: string;
|
|
94
|
+
content: RichContentString;
|
|
95
|
+
}
|
|
96
|
+
interface MatchOptionItem {
|
|
97
|
+
id: string;
|
|
98
|
+
content: RichContentString;
|
|
99
|
+
}
|
|
100
|
+
interface MatchingQuestion extends BaseQuestion {
|
|
101
|
+
questionType: 'matching';
|
|
102
|
+
prompts: MatchPromptItem[];
|
|
103
|
+
options: MatchOptionItem[];
|
|
104
|
+
correctAnswerMap: {
|
|
105
|
+
promptId: string;
|
|
106
|
+
optionId: string;
|
|
107
|
+
}[];
|
|
108
|
+
shuffleOptions?: boolean;
|
|
109
|
+
}
|
|
110
|
+
interface HotspotArea {
|
|
111
|
+
id: string;
|
|
112
|
+
shape: 'rect' | 'circle';
|
|
113
|
+
coords: number[];
|
|
114
|
+
description?: RichContentString;
|
|
115
|
+
}
|
|
116
|
+
interface HotspotQuestion extends BaseQuestion {
|
|
117
|
+
questionType: 'hotspot';
|
|
118
|
+
imageUrl: string;
|
|
119
|
+
imageAltText?: string;
|
|
120
|
+
hotspots: HotspotArea[];
|
|
121
|
+
correctHotspotIds: string[];
|
|
122
|
+
}
|
|
123
|
+
interface BlocklyProgrammingQuestion extends BaseQuestion {
|
|
124
|
+
questionType: 'blockly_programming';
|
|
125
|
+
toolboxDefinition: string;
|
|
126
|
+
initialWorkspace?: string;
|
|
127
|
+
solutionWorkspaceXML?: string;
|
|
128
|
+
solutionGeneratedCode?: string;
|
|
129
|
+
}
|
|
130
|
+
interface ScratchProgrammingQuestion extends BaseQuestion {
|
|
131
|
+
questionType: 'scratch_programming';
|
|
132
|
+
toolboxDefinition: string;
|
|
133
|
+
initialWorkspace?: string;
|
|
134
|
+
solutionWorkspaceXML?: string;
|
|
135
|
+
solutionGeneratedCode?: string;
|
|
136
|
+
}
|
|
137
|
+
type SupportedCodingLanguage = 'cpp' | 'javascript' | 'python' | 'swift' | 'csharp';
|
|
138
|
+
interface TestCase {
|
|
139
|
+
id: string;
|
|
140
|
+
input: any[];
|
|
141
|
+
expectedOutput: any;
|
|
142
|
+
isPublic: boolean;
|
|
143
|
+
}
|
|
144
|
+
interface CodingQuestion extends BaseQuestion {
|
|
145
|
+
questionType: 'coding';
|
|
146
|
+
codingLanguage: SupportedCodingLanguage;
|
|
147
|
+
solutionCode: string;
|
|
148
|
+
testCases: TestCase[];
|
|
149
|
+
functionSignature?: string;
|
|
150
|
+
}
|
|
151
|
+
type QuizQuestion = MultipleChoiceQuestion | MultipleResponseQuestion | FillInTheBlanksQuestion | DragAndDropQuestion | TrueFalseQuestion | ShortAnswerQuestion | NumericQuestion | SequenceQuestion | MatchingQuestion | HotspotQuestion | BlocklyProgrammingQuestion | ScratchProgrammingQuestion | CodingQuestion;
|
|
152
|
+
|
|
153
|
+
interface SCORMSettings {
|
|
154
|
+
version: "1.2" | "2004";
|
|
155
|
+
setCompletionOnFinish?: boolean;
|
|
156
|
+
setSuccessOnPass?: boolean;
|
|
157
|
+
autoCommit?: boolean;
|
|
158
|
+
studentNameVar?: string;
|
|
159
|
+
lessonStatusVar?: string;
|
|
160
|
+
scoreRawVar?: string;
|
|
161
|
+
scoreMaxVar?: string;
|
|
162
|
+
scoreMinVar?: string;
|
|
163
|
+
sessionTimeVar?: string;
|
|
164
|
+
exitVar?: string;
|
|
165
|
+
suspendDataVar?: string;
|
|
166
|
+
lessonStatusVar_1_2?: string;
|
|
167
|
+
scoreRawVar_1_2?: string;
|
|
168
|
+
scoreMaxVar_1_2?: string;
|
|
169
|
+
scoreMinVar_1_2?: string;
|
|
170
|
+
completionStatusVar_2004?: string;
|
|
171
|
+
successStatusVar_2004?: string;
|
|
172
|
+
scoreScaledVar_2004?: string;
|
|
173
|
+
scoreRawVar_2004?: string;
|
|
174
|
+
scoreMaxVar_2004?: string;
|
|
175
|
+
scoreMinVar_2004?: string;
|
|
176
|
+
}
|
|
177
|
+
interface QuizSettings {
|
|
178
|
+
language?: string;
|
|
179
|
+
shuffleQuestions?: boolean;
|
|
180
|
+
shuffleOptions?: boolean;
|
|
181
|
+
timeLimitMinutes?: number;
|
|
182
|
+
showCorrectAnswers?: 'immediately' | 'end_of_quiz' | 'never';
|
|
183
|
+
passingScorePercent?: number;
|
|
184
|
+
webhookUrl?: string;
|
|
185
|
+
scorm?: SCORMSettings;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
interface QuizConfig {
|
|
189
|
+
id: string;
|
|
190
|
+
title: string;
|
|
191
|
+
description?: RichContentString;
|
|
192
|
+
questions: QuizQuestion[];
|
|
193
|
+
settings?: QuizSettings;
|
|
194
|
+
version?: number;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export type { BaseQuestion as B, CodingQuestion as C, DragAndDropQuestion as D, FillInTheBlanksQuestion as F, HotspotQuestion as H, MultipleChoiceQuestion as M, NumericQuestion as N, QuestionTypeStrings as Q, RichContentString as R, ShortAnswerQuestion as S, TrueFalseQuestion as T, MultipleResponseQuestion as a, SequenceQuestion as b, MatchingQuestion as c, BlocklyProgrammingQuestion as d, ScratchProgrammingQuestion as e, QuizQuestion as f, QuestionOption as g, SequenceItem as h, MatchPromptItem as i, MatchOptionItem as j, DraggableItem as k, DropZone as l, HotspotArea as m, TestCase as n, SupportedCodingLanguage as o, SCORMSettings as p, QuizSettings as q, QuizConfig as r };
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
type RichContentString = string;
|
|
2
|
+
|
|
3
|
+
type QuestionTypeStrings = 'multiple_choice' | 'multiple_response' | 'fill_in_the_blanks' | 'drag_and_drop' | 'true_false' | 'short_answer' | 'numeric' | 'sequence' | 'matching' | 'hotspot' | 'blockly_programming' | 'scratch_programming' | 'coding';
|
|
4
|
+
interface BaseQuestion {
|
|
5
|
+
id: string;
|
|
6
|
+
questionType: QuestionTypeStrings;
|
|
7
|
+
prompt: RichContentString;
|
|
8
|
+
points?: number;
|
|
9
|
+
explanation?: RichContentString;
|
|
10
|
+
learningObjective?: string;
|
|
11
|
+
glossary?: string[];
|
|
12
|
+
bloomLevel?: string;
|
|
13
|
+
difficulty?: 'easy' | 'medium' | 'hard';
|
|
14
|
+
contextCode?: string;
|
|
15
|
+
gradeBand?: string;
|
|
16
|
+
course?: string;
|
|
17
|
+
subject?: string;
|
|
18
|
+
category?: string;
|
|
19
|
+
topic?: string;
|
|
20
|
+
imageUrl?: string;
|
|
21
|
+
imageAltText?: string;
|
|
22
|
+
}
|
|
23
|
+
interface QuestionOption {
|
|
24
|
+
id: string;
|
|
25
|
+
text: RichContentString;
|
|
26
|
+
}
|
|
27
|
+
interface MultipleChoiceQuestion extends BaseQuestion {
|
|
28
|
+
questionType: 'multiple_choice';
|
|
29
|
+
options: QuestionOption[];
|
|
30
|
+
correctAnswerId: string;
|
|
31
|
+
}
|
|
32
|
+
interface MultipleResponseQuestion extends BaseQuestion {
|
|
33
|
+
questionType: 'multiple_response';
|
|
34
|
+
options: QuestionOption[];
|
|
35
|
+
correctAnswerIds: string[];
|
|
36
|
+
}
|
|
37
|
+
interface FillInTheBlanksQuestion extends BaseQuestion {
|
|
38
|
+
questionType: 'fill_in_the_blanks';
|
|
39
|
+
segments: {
|
|
40
|
+
type: 'text' | 'blank';
|
|
41
|
+
content?: RichContentString;
|
|
42
|
+
id?: string;
|
|
43
|
+
}[];
|
|
44
|
+
answers: {
|
|
45
|
+
blankId: string;
|
|
46
|
+
acceptedValues: string[];
|
|
47
|
+
}[];
|
|
48
|
+
isCaseSensitive?: boolean;
|
|
49
|
+
}
|
|
50
|
+
interface DraggableItem {
|
|
51
|
+
id: string;
|
|
52
|
+
content: RichContentString;
|
|
53
|
+
}
|
|
54
|
+
interface DropZone {
|
|
55
|
+
id: string;
|
|
56
|
+
label: RichContentString;
|
|
57
|
+
}
|
|
58
|
+
interface DragAndDropQuestion extends BaseQuestion {
|
|
59
|
+
questionType: 'drag_and_drop';
|
|
60
|
+
draggableItems: DraggableItem[];
|
|
61
|
+
dropZones: DropZone[];
|
|
62
|
+
answerMap: {
|
|
63
|
+
draggableId: string;
|
|
64
|
+
dropZoneId: string;
|
|
65
|
+
}[];
|
|
66
|
+
backgroundImageUrl?: string;
|
|
67
|
+
imageAltText?: string;
|
|
68
|
+
}
|
|
69
|
+
interface TrueFalseQuestion extends BaseQuestion {
|
|
70
|
+
questionType: 'true_false';
|
|
71
|
+
correctAnswer: boolean;
|
|
72
|
+
}
|
|
73
|
+
interface ShortAnswerQuestion extends BaseQuestion {
|
|
74
|
+
questionType: 'short_answer';
|
|
75
|
+
acceptedAnswers: string[];
|
|
76
|
+
isCaseSensitive?: boolean;
|
|
77
|
+
}
|
|
78
|
+
interface NumericQuestion extends BaseQuestion {
|
|
79
|
+
questionType: 'numeric';
|
|
80
|
+
answer: number;
|
|
81
|
+
tolerance?: number;
|
|
82
|
+
}
|
|
83
|
+
interface SequenceItem {
|
|
84
|
+
id: string;
|
|
85
|
+
content: RichContentString;
|
|
86
|
+
}
|
|
87
|
+
interface SequenceQuestion extends BaseQuestion {
|
|
88
|
+
questionType: 'sequence';
|
|
89
|
+
items: SequenceItem[];
|
|
90
|
+
correctOrder: string[];
|
|
91
|
+
}
|
|
92
|
+
interface MatchPromptItem {
|
|
93
|
+
id: string;
|
|
94
|
+
content: RichContentString;
|
|
95
|
+
}
|
|
96
|
+
interface MatchOptionItem {
|
|
97
|
+
id: string;
|
|
98
|
+
content: RichContentString;
|
|
99
|
+
}
|
|
100
|
+
interface MatchingQuestion extends BaseQuestion {
|
|
101
|
+
questionType: 'matching';
|
|
102
|
+
prompts: MatchPromptItem[];
|
|
103
|
+
options: MatchOptionItem[];
|
|
104
|
+
correctAnswerMap: {
|
|
105
|
+
promptId: string;
|
|
106
|
+
optionId: string;
|
|
107
|
+
}[];
|
|
108
|
+
shuffleOptions?: boolean;
|
|
109
|
+
}
|
|
110
|
+
interface HotspotArea {
|
|
111
|
+
id: string;
|
|
112
|
+
shape: 'rect' | 'circle';
|
|
113
|
+
coords: number[];
|
|
114
|
+
description?: RichContentString;
|
|
115
|
+
}
|
|
116
|
+
interface HotspotQuestion extends BaseQuestion {
|
|
117
|
+
questionType: 'hotspot';
|
|
118
|
+
imageUrl: string;
|
|
119
|
+
imageAltText?: string;
|
|
120
|
+
hotspots: HotspotArea[];
|
|
121
|
+
correctHotspotIds: string[];
|
|
122
|
+
}
|
|
123
|
+
interface BlocklyProgrammingQuestion extends BaseQuestion {
|
|
124
|
+
questionType: 'blockly_programming';
|
|
125
|
+
toolboxDefinition: string;
|
|
126
|
+
initialWorkspace?: string;
|
|
127
|
+
solutionWorkspaceXML?: string;
|
|
128
|
+
solutionGeneratedCode?: string;
|
|
129
|
+
}
|
|
130
|
+
interface ScratchProgrammingQuestion extends BaseQuestion {
|
|
131
|
+
questionType: 'scratch_programming';
|
|
132
|
+
toolboxDefinition: string;
|
|
133
|
+
initialWorkspace?: string;
|
|
134
|
+
solutionWorkspaceXML?: string;
|
|
135
|
+
solutionGeneratedCode?: string;
|
|
136
|
+
}
|
|
137
|
+
type SupportedCodingLanguage = 'cpp' | 'javascript' | 'python' | 'swift' | 'csharp';
|
|
138
|
+
interface TestCase {
|
|
139
|
+
id: string;
|
|
140
|
+
input: any[];
|
|
141
|
+
expectedOutput: any;
|
|
142
|
+
isPublic: boolean;
|
|
143
|
+
}
|
|
144
|
+
interface CodingQuestion extends BaseQuestion {
|
|
145
|
+
questionType: 'coding';
|
|
146
|
+
codingLanguage: SupportedCodingLanguage;
|
|
147
|
+
solutionCode: string;
|
|
148
|
+
testCases: TestCase[];
|
|
149
|
+
functionSignature?: string;
|
|
150
|
+
}
|
|
151
|
+
type QuizQuestion = MultipleChoiceQuestion | MultipleResponseQuestion | FillInTheBlanksQuestion | DragAndDropQuestion | TrueFalseQuestion | ShortAnswerQuestion | NumericQuestion | SequenceQuestion | MatchingQuestion | HotspotQuestion | BlocklyProgrammingQuestion | ScratchProgrammingQuestion | CodingQuestion;
|
|
152
|
+
|
|
153
|
+
interface SCORMSettings {
|
|
154
|
+
version: "1.2" | "2004";
|
|
155
|
+
setCompletionOnFinish?: boolean;
|
|
156
|
+
setSuccessOnPass?: boolean;
|
|
157
|
+
autoCommit?: boolean;
|
|
158
|
+
studentNameVar?: string;
|
|
159
|
+
lessonStatusVar?: string;
|
|
160
|
+
scoreRawVar?: string;
|
|
161
|
+
scoreMaxVar?: string;
|
|
162
|
+
scoreMinVar?: string;
|
|
163
|
+
sessionTimeVar?: string;
|
|
164
|
+
exitVar?: string;
|
|
165
|
+
suspendDataVar?: string;
|
|
166
|
+
lessonStatusVar_1_2?: string;
|
|
167
|
+
scoreRawVar_1_2?: string;
|
|
168
|
+
scoreMaxVar_1_2?: string;
|
|
169
|
+
scoreMinVar_1_2?: string;
|
|
170
|
+
completionStatusVar_2004?: string;
|
|
171
|
+
successStatusVar_2004?: string;
|
|
172
|
+
scoreScaledVar_2004?: string;
|
|
173
|
+
scoreRawVar_2004?: string;
|
|
174
|
+
scoreMaxVar_2004?: string;
|
|
175
|
+
scoreMinVar_2004?: string;
|
|
176
|
+
}
|
|
177
|
+
interface QuizSettings {
|
|
178
|
+
language?: string;
|
|
179
|
+
shuffleQuestions?: boolean;
|
|
180
|
+
shuffleOptions?: boolean;
|
|
181
|
+
timeLimitMinutes?: number;
|
|
182
|
+
showCorrectAnswers?: 'immediately' | 'end_of_quiz' | 'never';
|
|
183
|
+
passingScorePercent?: number;
|
|
184
|
+
webhookUrl?: string;
|
|
185
|
+
scorm?: SCORMSettings;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
interface QuizConfig {
|
|
189
|
+
id: string;
|
|
190
|
+
title: string;
|
|
191
|
+
description?: RichContentString;
|
|
192
|
+
questions: QuizQuestion[];
|
|
193
|
+
settings?: QuizSettings;
|
|
194
|
+
version?: number;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export type { BaseQuestion as B, CodingQuestion as C, DragAndDropQuestion as D, FillInTheBlanksQuestion as F, HotspotQuestion as H, MultipleChoiceQuestion as M, NumericQuestion as N, QuestionTypeStrings as Q, RichContentString as R, ShortAnswerQuestion as S, TrueFalseQuestion as T, MultipleResponseQuestion as a, SequenceQuestion as b, MatchingQuestion as c, BlocklyProgrammingQuestion as d, ScratchProgrammingQuestion as e, QuizQuestion as f, QuestionOption as g, SequenceItem as h, MatchPromptItem as i, MatchOptionItem as j, DraggableItem as k, DropZone as l, HotspotArea as m, TestCase as n, SupportedCodingLanguage as o, SCORMSettings as p, QuizSettings as q, QuizConfig as r };
|