@enspiredigital/xlms-headless 0.0.1 → 0.0.3

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.
Files changed (40) hide show
  1. package/dist/components/FillInBlank.d.ts +4 -0
  2. package/dist/components/FillInBlank.d.ts.map +1 -0
  3. package/dist/components/Matching.d.ts +4 -0
  4. package/dist/components/Matching.d.ts.map +1 -0
  5. package/dist/components/MultipleChoices.d.ts +4 -0
  6. package/dist/components/MultipleChoices.d.ts.map +1 -0
  7. package/dist/components/Video.d.ts +4 -0
  8. package/dist/components/Video.d.ts.map +1 -0
  9. package/dist/components/index.d.ts +5 -0
  10. package/dist/components/index.d.ts.map +1 -0
  11. package/dist/hooks/index.d.ts +6 -0
  12. package/dist/hooks/index.d.ts.map +1 -0
  13. package/dist/hooks/useBaseQuestion.d.ts +9 -0
  14. package/dist/hooks/useBaseQuestion.d.ts.map +1 -0
  15. package/dist/hooks/useFillInBlank.d.ts +18 -0
  16. package/dist/hooks/useFillInBlank.d.ts.map +1 -0
  17. package/dist/hooks/useMatching.d.ts +21 -0
  18. package/dist/hooks/useMatching.d.ts.map +1 -0
  19. package/dist/hooks/useMultipleChoices.d.ts +13 -0
  20. package/dist/hooks/useMultipleChoices.d.ts.map +1 -0
  21. package/dist/hooks/useVideo.d.ts +13 -0
  22. package/dist/hooks/useVideo.d.ts.map +1 -0
  23. package/dist/index.d.ts +5 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +264 -0
  26. package/dist/types/common.d.ts +28 -0
  27. package/dist/types/common.d.ts.map +1 -0
  28. package/dist/types/fillInBlank.d.ts +19 -0
  29. package/dist/types/fillInBlank.d.ts.map +1 -0
  30. package/dist/types/index.d.ts +6 -0
  31. package/dist/types/index.d.ts.map +1 -0
  32. package/dist/types/matching.d.ts +28 -0
  33. package/dist/types/matching.d.ts.map +1 -0
  34. package/dist/types/multipleChoices.d.ts +13 -0
  35. package/dist/types/multipleChoices.d.ts.map +1 -0
  36. package/dist/types/url.d.ts +8 -0
  37. package/dist/types/url.d.ts.map +1 -0
  38. package/dist/utils/index.d.ts +2 -0
  39. package/dist/utils/index.d.ts.map +1 -0
  40. package/package.json +23 -25
@@ -0,0 +1,4 @@
1
+ import { FillInBlankQuestionType, PropsComponent } from '../types';
2
+ import { useFillInBlank } from '../hooks/useFillInBlank';
3
+ export declare function FillInBlankQuestion({ getData, children, }: PropsComponent<FillInBlankQuestionType, ReturnType<typeof useFillInBlank>>): import('react').ReactNode;
4
+ //# sourceMappingURL=FillInBlank.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FillInBlank.d.ts","sourceRoot":"","sources":["../../src/components/FillInBlank.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,QAAQ,GACT,EAAE,cAAc,CAAC,uBAAuB,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,6BAG5E"}
@@ -0,0 +1,4 @@
1
+ import { MatchingQuestionType, PropsComponent } from '../types';
2
+ import { useMatching } from '../hooks';
3
+ export declare function MatchingQuestion({ getData, children, }: PropsComponent<MatchingQuestionType, ReturnType<typeof useMatching>>): import('react').ReactNode;
4
+ //# sourceMappingURL=Matching.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Matching.d.ts","sourceRoot":"","sources":["../../src/components/Matching.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,QAAQ,GACT,EAAE,cAAc,CAAC,oBAAoB,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,6BAGtE"}
@@ -0,0 +1,4 @@
1
+ import { useMultipleChoice } from '../hooks';
2
+ import { MultipleChoicesQuestionType, PropsComponent } from '../types';
3
+ export declare function MultipleChoicesQuestion({ getData, children, }: PropsComponent<MultipleChoicesQuestionType, ReturnType<typeof useMultipleChoice>>): import('react').ReactNode;
4
+ //# sourceMappingURL=MultipleChoices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MultipleChoices.d.ts","sourceRoot":"","sources":["../../src/components/MultipleChoices.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,2BAA2B,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEvE,wBAAgB,uBAAuB,CAAC,EACtC,OAAO,EACP,QAAQ,GACT,EAAE,cAAc,CACf,2BAA2B,EAC3B,UAAU,CAAC,OAAO,iBAAiB,CAAC,CACrC,6BAGA"}
@@ -0,0 +1,4 @@
1
+ import { PropsComponent, UrlQuestionType } from '../types';
2
+ import { useVideo } from '../hooks';
3
+ export declare function VideoQuestion({ getData, children, }: PropsComponent<UrlQuestionType, ReturnType<typeof useVideo>>): import('react').ReactNode;
4
+ //# sourceMappingURL=Video.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Video.d.ts","sourceRoot":"","sources":["../../src/components/Video.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,QAAQ,GACT,EAAE,cAAc,CAAC,eAAe,EAAE,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,6BAG9D"}
@@ -0,0 +1,5 @@
1
+ export * from './MultipleChoices';
2
+ export * from './Matching';
3
+ export * from './Video';
4
+ export * from './FillInBlank';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './useMultipleChoices';
2
+ export * from './useBaseQuestion';
3
+ export * from './useMatching';
4
+ export * from './useVideo';
5
+ export * from './useFillInBlank';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,9 @@
1
+ export declare function useBaseQuestion(): {
2
+ submitted: boolean | null;
3
+ isCorrect: boolean | null;
4
+ attempts: number;
5
+ canAnswer: boolean;
6
+ submitQuestion: (isCorrect: boolean) => void;
7
+ resetQuestion: () => void;
8
+ };
9
+ //# sourceMappingURL=useBaseQuestion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBaseQuestion.d.ts","sourceRoot":"","sources":["../../src/hooks/useBaseQuestion.ts"],"names":[],"mappings":"AAEA,wBAAgB,eAAe;;;;;gCAKM,OAAO;;EA0B3C"}
@@ -0,0 +1,18 @@
1
+ import { FillInBlankAnswer, FillInBlankQuestionType } from '../types/fillInBlank';
2
+ export declare function useFillInBlank(question: FillInBlankQuestionType): {
3
+ targets: import('..').FillInBlankTarget[];
4
+ answers: FillInBlankAnswer[];
5
+ question: FillInBlankQuestionType;
6
+ submitted: boolean | null;
7
+ isCorrect: boolean | null;
8
+ attempts: number;
9
+ canAnswer: boolean;
10
+ answer: (targetId: string, value: string) => void;
11
+ submit: () => {
12
+ isCorrect: boolean;
13
+ score: number;
14
+ maxScore: number;
15
+ };
16
+ reset: () => void;
17
+ };
18
+ //# sourceMappingURL=useFillInBlank.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFillInBlank.d.ts","sourceRoot":"","sources":["../../src/hooks/useFillInBlank.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAElF,wBAAgB,cAAc,CAAC,QAAQ,EAAE,uBAAuB;;;;;;;;uBAYpC,MAAM,SAAS,MAAM;;;;;;;EAoEhD"}
@@ -0,0 +1,21 @@
1
+ import { MatchingAnswer, MatchingQuestionType, MatchingSource } from '../types';
2
+ export declare function useMatching(question: MatchingQuestionType): {
3
+ sources: MatchingSource[];
4
+ targets: import('..').MatchingTarget[];
5
+ answers: MatchingAnswer[];
6
+ question: MatchingQuestionType;
7
+ availableSources: MatchingSource[];
8
+ submitted: boolean | null;
9
+ isCorrect: boolean | null;
10
+ attempts: number;
11
+ canAnswer: boolean;
12
+ select: (targetId: string, sourceId: string) => void;
13
+ remove: (targetId: string) => void;
14
+ submit: () => {
15
+ isCorrect: boolean;
16
+ score: number;
17
+ maxScore: number;
18
+ };
19
+ reset: () => void;
20
+ };
21
+ //# sourceMappingURL=useMatching.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMatching.d.ts","sourceRoot":"","sources":["../../src/hooks/useMatching.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEhF,wBAAgB,WAAW,CAAC,QAAQ,EAAE,oBAAoB;;;;;;;;;;uBAe9B,MAAM,YAAY,MAAM;uBAaxB,MAAM;;;;;;;EA0EjC"}
@@ -0,0 +1,13 @@
1
+ import { MultipleChoicesQuestionType } from '../types';
2
+ export declare function useMultipleChoice(question: MultipleChoicesQuestionType): {
3
+ question: MultipleChoicesQuestionType;
4
+ selectedIds: string[];
5
+ select: (id: string) => void;
6
+ submit: () => void;
7
+ reset: () => void;
8
+ submitted: boolean | null;
9
+ isCorrect: boolean | null;
10
+ attempts: number;
11
+ canAnswer: boolean;
12
+ };
13
+ //# sourceMappingURL=useMultipleChoices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMultipleChoices.d.ts","sourceRoot":"","sources":["../../src/hooks/useMultipleChoices.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAIvD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,2BAA2B;;;iBAWjD,MAAM;;;;;;;EA6C3B"}
@@ -0,0 +1,13 @@
1
+ import { UrlQuestionType } from '../types';
2
+ export declare function useVideo(question: UrlQuestionType): {
3
+ question: UrlQuestionType;
4
+ url: string;
5
+ type: string;
6
+ submit: () => void;
7
+ reset: () => void;
8
+ submitted: boolean | null;
9
+ isCorrect: boolean | null;
10
+ attempts: number;
11
+ canAnswer: boolean;
12
+ };
13
+ //# sourceMappingURL=useVideo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useVideo.d.ts","sourceRoot":"","sources":["../../src/hooks/useVideo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG3C,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,eAAe;;;;;;;;;;EAkCjD"}
@@ -0,0 +1,5 @@
1
+ export * from './hooks';
2
+ export * from './components';
3
+ export * from './types';
4
+ export * from './utils';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,264 @@
1
+ import { useState as b, useEffect as x } from "react";
2
+ function h() {
3
+ const [t, e] = b(null), [s, c] = b(null), [a, p] = b(0);
4
+ function w(u) {
5
+ t || (e(!0), c(u), p((g) => g + 1));
6
+ }
7
+ function o() {
8
+ e(!1), c(null);
9
+ }
10
+ return {
11
+ // state
12
+ submitted: t,
13
+ isCorrect: s,
14
+ attempts: a,
15
+ // derived
16
+ canAnswer: !t,
17
+ // actions
18
+ submitQuestion: w,
19
+ resetQuestion: o
20
+ };
21
+ }
22
+ function B(t, e) {
23
+ if (t.length !== e.length) return !1;
24
+ const s = new Set(t), c = new Set(e);
25
+ if (s.size !== c.size) return !1;
26
+ for (const a of s)
27
+ if (!c.has(a)) return !1;
28
+ return !0;
29
+ }
30
+ function M(t) {
31
+ const {
32
+ canAnswer: e,
33
+ submitted: s,
34
+ isCorrect: c,
35
+ attempts: a,
36
+ resetQuestion: p,
37
+ submitQuestion: w
38
+ } = h(), [o, u] = b([]);
39
+ function g(d) {
40
+ u((n) => t.options.allowMultipleAnswers ? n.includes(d) ? n.filter((f) => f !== d) : [...n, d] : [d]);
41
+ }
42
+ function A() {
43
+ if (o.length === 0) return;
44
+ const d = t.options.answers.reduce(
45
+ (f, m) => (m.is_correct && f.push(m.id), f),
46
+ []
47
+ ), n = B(o, d);
48
+ w(n);
49
+ }
50
+ function Q() {
51
+ u([]), p();
52
+ }
53
+ return {
54
+ // data
55
+ question: t,
56
+ selectedIds: o,
57
+ // actions
58
+ select: g,
59
+ submit: A,
60
+ reset: Q,
61
+ // base
62
+ submitted: s,
63
+ isCorrect: c,
64
+ attempts: a,
65
+ canAnswer: e
66
+ };
67
+ }
68
+ function k(t) {
69
+ const {
70
+ canAnswer: e,
71
+ submitted: s,
72
+ isCorrect: c,
73
+ attempts: a,
74
+ submitQuestion: p,
75
+ resetQuestion: w
76
+ } = h(), [o, u] = b([]), [g, A] = b(
77
+ []
78
+ );
79
+ function Q(r, i) {
80
+ u((l) => [
81
+ ...l.filter(
82
+ (C) => C.targetId !== r && C.sourceId !== i
83
+ ),
84
+ { targetId: r, sourceId: i }
85
+ ]);
86
+ }
87
+ function d(r) {
88
+ u((i) => i.filter((l) => l.targetId !== r));
89
+ }
90
+ function n() {
91
+ let r = 0, i = !0;
92
+ return t.options.targets.forEach((l) => {
93
+ const C = o.find((S) => S.targetId === l.id), I = t.options.sources[l.content.correct_position - 1];
94
+ C && I && C.sourceId === I.id ? r += l.content.point : i = !1;
95
+ }), {
96
+ isCorrect: i,
97
+ score: r,
98
+ maxScore: t.options.targets.reduce(
99
+ (l, C) => l + C.content.point,
100
+ 0
101
+ )
102
+ };
103
+ }
104
+ function f() {
105
+ const r = n();
106
+ return p(r.isCorrect), r;
107
+ }
108
+ function m() {
109
+ u([]), w();
110
+ }
111
+ return x(() => {
112
+ const r = t.options.sources.filter(
113
+ (i) => !o.some((l) => l.sourceId === i.id)
114
+ );
115
+ A(r);
116
+ }, [o, t.options.sources]), {
117
+ // data
118
+ sources: t.options.sources,
119
+ targets: t.options.targets,
120
+ answers: o,
121
+ question: t,
122
+ availableSources: g,
123
+ // base
124
+ submitted: s,
125
+ isCorrect: c,
126
+ attempts: a,
127
+ canAnswer: e,
128
+ // actions
129
+ select: Q,
130
+ remove: d,
131
+ submit: f,
132
+ reset: m
133
+ };
134
+ }
135
+ function V(t) {
136
+ const {
137
+ canAnswer: e,
138
+ submitted: s,
139
+ isCorrect: c,
140
+ attempts: a,
141
+ resetQuestion: p,
142
+ submitQuestion: w
143
+ } = h();
144
+ function o() {
145
+ w(!0);
146
+ }
147
+ function u() {
148
+ p();
149
+ }
150
+ return {
151
+ // data
152
+ question: t,
153
+ url: t.options.url,
154
+ type: t.options.urlType,
155
+ // actions
156
+ submit: o,
157
+ reset: u,
158
+ // base
159
+ submitted: s,
160
+ isCorrect: c,
161
+ attempts: a,
162
+ canAnswer: e
163
+ };
164
+ }
165
+ function _(t) {
166
+ const {
167
+ canAnswer: e,
168
+ submitted: s,
169
+ isCorrect: c,
170
+ attempts: a,
171
+ submitQuestion: p,
172
+ resetQuestion: w
173
+ } = h(), [o, u] = b([]);
174
+ function g(n, f) {
175
+ e && u((m) => {
176
+ const r = m.findIndex((i) => i.targetId === n);
177
+ if (r >= 0) {
178
+ const i = [...m];
179
+ return i[r] = { targetId: n, value: f }, i;
180
+ }
181
+ return [...m, { targetId: n, value: f }];
182
+ });
183
+ }
184
+ function A() {
185
+ let n = !0;
186
+ if (o.length < t.options.targets.length)
187
+ n = !1;
188
+ else
189
+ for (const f of t.options.targets) {
190
+ const m = o.find((l) => l.targetId === f.id), r = m ? m.value.trim() : "", i = f.content.correct_answer.trim();
191
+ if (r.toLowerCase() !== i.toLowerCase()) {
192
+ n = !1;
193
+ break;
194
+ }
195
+ }
196
+ return {
197
+ isCorrect: n,
198
+ score: n ? 1 : 0,
199
+ maxScore: 1
200
+ };
201
+ }
202
+ function Q() {
203
+ const n = A();
204
+ return p(n.isCorrect), n;
205
+ }
206
+ function d() {
207
+ u([]), w();
208
+ }
209
+ return {
210
+ // data
211
+ targets: t.options.targets,
212
+ answers: o,
213
+ question: t,
214
+ // base
215
+ submitted: s,
216
+ isCorrect: c,
217
+ attempts: a,
218
+ canAnswer: e,
219
+ // actions
220
+ answer: g,
221
+ submit: Q,
222
+ reset: d
223
+ };
224
+ }
225
+ function z({
226
+ getData: t,
227
+ children: e
228
+ }) {
229
+ const s = M(t());
230
+ return e(s);
231
+ }
232
+ function E({
233
+ getData: t,
234
+ children: e
235
+ }) {
236
+ const s = k(t());
237
+ return e(s);
238
+ }
239
+ function F({
240
+ getData: t,
241
+ children: e
242
+ }) {
243
+ const s = V(t());
244
+ return e(s);
245
+ }
246
+ function L({
247
+ getData: t,
248
+ children: e
249
+ }) {
250
+ const s = _(t());
251
+ return e(s);
252
+ }
253
+ export {
254
+ L as FillInBlankQuestion,
255
+ E as MatchingQuestion,
256
+ z as MultipleChoicesQuestion,
257
+ F as VideoQuestion,
258
+ B as isSameSet,
259
+ h as useBaseQuestion,
260
+ _ as useFillInBlank,
261
+ k as useMatching,
262
+ M as useMultipleChoice,
263
+ V as useVideo
264
+ };
@@ -0,0 +1,28 @@
1
+ import { ReactNode } from 'react';
2
+ export interface Media {
3
+ type?: string;
4
+ url?: string;
5
+ }
6
+ export interface BaseQuestion {
7
+ type: string;
8
+ content: {
9
+ text?: string;
10
+ media?: Media;
11
+ medias?: Media[];
12
+ };
13
+ correct_answers: {
14
+ ids: string | number[];
15
+ } | {
16
+ list: Record<string, unknown>;
17
+ };
18
+ metadata: {
19
+ instructions: string;
20
+ points: number;
21
+ timeLimit: number;
22
+ };
23
+ }
24
+ export interface PropsComponent<TYPE, API> {
25
+ getData: () => TYPE;
26
+ children: (api: API) => ReactNode;
27
+ }
28
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,WAAW,KAAK;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QACP,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;KAClB,CAAC;IACF,eAAe,EACX;QACE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;KACxB,GACD;QAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;IACtC,QAAQ,EAAE;QACR,YAAY,EAAE,MAAM,CAAC;QACrB,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED,MAAM,WAAW,cAAc,CAAC,IAAI,EAAE,GAAG;IACvC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,SAAS,CAAC;CACnC"}
@@ -0,0 +1,19 @@
1
+ import { BaseQuestion, Media } from './common';
2
+ export interface FillInBlankQuestionType extends BaseQuestion {
3
+ options: {
4
+ content: string;
5
+ targets: FillInBlankTarget[];
6
+ };
7
+ }
8
+ export interface FillInBlankTarget {
9
+ id: string;
10
+ content: {
11
+ correct_answer: string;
12
+ media?: Media;
13
+ };
14
+ }
15
+ export interface FillInBlankAnswer {
16
+ targetId: string;
17
+ value: string;
18
+ }
19
+ //# sourceMappingURL=fillInBlank.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fillInBlank.d.ts","sourceRoot":"","sources":["../../src/types/fillInBlank.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,WAAW,uBAAwB,SAAQ,YAAY;IAC3D,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,iBAAiB,EAAE,CAAC;KAC9B,CAAC;CACH;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE;QACP,cAAc,EAAE,MAAM,CAAC;QACvB,KAAK,CAAC,EAAE,KAAK,CAAC;KACf,CAAC;CACH;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf"}
@@ -0,0 +1,6 @@
1
+ export * from './multipleChoices';
2
+ export * from './common';
3
+ export * from './matching';
4
+ export * from './url';
5
+ export * from './fillInBlank';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { BaseQuestion, Media } from './common';
2
+ export interface MatchingQuestionType extends BaseQuestion {
3
+ options: {
4
+ sources: MatchingSource[];
5
+ targets: MatchingTarget[];
6
+ };
7
+ }
8
+ export interface MatchingSource {
9
+ id: string;
10
+ content: {
11
+ text: string;
12
+ media: Media;
13
+ };
14
+ }
15
+ export interface MatchingTarget {
16
+ id: string;
17
+ content: {
18
+ text: string;
19
+ point: number;
20
+ media: Media;
21
+ correct_position: number;
22
+ };
23
+ }
24
+ export interface MatchingAnswer {
25
+ targetId: string;
26
+ sourceId: string;
27
+ }
28
+ //# sourceMappingURL=matching.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matching.d.ts","sourceRoot":"","sources":["../../src/types/matching.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,OAAO,EAAE;QACP,OAAO,EAAE,cAAc,EAAE,CAAC;QAC1B,OAAO,EAAE,cAAc,EAAE,CAAC;KAC3B,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAE,CAAC;CACzC;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,KAAK,CAAC;QACb,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,13 @@
1
+ import { BaseQuestion, Media } from './common';
2
+ export interface MultipleChoicesQuestionType extends BaseQuestion {
3
+ options: {
4
+ answers: {
5
+ id: string;
6
+ text: string;
7
+ media: Media;
8
+ is_correct: boolean;
9
+ }[];
10
+ allowMultipleAnswers: boolean;
11
+ };
12
+ }
13
+ //# sourceMappingURL=multipleChoices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multipleChoices.d.ts","sourceRoot":"","sources":["../../src/types/multipleChoices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,WAAW,2BAA4B,SAAQ,YAAY;IAC/D,OAAO,EAAE;QACP,OAAO,EAAE;YACP,EAAE,EAAE,MAAM,CAAC;YACX,IAAI,EAAE,MAAM,CAAC;YACb,KAAK,EAAE,KAAK,CAAC;YACb,UAAU,EAAE,OAAO,CAAC;SACrB,EAAE,CAAC;QACJ,oBAAoB,EAAE,OAAO,CAAC;KAC/B,CAAC;CACH"}
@@ -0,0 +1,8 @@
1
+ import { BaseQuestion } from './common';
2
+ export interface UrlQuestionType extends BaseQuestion {
3
+ options: {
4
+ url: string;
5
+ urlType: string;
6
+ };
7
+ }
8
+ //# sourceMappingURL=url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/types/url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,WAAW,eAAgB,SAAQ,YAAY;IACnD,OAAO,EAAE;QACP,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH"}
@@ -0,0 +1,2 @@
1
+ export declare function isSameSet(a: string[], b: string[]): boolean;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AACA,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,WAajD"}
package/package.json CHANGED
@@ -1,25 +1,23 @@
1
- {
2
- "name": "@enspiredigital/xlms-headless",
3
- "version": "0.0.1",
4
- "type": "module",
5
- "main": "./dist/index.js",
6
- "module": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "exports": {
9
- "./package.json": "./package.json",
10
- ".": {
11
- "@xlms-headless/source": "./src/index.ts",
12
- "development": "./src/index.ts",
13
- "types": "./dist/index.d.ts",
14
- "import": "./dist/index.js",
15
- "default": "./dist/index.js"
16
- }
17
- },
18
- "files": [
19
- "dist",
20
- "!**/*.tsbuildinfo"
21
- ],
22
- "publishConfig": {
23
- "access": "public"
24
- }
25
- }
1
+ {
2
+ "name": "@enspiredigital/xlms-headless",
3
+ "version": "0.0.3",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ "./package.json": "./package.json",
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "default": "./dist/index.js"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "!**/*.tsbuildinfo"
19
+ ],
20
+ "publishConfig": {
21
+ "access": "public"
22
+ }
23
+ }