@enspiredigital/xlms-headless 0.0.18 → 0.0.19

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.
@@ -1 +1 @@
1
- {"version":3,"file":"useOrdering.d.ts","sourceRoot":"","sources":["../../src/hooks/useOrdering.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,wBAAgB,WAAW,CAAC,QAAQ,EAAE,oBAAoB;;;;;;;;;;;0BA0B3B,MAAM,WAAW,MAAM;qBAU5B,MAAM;uBAQJ,MAAM;6BAQA,MAAM,eAAe,MAAM;;;;;;;EAwE5D"}
1
+ {"version":3,"file":"useOrdering.d.ts","sourceRoot":"","sources":["../../src/hooks/useOrdering.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAGhD,wBAAgB,WAAW,CAAC,QAAQ,EAAE,oBAAoB;;;;;;;;;;;0BA4B3B,MAAM,WAAW,MAAM;qBAU5B,MAAM;uBAQJ,MAAM;6BAQA,MAAM,eAAe,MAAM;;;;;;;EAwE5D"}
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import { useState as x, useEffect as y, useMemo as B } from "react";
2
- function O() {
3
- const [t, i] = x(null), [c, d] = x(null), [m, b] = x(0);
1
+ import { useState as x, useEffect as B, useMemo as y } from "react";
2
+ function M() {
3
+ const [t, o] = x(null), [c, f] = x(null), [m, b] = x(0);
4
4
  function w(l) {
5
- i(!0), d(l), b((A) => A + 1);
5
+ o(!0), f(l), b((A) => A + 1);
6
6
  }
7
- function o() {
8
- i(!1), d(null);
7
+ function i() {
8
+ o(!1), f(null);
9
9
  }
10
10
  return {
11
11
  // state
@@ -16,36 +16,44 @@ function O() {
16
16
  canAnswer: !t,
17
17
  // actions
18
18
  submitQuestion: w,
19
- resetQuestion: o
19
+ resetQuestion: i
20
20
  };
21
21
  }
22
- function D(t, i) {
23
- if (t.length !== i.length) return !1;
24
- const c = new Set(t), d = new Set(i);
25
- if (c.size !== d.size) return !1;
22
+ function j(t, o) {
23
+ if (t.length !== o.length) return !1;
24
+ const c = new Set(t), f = new Set(o);
25
+ if (c.size !== f.size) return !1;
26
26
  for (const m of c)
27
- if (!d.has(m)) return !1;
27
+ if (!f.has(m)) return !1;
28
28
  return !0;
29
29
  }
30
+ function D(t) {
31
+ const o = [...t];
32
+ for (let c = o.length - 1; c > 0; c--) {
33
+ const f = Math.floor(Math.random() * (c + 1));
34
+ [o[c], o[f]] = [o[f], o[c]];
35
+ }
36
+ return o;
37
+ }
30
38
  function E(t) {
31
39
  const {
32
- canAnswer: i,
40
+ canAnswer: o,
33
41
  submitted: c,
34
- isCorrect: d,
42
+ isCorrect: f,
35
43
  attempts: m,
36
44
  resetQuestion: b,
37
45
  submitQuestion: w
38
- } = O(), [o, l] = x([]);
46
+ } = M(), [i, l] = x([]);
39
47
  function A(I) {
40
- l((f) => t.options.allowMultipleAnswers ? f.includes(I) ? f.filter((g) => g !== I) : [...f, I] : [I]);
48
+ l((d) => t.options.allowMultipleAnswers ? d.includes(I) ? d.filter((g) => g !== I) : [...d, I] : [I]);
41
49
  }
42
50
  function S() {
43
- if (o.length === 0) return;
51
+ if (i.length === 0) return;
44
52
  const I = t.options.answers.reduce(
45
53
  (g, p) => (p.is_correct && g.push(p.id), g),
46
54
  []
47
- ), f = D(o, I);
48
- w(f);
55
+ ), d = j(i, I);
56
+ w(d);
49
57
  }
50
58
  function Q() {
51
59
  l([]), b();
@@ -53,32 +61,32 @@ function E(t) {
53
61
  return {
54
62
  // data
55
63
  question: t,
56
- selectedIds: o,
64
+ selectedIds: i,
57
65
  // actions
58
66
  select: A,
59
67
  submit: S,
60
68
  reset: Q,
61
69
  // base
62
70
  submitted: c,
63
- isCorrect: d,
71
+ isCorrect: f,
64
72
  attempts: m,
65
- canAnswer: i
73
+ canAnswer: o
66
74
  };
67
75
  }
68
- function j(t) {
76
+ function V(t) {
69
77
  const {
70
- canAnswer: i,
78
+ canAnswer: o,
71
79
  submitted: c,
72
- isCorrect: d,
80
+ isCorrect: f,
73
81
  attempts: m,
74
82
  submitQuestion: b,
75
83
  resetQuestion: w
76
- } = O(), [o, l] = x([]), [A, S] = x(
84
+ } = M(), [i, l] = x([]), [A, S] = x(
77
85
  []
78
86
  ), [Q, I] = x(
79
87
  []
80
88
  );
81
- function f(e, n) {
89
+ function d(e, n) {
82
90
  l((r) => [
83
91
  ...r.filter(
84
92
  (u) => u.targetId !== e && u.sourceId !== n
@@ -94,7 +102,7 @@ function j(t) {
94
102
  function p() {
95
103
  let e = 0, n = !0;
96
104
  return t.options.targets.forEach((r) => {
97
- const u = o.find((C) => C.targetId === r.id), h = t.options.sources[r.content.correct_position - 1];
105
+ const u = i.find((C) => C.targetId === r.id), h = t.options.sources[r.content.correct_position - 1];
98
106
  u && h && u.sourceId === h.id ? e += r.content.point : n = !1;
99
107
  }), {
100
108
  isCorrect: n,
@@ -112,46 +120,46 @@ function j(t) {
112
120
  function s() {
113
121
  l([]), w();
114
122
  }
115
- return y(() => {
123
+ return B(() => {
116
124
  const e = t.options.sources.filter(
117
- (n) => !o.some((r) => r.sourceId === n.id)
125
+ (n) => !i.some((r) => r.sourceId === n.id)
118
126
  );
119
127
  S(e);
120
- }, [o, t.options.sources]), y(() => {
128
+ }, [i, t.options.sources]), B(() => {
121
129
  const e = t.options.targets.filter(
122
- (n) => !o.some((r) => r.targetId === n.id)
130
+ (n) => !i.some((r) => r.targetId === n.id)
123
131
  );
124
132
  I(e);
125
- }, [o, t.options.targets]), {
133
+ }, [i, t.options.targets]), {
126
134
  // data
127
135
  sources: t.options.sources,
128
136
  targets: t.options.targets,
129
- answers: o,
137
+ answers: i,
130
138
  question: t,
131
139
  availableSources: A,
132
140
  availableTargets: Q,
133
141
  // base
134
142
  submitted: c,
135
- isCorrect: d,
143
+ isCorrect: f,
136
144
  attempts: m,
137
- canAnswer: i,
145
+ canAnswer: o,
138
146
  // actions
139
- select: f,
147
+ select: d,
140
148
  remove: g,
141
149
  submit: a,
142
150
  reset: s
143
151
  };
144
152
  }
145
- function V(t) {
153
+ function T(t) {
146
154
  const {
147
- canAnswer: i,
155
+ canAnswer: o,
148
156
  submitted: c,
149
- isCorrect: d,
157
+ isCorrect: f,
150
158
  attempts: m,
151
159
  resetQuestion: b,
152
160
  submitQuestion: w
153
- } = O();
154
- function o() {
161
+ } = M();
162
+ function i() {
155
163
  w(!0);
156
164
  }
157
165
  function l() {
@@ -163,29 +171,29 @@ function V(t) {
163
171
  url: t.options.url,
164
172
  type: t.options.urlType,
165
173
  // actions
166
- submit: o,
174
+ submit: i,
167
175
  reset: l,
168
176
  // base
169
177
  submitted: c,
170
- isCorrect: d,
178
+ isCorrect: f,
171
179
  attempts: m,
172
- canAnswer: i
180
+ canAnswer: o
173
181
  };
174
182
  }
175
- function T(t) {
183
+ function F(t) {
176
184
  const {
177
- canAnswer: i,
185
+ canAnswer: o,
178
186
  submitted: c,
179
- isCorrect: d,
187
+ isCorrect: f,
180
188
  attempts: m,
181
189
  submitQuestion: b,
182
190
  resetQuestion: w
183
- } = O(), [o, l] = x([]), [A, S] = x(null), Q = B(() => {
184
- const e = new Set(o.map((n) => n.itemId));
191
+ } = M(), [i, l] = x([]), [A, S] = x(null), Q = y(() => {
192
+ const e = new Set(i.map((n) => n.itemId));
185
193
  return t.options.answers.filter(
186
194
  (n) => !e.has(String(n.id))
187
195
  );
188
- }, [o, t.options.answers]);
196
+ }, [i, t.options.answers]);
189
197
  function I(e, n) {
190
198
  l((r) => [
191
199
  ...r.filter(
@@ -197,7 +205,7 @@ function T(t) {
197
205
  }
198
206
  ]);
199
207
  }
200
- function f(e) {
208
+ function d(e) {
201
209
  l((n) => n.filter((r) => r.itemId !== e));
202
210
  }
203
211
  function g(e, n) {
@@ -205,15 +213,15 @@ function T(t) {
205
213
  }
206
214
  function p() {
207
215
  let e = 0, n = !0, r = 0;
208
- const u = t.correct_answers.list, h = new Map(o.map((C) => [C.blankIndex, C.itemId]));
216
+ const u = t.correct_answers.list, h = new Map(i.map((C) => [C.blankIndex, C.itemId]));
209
217
  return Object.entries(u).forEach(([C, k]) => {
210
- const L = C, v = h.get(L);
218
+ const O = C, v = h.get(O);
211
219
  if (!v) {
212
220
  n = !1;
213
221
  return;
214
222
  }
215
- const M = t.options.answers.find((_) => _.id === v);
216
- M && String(M.group_position) === String(k) ? (e++, r += M.point) : n = !1;
223
+ const L = t.options.answers.find((_) => _.id === v);
224
+ L && String(L.group_position) === String(k) ? (e++, r += L.point) : n = !1;
217
225
  }), {
218
226
  isCorrect: n,
219
227
  correctCount: e,
@@ -233,35 +241,37 @@ function T(t) {
233
241
  // data
234
242
  items: t.options.answers,
235
243
  groups: t.options.groups,
236
- answers: o,
244
+ answers: i,
237
245
  availableItems: Q,
238
246
  question: t,
239
247
  draggingItemId: A,
240
248
  // base
241
249
  submitted: c,
242
- isCorrect: d,
250
+ isCorrect: f,
243
251
  attempts: m,
244
- canAnswer: i,
252
+ canAnswer: o,
245
253
  // actions
246
254
  dropItem: I,
247
- removeItem: f,
255
+ removeItem: d,
248
256
  moveItem: g,
249
257
  setDraggingItemId: S,
250
258
  submit: a,
251
259
  reset: s
252
260
  };
253
261
  }
254
- function F(t) {
262
+ function z(t) {
255
263
  const {
256
- canAnswer: i,
264
+ canAnswer: o,
257
265
  submitted: c,
258
- isCorrect: d,
266
+ isCorrect: f,
259
267
  attempts: m,
260
268
  submitQuestion: b,
261
269
  resetQuestion: w
262
- } = O(), [o, l] = x(() => t.options.answers.map((s) => String(s.id))), A = B(() => o.map(
270
+ } = M(), [i, l] = x(() => D(
271
+ t.options.answers.map((s) => String(s.id))
272
+ )), A = y(() => i.map(
263
273
  (s) => t.options.answers.find((e) => String(e.id) === s)
264
- ).filter((s) => s !== void 0), [o, t.options.answers]);
274
+ ).filter((s) => s !== void 0), [i, t.options.answers]);
265
275
  function S(s, e) {
266
276
  l((n) => {
267
277
  const r = [...n], [u] = r.splice(s, 1);
@@ -269,21 +279,21 @@ function F(t) {
269
279
  });
270
280
  }
271
281
  function Q(s) {
272
- const e = o.indexOf(s);
282
+ const e = i.indexOf(s);
273
283
  e > 0 && S(e, e - 1);
274
284
  }
275
285
  function I(s) {
276
- const e = o.indexOf(s);
277
- e < o.length - 1 && S(e, e + 1);
286
+ const e = i.indexOf(s);
287
+ e < i.length - 1 && S(e, e + 1);
278
288
  }
279
- function f(s, e) {
280
- const n = o.indexOf(s);
281
- n !== -1 && e >= 0 && e < o.length && S(n, e);
289
+ function d(s, e) {
290
+ const n = i.indexOf(s);
291
+ n !== -1 && e >= 0 && e < i.length && S(n, e);
282
292
  }
283
293
  function g() {
284
294
  let s = 0, e = !0;
285
295
  return t.options.answers.forEach((n, r) => {
286
- const u = o.indexOf(String(n.id));
296
+ const u = i.indexOf(String(n.id));
287
297
  u !== -1 && u + 1 === n.correct_position ? s += n.point : e = !1;
288
298
  }), {
289
299
  isCorrect: e,
@@ -306,42 +316,42 @@ function F(t) {
306
316
  items: t.options.answers,
307
317
  groups: t.options.groups,
308
318
  orderedItems: A,
309
- orderedItemIds: o,
319
+ orderedItemIds: i,
310
320
  question: t,
311
321
  // base
312
322
  submitted: c,
313
- isCorrect: d,
323
+ isCorrect: f,
314
324
  attempts: m,
315
- canAnswer: i,
325
+ canAnswer: o,
316
326
  // actions
317
327
  setOrderedItemIds: l,
318
328
  moveItem: S,
319
329
  moveUp: Q,
320
330
  moveDown: I,
321
- moveToPosition: f,
331
+ moveToPosition: d,
322
332
  submit: p,
323
333
  reset: a
324
334
  };
325
335
  }
326
- function z(t) {
336
+ function G(t) {
327
337
  const {
328
- canAnswer: i,
338
+ canAnswer: o,
329
339
  submitted: c,
330
- isCorrect: d,
340
+ isCorrect: f,
331
341
  attempts: m,
332
342
  submitQuestion: b,
333
343
  resetQuestion: w
334
- } = O(), [o, l] = x([]), A = B(() => {
335
- const e = new Set(o.map((n) => n.labelId));
344
+ } = M(), [i, l] = x([]), A = y(() => {
345
+ const e = new Set(i.map((n) => n.labelId));
336
346
  return t.options.labels.filter(
337
347
  (n) => !e.has(String(n.id))
338
348
  );
339
- }, [o, t.options.labels]);
349
+ }, [i, t.options.labels]);
340
350
  function S(e, n, r, u) {
341
351
  const h = t.options.blanks.find((C) => String(C.id) === n);
342
352
  h && l((C) => [
343
353
  ...C.filter(
344
- (L) => L.labelId !== e && L.blankId !== n
354
+ (O) => O.labelId !== e && O.blankId !== n
345
355
  ),
346
356
  {
347
357
  labelId: e,
@@ -357,20 +367,20 @@ function z(t) {
357
367
  function I(e, n, r, u) {
358
368
  S(e, n, r, u);
359
369
  }
360
- function f(e) {
361
- const n = o.find((r) => r.blankId === e);
370
+ function d(e) {
371
+ const n = i.find((r) => r.blankId === e);
362
372
  return n && t.options.labels.find(
363
373
  (r) => String(r.id) === n.labelId
364
374
  ) || null;
365
375
  }
366
376
  function g(e) {
367
- const n = o.find((r) => r.labelId === e);
377
+ const n = i.find((r) => r.labelId === e);
368
378
  return n ? n.blankId : null;
369
379
  }
370
380
  function p() {
371
381
  let e = 0, n = !0;
372
382
  return t.options.labels.forEach((r) => {
373
- const u = o.find(
383
+ const u = i.find(
374
384
  (C) => String(C.labelId) === String(r.id)
375
385
  ), h = t.options.blanks.find(
376
386
  (C, k) => k + 1 === r.correct_position
@@ -399,64 +409,64 @@ function z(t) {
399
409
  groups: t.options.groups,
400
410
  imageWidth: t.image_width,
401
411
  imageHeight: t.image_height,
402
- answers: o,
412
+ answers: i,
403
413
  availableLabels: A,
404
414
  question: t,
405
415
  // base
406
416
  submitted: c,
407
- isCorrect: d,
417
+ isCorrect: f,
408
418
  attempts: m,
409
- canAnswer: i,
419
+ canAnswer: o,
410
420
  // actions
411
421
  attachLabel: S,
412
422
  removeLabel: Q,
413
423
  moveLabel: I,
414
- getLabelAtBlank: f,
424
+ getLabelAtBlank: d,
415
425
  getBlankForLabel: g,
416
426
  submit: a,
417
427
  reset: s
418
428
  };
419
429
  }
420
- function G(t) {
430
+ function W(t) {
421
431
  const {
422
- canAnswer: i,
432
+ canAnswer: o,
423
433
  submitted: c,
424
- isCorrect: d,
434
+ isCorrect: f,
425
435
  attempts: m,
426
436
  submitQuestion: b,
427
437
  resetQuestion: w
428
- } = O(), [o, l] = x([]);
429
- function A(f, g) {
438
+ } = M(), [i, l] = x([]);
439
+ function A(d, g) {
430
440
  l((p) => {
431
- const a = p.findIndex((s) => s.blankId === f);
441
+ const a = p.findIndex((s) => s.blankId === d);
432
442
  if (a >= 0) {
433
443
  const s = [...p];
434
- return s[a] = { blankId: f, value: g }, s;
444
+ return s[a] = { blankId: d, value: g }, s;
435
445
  }
436
- return [...p, { blankId: f, value: g }];
446
+ return [...p, { blankId: d, value: g }];
437
447
  });
438
448
  }
439
449
  function S() {
440
- let f = 0, g = 0, p = 0;
450
+ let d = 0, g = 0, p = 0;
441
451
  const a = t.correct_answers.list || {}, s = Object.keys(a).length;
442
452
  Object.entries(a).forEach(([n, r]) => {
443
453
  const u = String(r).trim().toLowerCase(), h = t.options.answers.find(
444
454
  (v) => v.correct_position === Number(n)
445
455
  ), C = h && h.point || 1;
446
456
  p += C;
447
- const k = o.find((v) => v.blankId === n);
448
- (k ? String(k.value).trim().toLowerCase() : "") === u && (f += C, g++);
457
+ const k = i.find((v) => v.blankId === n);
458
+ (k ? String(k.value).trim().toLowerCase() : "") === u && (d += C, g++);
449
459
  });
450
460
  const e = g === s && s > 0;
451
461
  return p === 0 && s > 0 && (p = s), {
452
462
  isCorrect: e,
453
- score: Math.round(f * 100) / 100,
463
+ score: Math.round(d * 100) / 100,
454
464
  maxScore: Math.round(p * 100) / 100
455
465
  };
456
466
  }
457
467
  function Q() {
458
- const f = S();
459
- return b(f.isCorrect), f;
468
+ const d = S();
469
+ return b(d.isCorrect), d;
460
470
  }
461
471
  function I() {
462
472
  l([]), w();
@@ -464,28 +474,28 @@ function G(t) {
464
474
  return {
465
475
  // data
466
476
  groups: t.options.groups,
467
- answers: o,
477
+ answers: i,
468
478
  question: t,
469
479
  // base
470
480
  submitted: c,
471
- isCorrect: d,
481
+ isCorrect: f,
472
482
  attempts: m,
473
- canAnswer: i,
483
+ canAnswer: o,
474
484
  // actions
475
485
  answer: A,
476
486
  submit: Q,
477
487
  reset: I
478
488
  };
479
489
  }
480
- function W(t) {
490
+ function H(t) {
481
491
  const {
482
- canAnswer: i,
492
+ canAnswer: o,
483
493
  submitted: c,
484
- isCorrect: d,
494
+ isCorrect: f,
485
495
  attempts: m,
486
496
  submitQuestion: b,
487
497
  resetQuestion: w
488
- } = O(), [o, l] = x([]);
498
+ } = M(), [i, l] = x([]);
489
499
  function A(a, s) {
490
500
  l((e) => {
491
501
  const n = e.findIndex((r) => r.itemId === a);
@@ -504,10 +514,10 @@ function W(t) {
504
514
  const n = t.correct_answers.list || {}, r = Object.keys(n).length;
505
515
  let u = 0;
506
516
  return Object.entries(n).forEach(([C, k]) => {
507
- const L = t.options.items.find((_) => _.id === C), v = L ? L.point : 0;
517
+ const O = t.options.items.find((_) => _.id === C), v = O ? O.point : 0;
508
518
  u += v;
509
- const M = o.find((_) => _.itemId === C);
510
- M && M.categoryId === k && (a += v, s++);
519
+ const L = i.find((_) => _.itemId === C);
520
+ L && L.categoryId === k && (a += v, s++);
511
521
  }), a = Math.round(a * 100) / 100, u = Math.round(u * 100) / 100, {
512
522
  isCorrect: s === r && r > 0,
513
523
  score: a,
@@ -518,20 +528,20 @@ function W(t) {
518
528
  const a = Q();
519
529
  return b(a.isCorrect), a;
520
530
  }
521
- function f() {
531
+ function d() {
522
532
  l([]), w();
523
533
  }
524
- const g = B(() => t.options.items.filter(
525
- (a) => !o.some((s) => s.itemId === a.id)
526
- ), [t.options.items, o]), p = B(() => t.options.categories.map((a) => {
527
- const s = o.filter((e) => e.categoryId === a.id).map((e) => ({
534
+ const g = y(() => t.options.items.filter(
535
+ (a) => !i.some((s) => s.itemId === a.id)
536
+ ), [t.options.items, i]), p = y(() => t.options.categories.map((a) => {
537
+ const s = i.filter((e) => e.categoryId === a.id).map((e) => ({
528
538
  ...t.options.items.find((r) => r.id === e.itemId)
529
539
  }));
530
540
  return {
531
541
  ...a,
532
542
  items: s
533
543
  };
534
- }), [t.options.categories, t.options.items, o]);
544
+ }), [t.options.categories, t.options.items, i]);
535
545
  return {
536
546
  // data
537
547
  categories: t.options.categories,
@@ -539,30 +549,30 @@ function W(t) {
539
549
  question: t,
540
550
  categoriesWithItems: p,
541
551
  // state
542
- answers: o,
552
+ answers: i,
543
553
  unassignedItems: g,
544
554
  // base
545
555
  submitted: c,
546
- isCorrect: d,
556
+ isCorrect: f,
547
557
  attempts: m,
548
- canAnswer: i,
558
+ canAnswer: o,
549
559
  // actions
550
560
  move: A,
551
561
  remove: S,
552
562
  submit: I,
553
- reset: f
563
+ reset: d
554
564
  };
555
565
  }
556
- function H(t) {
566
+ function N(t) {
557
567
  const {
558
- canAnswer: i,
568
+ canAnswer: o,
559
569
  submitted: c,
560
- isCorrect: d,
570
+ isCorrect: f,
561
571
  attempts: m,
562
572
  resetQuestion: b,
563
573
  submitQuestion: w
564
- } = O();
565
- function o() {
574
+ } = M();
575
+ function i() {
566
576
  c || w(!0);
567
577
  }
568
578
  function l() {
@@ -574,97 +584,98 @@ function H(t) {
574
584
  url: t.options.url,
575
585
  type: t.options.urlType,
576
586
  // actions
577
- submit: o,
587
+ submit: i,
578
588
  reset: l,
579
589
  // base
580
590
  submitted: c,
581
- isCorrect: d,
591
+ isCorrect: f,
582
592
  attempts: m,
583
- canAnswer: i
593
+ canAnswer: o
584
594
  };
585
595
  }
586
- function P({
587
- getData: t,
588
- children: i
589
- }) {
590
- const c = E(t());
591
- return i(c);
592
- }
593
596
  function U({
594
597
  getData: t,
595
- children: i
598
+ children: o
596
599
  }) {
597
- const c = j(t());
598
- return i(c);
600
+ const c = E(t());
601
+ return o(c);
599
602
  }
600
603
  function J({
601
604
  getData: t,
602
- children: i
605
+ children: o
603
606
  }) {
604
607
  const c = V(t());
605
- return i(c);
608
+ return o(c);
606
609
  }
607
610
  function R({
608
611
  getData: t,
609
- children: i
612
+ children: o
610
613
  }) {
611
614
  const c = T(t());
612
- return i(c);
615
+ return o(c);
613
616
  }
614
617
  function X({
615
618
  getData: t,
616
- children: i
619
+ children: o
617
620
  }) {
618
621
  const c = F(t());
619
- return i(c);
622
+ return o(c);
620
623
  }
621
624
  function Y({
622
625
  getData: t,
623
- children: i
626
+ children: o
624
627
  }) {
625
628
  const c = z(t());
626
- return i(c);
629
+ return o(c);
627
630
  }
628
631
  function Z({
629
632
  getData: t,
630
- children: i
633
+ children: o
631
634
  }) {
632
635
  const c = G(t());
633
- return i(c);
636
+ return o(c);
634
637
  }
635
638
  function $({
636
639
  getData: t,
637
- children: i
640
+ children: o
638
641
  }) {
639
642
  const c = W(t());
640
- return i(c);
643
+ return o(c);
641
644
  }
642
645
  function K({
643
646
  getData: t,
644
- children: i
647
+ children: o
645
648
  }) {
646
649
  const c = H(t());
647
- return i(c);
650
+ return o(c);
651
+ }
652
+ function q({
653
+ getData: t,
654
+ children: o
655
+ }) {
656
+ const c = N(t());
657
+ return o(c);
648
658
  }
649
659
  export {
650
- R as DragDropQuestion,
651
- Z as FillInBlankQuestion,
652
- $ as GroupingQuestion,
653
- Y as LabelingQuestion,
654
- U as MatchingQuestion,
655
- P as MultipleChoicesQuestion,
656
- X as OrderingQuestion,
657
- K as PowerpointQuestion,
658
- J as VideoQuestion,
659
- D as isSameSet,
660
- O as useBaseQuestion,
661
- T as useDragDrop,
662
- G as useFillInBlank,
663
- W as useGrouping,
664
- z as useLabeling,
665
- j as useMatching,
660
+ X as DragDropQuestion,
661
+ $ as FillInBlankQuestion,
662
+ K as GroupingQuestion,
663
+ Z as LabelingQuestion,
664
+ J as MatchingQuestion,
665
+ U as MultipleChoicesQuestion,
666
+ Y as OrderingQuestion,
667
+ q as PowerpointQuestion,
668
+ R as VideoQuestion,
669
+ j as isSameSet,
670
+ D as shuffleArray,
671
+ M as useBaseQuestion,
672
+ F as useDragDrop,
673
+ W as useFillInBlank,
674
+ H as useGrouping,
675
+ G as useLabeling,
676
+ V as useMatching,
666
677
  E as useMultipleChoice,
667
- F as useOrdering,
668
- H as usePowerpoint,
669
- V as useVideo
678
+ z as useOrdering,
679
+ N as usePowerpoint,
680
+ T as useVideo
670
681
  };
@@ -1,2 +1,3 @@
1
1
  export declare function isSameSet(a: string[], b: string[]): boolean;
2
+ export declare function shuffleArray<T>(array: T[]): T[];
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
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;AAGD,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAO/C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enspiredigital/xlms-headless",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",