@intellectif/lk-core 0.7.0 → 0.8.0
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/CHANGELOG.md +360 -0
- package/README.md +65 -10
- package/dist/{activity-gelWNZ6V.d.cts → activity-CPtJUBek.d.cts} +74 -3
- package/dist/{activity-gelWNZ6V.d.ts → activity-CPtJUBek.d.ts} +74 -3
- package/dist/{chunk-MVZKEWZN.cjs → chunk-4VH7RUX6.cjs} +8 -8
- package/dist/{chunk-MVZKEWZN.cjs.map → chunk-4VH7RUX6.cjs.map} +1 -1
- package/dist/{chunk-AFIQQADJ.cjs → chunk-64NBQCRE.cjs} +4 -4
- package/dist/{chunk-AFIQQADJ.cjs.map → chunk-64NBQCRE.cjs.map} +1 -1
- package/dist/{chunk-XL75ZZVM.js → chunk-H7L57ITR.js} +10 -6
- package/dist/chunk-H7L57ITR.js.map +1 -0
- package/dist/{chunk-NOBJYDOB.js → chunk-HTMRJ2SS.js} +2 -2
- package/dist/{chunk-7NIH5IL3.cjs → chunk-JFSZTWHL.cjs} +19 -15
- package/dist/chunk-JFSZTWHL.cjs.map +1 -0
- package/dist/{chunk-YCXIHFLG.js → chunk-OJXTXOUA.js} +87 -5
- package/dist/chunk-OJXTXOUA.js.map +1 -0
- package/dist/{chunk-5RE3ZRSA.cjs → chunk-RHJ5VNFB.cjs} +94 -12
- package/dist/chunk-RHJ5VNFB.cjs.map +1 -0
- package/dist/{chunk-2SQ75JTE.js → chunk-ZBCKQBAB.js} +2 -2
- package/dist/{index-CDWH2WIg.d.cts → index-BxW_Ho_t.d.cts} +351 -7
- package/dist/{index-B_RLyeEj.d.ts → index-Kc53zVgY.d.ts} +351 -7
- package/dist/index.cjs +173 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +173 -5
- package/dist/index.d.ts +173 -5
- package/dist/index.js +153 -6
- package/dist/index.js.map +1 -1
- package/dist/schemas.cjs +9 -3
- package/dist/schemas.cjs.map +1 -1
- package/dist/schemas.d.cts +2 -2
- package/dist/schemas.d.ts +2 -2
- package/dist/schemas.js +8 -2
- package/dist/scoring.cjs +3 -3
- package/dist/scoring.d.cts +2 -2
- package/dist/scoring.d.ts +2 -2
- package/dist/scoring.js +2 -2
- package/dist/xapi.cjs +3 -3
- package/dist/xapi.d.cts +1 -1
- package/dist/xapi.d.ts +1 -1
- package/dist/xapi.js +2 -2
- package/package.json +26 -3
- package/dist/chunk-5RE3ZRSA.cjs.map +0 -1
- package/dist/chunk-7NIH5IL3.cjs.map +0 -1
- package/dist/chunk-XL75ZZVM.js.map +0 -1
- package/dist/chunk-YCXIHFLG.js.map +0 -1
- /package/dist/{chunk-NOBJYDOB.js.map → chunk-HTMRJ2SS.js.map} +0 -0
- /package/dist/{chunk-2SQ75JTE.js.map → chunk-ZBCKQBAB.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunk4VH7RUX6cjs = require('./chunk-4VH7RUX6.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunk64NBQCREcjs = require('./chunk-64NBQCRE.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
@@ -31,7 +31,7 @@ var _chunkAFIQQADJcjs = require('./chunk-AFIQQADJ.cjs');
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _chunkJFSZTWHLcjs = require('./chunk-JFSZTWHL.cjs');
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
@@ -63,7 +63,11 @@ var _chunk7NIH5IL3cjs = require('./chunk-7NIH5IL3.cjs');
|
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
var _chunkRHJ5VNFBcjs = require('./chunk-RHJ5VNFB.cjs');
|
|
67
71
|
|
|
68
72
|
// src/content-hash.ts
|
|
69
73
|
function canonicalJson(value, seen = /* @__PURE__ */ new Set()) {
|
|
@@ -228,6 +232,99 @@ function flattenSequence(entries, options = {}) {
|
|
|
228
232
|
return slots;
|
|
229
233
|
}
|
|
230
234
|
|
|
235
|
+
// src/media-budget.ts
|
|
236
|
+
function entryKeyOf(slotId) {
|
|
237
|
+
const dot = slotId.indexOf(".");
|
|
238
|
+
return dot === -1 ? slotId : slotId.slice(0, dot);
|
|
239
|
+
}
|
|
240
|
+
function slotMediaKey(slotId) {
|
|
241
|
+
return `slot:${slotId}`;
|
|
242
|
+
}
|
|
243
|
+
function stimulusMediaKey(slotId) {
|
|
244
|
+
return `stimulus:${entryKeyOf(slotId)}`;
|
|
245
|
+
}
|
|
246
|
+
function resolvePlaybackPolicy(media) {
|
|
247
|
+
const p = media.playback;
|
|
248
|
+
const budgeted = typeof _optionalChain([p, 'optionalAccess', _ => _.maxPlays]) === "number";
|
|
249
|
+
const seek = _nullishCoalesce(_optionalChain([p, 'optionalAccess', _2 => _2.seek]), () => ( (budgeted ? "none" : "allow")));
|
|
250
|
+
const rate = _nullishCoalesce(_optionalChain([p, 'optionalAccess', _3 => _3.rate]), () => ( "allow"));
|
|
251
|
+
const controls = _nullishCoalesce(_optionalChain([p, 'optionalAccess', _4 => _4.controls]), () => ( (budgeted || seek === "none" || rate === "fixed" ? "minimal" : "native")));
|
|
252
|
+
return {
|
|
253
|
+
controls,
|
|
254
|
+
maxPlays: budgeted ? _optionalChain([p, 'optionalAccess', _5 => _5.maxPlays]) : null,
|
|
255
|
+
seek,
|
|
256
|
+
rate,
|
|
257
|
+
nativeControlHints: _nullishCoalesce(_optionalChain([p, 'optionalAccess', _6 => _6.nativeControlHints]), () => ( []))
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
function planMediaBudgets(plan) {
|
|
261
|
+
const out = {};
|
|
262
|
+
for (const slot of plan.slots) {
|
|
263
|
+
for (const budget of _nullishCoalesce(slot.mediaBudgets, () => ( []))) {
|
|
264
|
+
out[budget.key] = budget.maxPlays;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
return out;
|
|
268
|
+
}
|
|
269
|
+
function assertEntry(key, entry) {
|
|
270
|
+
if (entry === null || typeof entry !== "object" || !Number.isInteger(entry.plays) || entry.plays < 0) {
|
|
271
|
+
throw new Error(
|
|
272
|
+
`serializeMediaPlayLedger: play count for ${JSON.stringify(key)} is ${JSON.stringify(_optionalChain([entry, 'optionalAccess', _7 => _7.plays]))}. A count must be a non-negative integer; Number(a NULL column) is the usual cause.`
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
if (entry.at !== void 0 && (!Number.isFinite(entry.at) || entry.at < 0)) {
|
|
276
|
+
throw new Error(
|
|
277
|
+
`serializeMediaPlayLedger: position for ${JSON.stringify(key)} is ${JSON.stringify(entry.at)}. A position must be a finite number of seconds >= 0.`
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
function serializeMediaPlayLedger(plan, entries, options = {}) {
|
|
282
|
+
if (entries === null || typeof entries !== "object") {
|
|
283
|
+
throw new Error("serializeMediaPlayLedger: entries must be an object keyed by media key.");
|
|
284
|
+
}
|
|
285
|
+
const budgets = planMediaBudgets(plan);
|
|
286
|
+
const out = {};
|
|
287
|
+
for (const key of Object.keys(entries)) {
|
|
288
|
+
if (!Object.hasOwn(budgets, key)) {
|
|
289
|
+
throw new Error(
|
|
290
|
+
`serializeMediaPlayLedger: media play recorded against a recording the plan does not budget: ${JSON.stringify(key)}. Keys come from slotMediaKey() / stimulusMediaKey(); a key that belongs to no budgeted media means the client and the plan disagree about which paper this is.`
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
const entry = entries[key];
|
|
294
|
+
assertEntry(key, entry);
|
|
295
|
+
out[key] = { plays: entry.plays, ...entry.at !== void 0 ? { at: entry.at } : {} };
|
|
296
|
+
}
|
|
297
|
+
return {
|
|
298
|
+
ledgerVersion: "1.0",
|
|
299
|
+
planHash: plan.planHash,
|
|
300
|
+
entries: out,
|
|
301
|
+
...options.savedAt !== void 0 ? { savedAt: options.savedAt } : {}
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
function restoreMediaPlayLedger(plan, stored) {
|
|
305
|
+
if (stored === null || typeof stored !== "object") {
|
|
306
|
+
throw new Error("restoreMediaPlayLedger: the stored ledger is not an object.");
|
|
307
|
+
}
|
|
308
|
+
if (stored.ledgerVersion !== "1.0") {
|
|
309
|
+
throw new Error(
|
|
310
|
+
`restoreMediaPlayLedger: unsupported ledgerVersion ${JSON.stringify(stored.ledgerVersion)}. This build understands "1.0"; a newer ledger must be migrated before it is restored.`
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
if (stored.entries === null || typeof stored.entries !== "object") {
|
|
314
|
+
throw new Error(
|
|
315
|
+
"restoreMediaPlayLedger: the ledger carries no entries object (a NULL column, or a partially written row)."
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
if (stored.planHash !== plan.planHash) {
|
|
319
|
+
throw new Error(
|
|
320
|
+
`restoreMediaPlayLedger: this ledger belongs to a different paper (ledger ${stored.planHash}, plan ${plan.planHash}). Restoring it would hold the learner to a play budget from an exam they never sat.`
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
return serializeMediaPlayLedger(plan, stored.entries, {
|
|
324
|
+
...stored.savedAt !== void 0 ? { savedAt: stored.savedAt } : {}
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
|
|
231
328
|
// src/attempt-plan.ts
|
|
232
329
|
function contentOf(activity) {
|
|
233
330
|
if (!Object.hasOwn(activity, "slotKey")) {
|
|
@@ -236,12 +333,50 @@ function contentOf(activity) {
|
|
|
236
333
|
const { slotKey: _slotKey, ...content } = activity;
|
|
237
334
|
return content;
|
|
238
335
|
}
|
|
336
|
+
function mediaBudgetsOf(slot) {
|
|
337
|
+
const budgets = [];
|
|
338
|
+
const own = slot.activity.media;
|
|
339
|
+
if (own !== void 0) {
|
|
340
|
+
const maxPlays = resolvePlaybackPolicy(own).maxPlays;
|
|
341
|
+
if (maxPlays !== null) {
|
|
342
|
+
budgets.push({ key: slotMediaKey(slot.slotId), maxPlays });
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
const stimulusMedia = _optionalChain([slot, 'access', _8 => _8.group, 'optionalAccess', _9 => _9.stimulus, 'access', _10 => _10.media]);
|
|
346
|
+
if (stimulusMedia !== void 0) {
|
|
347
|
+
const maxPlays = resolvePlaybackPolicy(stimulusMedia).maxPlays;
|
|
348
|
+
if (maxPlays !== null) {
|
|
349
|
+
budgets.push({ key: stimulusMediaKey(slot.slotId), maxPlays });
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
return budgets.length > 0 ? budgets : void 0;
|
|
353
|
+
}
|
|
354
|
+
function assertNoSplitBudgets(slots) {
|
|
355
|
+
const keysByUrl = /* @__PURE__ */ new Map();
|
|
356
|
+
for (const slot of slots) {
|
|
357
|
+
const own = slot.activity.media;
|
|
358
|
+
if (own === void 0 || resolvePlaybackPolicy(own).maxPlays === null) {
|
|
359
|
+
continue;
|
|
360
|
+
}
|
|
361
|
+
const keys = _nullishCoalesce(keysByUrl.get(own.url), () => ( []));
|
|
362
|
+
keys.push(slotMediaKey(slot.slotId));
|
|
363
|
+
keysByUrl.set(own.url, keys);
|
|
364
|
+
}
|
|
365
|
+
for (const [url, keys] of keysByUrl) {
|
|
366
|
+
if (keys.length > 1) {
|
|
367
|
+
throw new Error(
|
|
368
|
+
`planAttempt: media ${JSON.stringify(url)} is budgeted under ${keys.length} separate keys (${keys.join(", ")}), so one recording grants ${keys.length} \xD7 maxPlays. Put the questions that share a recording in an item group \u2014 a group's stimulus is one recording with one budget.`
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
239
373
|
function planSlot(slot, points) {
|
|
240
374
|
if (!Number.isFinite(points) || points < 0) {
|
|
241
375
|
throw new Error(
|
|
242
376
|
`planAttempt: slot "${slot.slotId}" resolved to ${String(points)} points. Points must be a finite, non-negative number, or the paper has no defensible total.`
|
|
243
377
|
);
|
|
244
378
|
}
|
|
379
|
+
const mediaBudgets = mediaBudgetsOf(slot);
|
|
245
380
|
return {
|
|
246
381
|
slotId: slot.slotId,
|
|
247
382
|
index: slot.index,
|
|
@@ -255,7 +390,8 @@ function planSlot(slot, points) {
|
|
|
255
390
|
...slot.group.title !== void 0 ? { title: slot.group.title } : {},
|
|
256
391
|
stimulusHash: contentHash(slot.group.stimulus)
|
|
257
392
|
}
|
|
258
|
-
} : {}
|
|
393
|
+
} : {},
|
|
394
|
+
...mediaBudgets !== void 0 ? { mediaBudgets } : {}
|
|
259
395
|
};
|
|
260
396
|
}
|
|
261
397
|
function planAttempt(entries, options = {}) {
|
|
@@ -264,7 +400,8 @@ function planAttempt(entries, options = {}) {
|
|
|
264
400
|
...shuffleEntries !== void 0 ? { shuffleEntries } : {},
|
|
265
401
|
...seed !== void 0 ? { seed } : {}
|
|
266
402
|
});
|
|
267
|
-
|
|
403
|
+
assertNoSplitBudgets(slots);
|
|
404
|
+
const planned = slots.map((slot) => planSlot(slot, _nullishCoalesce(_optionalChain([points, 'optionalCall', _11 => _11(slot)]), () => ( 1))));
|
|
268
405
|
const totalPoints = planned.reduce((sum, slot) => sum + slot.points, 0);
|
|
269
406
|
return {
|
|
270
407
|
planVersion: "1.0",
|
|
@@ -295,7 +432,7 @@ function verifyAttemptPlan(plan, current) {
|
|
|
295
432
|
if (now.contentHash !== slot.contentHash) {
|
|
296
433
|
changedSlotIds.push(slot.slotId);
|
|
297
434
|
}
|
|
298
|
-
if (_optionalChain([now, 'access',
|
|
435
|
+
if (_optionalChain([now, 'access', _12 => _12.group, 'optionalAccess', _13 => _13.stimulusHash]) !== _optionalChain([slot, 'access', _14 => _14.group, 'optionalAccess', _15 => _15.stimulusHash])) {
|
|
299
436
|
changedStimulusSlotIds.push(slot.slotId);
|
|
300
437
|
}
|
|
301
438
|
if (now.points !== slot.points) {
|
|
@@ -487,9 +624,9 @@ function redactValue(value, policy, reveal) {
|
|
|
487
624
|
}
|
|
488
625
|
function redact(data, options = {}) {
|
|
489
626
|
const reveal = _nullishCoalesce(options.reveal, () => ( "none"));
|
|
490
|
-
const descriptor =
|
|
627
|
+
const descriptor = _chunkRHJ5VNFBcjs.getActivityTypeDescriptor.call(void 0, data.type);
|
|
491
628
|
if (descriptor === void 0) {
|
|
492
|
-
throw new (0,
|
|
629
|
+
throw new (0, _chunkRHJ5VNFBcjs.UnknownActivityTypeError)(String(data.type));
|
|
493
630
|
}
|
|
494
631
|
if (descriptor.fieldPolicy === void 0) {
|
|
495
632
|
throw new Error(
|
|
@@ -502,7 +639,7 @@ function redact(data, options = {}) {
|
|
|
502
639
|
if (reveal === "none" && descriptor.redactedSchema !== void 0) {
|
|
503
640
|
const parsed = descriptor.redactedSchema.safeParse(result);
|
|
504
641
|
if (!parsed.success) {
|
|
505
|
-
throw new (0,
|
|
642
|
+
throw new (0, _chunkRHJ5VNFBcjs.ActivitySchemaError)(
|
|
506
643
|
descriptor.type,
|
|
507
644
|
parsed.error.issues.map((issue) => ({
|
|
508
645
|
path: issue.path.map(String),
|
|
@@ -516,13 +653,13 @@ function redact(data, options = {}) {
|
|
|
516
653
|
}
|
|
517
654
|
function assertRedacted(data) {
|
|
518
655
|
if (typeof data !== "object" || data === null) {
|
|
519
|
-
throw new (0,
|
|
656
|
+
throw new (0, _chunkRHJ5VNFBcjs.ActivitySchemaError)("unknown", [
|
|
520
657
|
{ path: [], message: "Redacted activity data must be an object.", code: "invalid_type" }
|
|
521
658
|
]);
|
|
522
659
|
}
|
|
523
660
|
const candidate = data;
|
|
524
661
|
if (candidate.redacted !== true) {
|
|
525
|
-
throw new (0,
|
|
662
|
+
throw new (0, _chunkRHJ5VNFBcjs.ActivitySchemaError)(String(_nullishCoalesce(candidate.type, () => ( "unknown"))), [
|
|
526
663
|
{
|
|
527
664
|
path: ["redacted"],
|
|
528
665
|
message: "Missing redacted marker \u2014 this payload is not a redact() projection.",
|
|
@@ -531,12 +668,12 @@ function assertRedacted(data) {
|
|
|
531
668
|
]);
|
|
532
669
|
}
|
|
533
670
|
const type = typeof candidate.type === "string" ? candidate.type : "";
|
|
534
|
-
const descriptor =
|
|
671
|
+
const descriptor = _chunkRHJ5VNFBcjs.getActivityTypeDescriptor.call(void 0, type);
|
|
535
672
|
if (descriptor === void 0) {
|
|
536
|
-
throw new (0,
|
|
673
|
+
throw new (0, _chunkRHJ5VNFBcjs.UnknownActivityTypeError)(type);
|
|
537
674
|
}
|
|
538
675
|
if (descriptor.redactedSchema === void 0) {
|
|
539
|
-
throw new (0,
|
|
676
|
+
throw new (0, _chunkRHJ5VNFBcjs.ActivitySchemaError)(descriptor.type, [
|
|
540
677
|
{
|
|
541
678
|
path: [],
|
|
542
679
|
message: `Activity type "${descriptor.type}" registers no redactedSchema; assertRedacted cannot prove this payload is learner-safe.`,
|
|
@@ -546,7 +683,7 @@ function assertRedacted(data) {
|
|
|
546
683
|
}
|
|
547
684
|
const parsed = descriptor.redactedSchema.safeParse(candidate);
|
|
548
685
|
if (!parsed.success) {
|
|
549
|
-
throw new (0,
|
|
686
|
+
throw new (0, _chunkRHJ5VNFBcjs.ActivitySchemaError)(
|
|
550
687
|
descriptor.type,
|
|
551
688
|
parsed.error.issues.map((issue) => ({
|
|
552
689
|
path: issue.path.map(String),
|
|
@@ -562,7 +699,7 @@ var STIMULUS_FIELD_POLICY = {
|
|
|
562
699
|
title: "public",
|
|
563
700
|
body: "public",
|
|
564
701
|
bodyHtml: "public",
|
|
565
|
-
media:
|
|
702
|
+
media: _chunkRHJ5VNFBcjs.MEDIA_FIELD_POLICY,
|
|
566
703
|
locale: "public",
|
|
567
704
|
attribution: "public",
|
|
568
705
|
transcript: "author-only"
|
|
@@ -588,9 +725,9 @@ function redactItemGroup(group, options = {}) {
|
|
|
588
725
|
redacted: true
|
|
589
726
|
};
|
|
590
727
|
if (reveal === "none") {
|
|
591
|
-
const parsed =
|
|
728
|
+
const parsed = _chunkJFSZTWHLcjs.RedactedItemGroupSchema.safeParse(result);
|
|
592
729
|
if (!parsed.success) {
|
|
593
|
-
throw new (0,
|
|
730
|
+
throw new (0, _chunkRHJ5VNFBcjs.ActivitySchemaError)(
|
|
594
731
|
"item-group",
|
|
595
732
|
parsed.error.issues.map((issue) => ({
|
|
596
733
|
path: issue.path.map(String),
|
|
@@ -604,13 +741,13 @@ function redactItemGroup(group, options = {}) {
|
|
|
604
741
|
}
|
|
605
742
|
function assertRedactedItemGroup(data) {
|
|
606
743
|
if (typeof data !== "object" || data === null) {
|
|
607
|
-
throw new (0,
|
|
744
|
+
throw new (0, _chunkRHJ5VNFBcjs.ActivitySchemaError)("item-group", [
|
|
608
745
|
{ path: [], message: "Redacted item group must be an object.", code: "invalid_type" }
|
|
609
746
|
]);
|
|
610
747
|
}
|
|
611
748
|
const candidate = data;
|
|
612
749
|
if (candidate.redacted !== true) {
|
|
613
|
-
throw new (0,
|
|
750
|
+
throw new (0, _chunkRHJ5VNFBcjs.ActivitySchemaError)("item-group", [
|
|
614
751
|
{
|
|
615
752
|
path: ["redacted"],
|
|
616
753
|
message: "Missing redacted marker \u2014 this payload is not a redactItemGroup() projection.",
|
|
@@ -618,9 +755,9 @@ function assertRedactedItemGroup(data) {
|
|
|
618
755
|
}
|
|
619
756
|
]);
|
|
620
757
|
}
|
|
621
|
-
const parsed =
|
|
758
|
+
const parsed = _chunkJFSZTWHLcjs.RedactedItemGroupSchema.safeParse(candidate);
|
|
622
759
|
if (!parsed.success) {
|
|
623
|
-
throw new (0,
|
|
760
|
+
throw new (0, _chunkRHJ5VNFBcjs.ActivitySchemaError)(
|
|
624
761
|
"item-group",
|
|
625
762
|
parsed.error.issues.map((issue) => ({
|
|
626
763
|
path: issue.path.map(String),
|
|
@@ -633,8 +770,8 @@ function assertRedactedItemGroup(data) {
|
|
|
633
770
|
try {
|
|
634
771
|
assertRedacted(item);
|
|
635
772
|
} catch (error) {
|
|
636
|
-
if (error instanceof
|
|
637
|
-
throw new (0,
|
|
773
|
+
if (error instanceof _chunkRHJ5VNFBcjs.ActivitySchemaError) {
|
|
774
|
+
throw new (0, _chunkRHJ5VNFBcjs.ActivitySchemaError)(
|
|
638
775
|
"item-group",
|
|
639
776
|
error.errors.map((issue) => ({
|
|
640
777
|
...issue,
|
|
@@ -722,5 +859,15 @@ function assertRedactedItemGroup(data) {
|
|
|
722
859
|
|
|
723
860
|
|
|
724
861
|
|
|
725
|
-
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
|
|
865
|
+
|
|
866
|
+
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
exports.ActivitySchemaError = _chunkRHJ5VNFBcjs.ActivitySchemaError; exports.BlankConfigSchema = _chunkRHJ5VNFBcjs.BlankConfigSchema; exports.DEFAULT_PASS_THRESHOLD = _chunk4VH7RUX6cjs.DEFAULT_PASS_THRESHOLD; exports.DeferredScoringError = _chunkRHJ5VNFBcjs.DeferredScoringError; exports.FeedbackSchema = _chunkRHJ5VNFBcjs.FeedbackSchema; exports.FillInTheBlanksDataSchema = _chunkRHJ5VNFBcjs.FillInTheBlanksDataSchema; exports.ItemGroupSchema = _chunkJFSZTWHLcjs.ItemGroupSchema; exports.MediaPlaybackSchema = _chunkRHJ5VNFBcjs.MediaPlaybackSchema; exports.MediaSchema = _chunkRHJ5VNFBcjs.MediaSchema; exports.MediaUrlSchema = _chunkRHJ5VNFBcjs.MediaUrlSchema; exports.MultipleChoiceDataSchema = _chunkRHJ5VNFBcjs.MultipleChoiceDataSchema; exports.MultipleChoiceOptionSchema = _chunkRHJ5VNFBcjs.MultipleChoiceOptionSchema; exports.NativeControlHintSchema = _chunkRHJ5VNFBcjs.NativeControlHintSchema; exports.RedactedBlankConfigSchema = _chunkRHJ5VNFBcjs.RedactedBlankConfigSchema; exports.RedactedFillInTheBlanksDataSchema = _chunkRHJ5VNFBcjs.RedactedFillInTheBlanksDataSchema; exports.RedactedItemGroupSchema = _chunkJFSZTWHLcjs.RedactedItemGroupSchema; exports.RedactedMediaSchema = _chunkRHJ5VNFBcjs.RedactedMediaSchema; exports.RedactedMultipleChoiceDataSchema = _chunkRHJ5VNFBcjs.RedactedMultipleChoiceDataSchema; exports.RedactedMultipleChoiceOptionSchema = _chunkRHJ5VNFBcjs.RedactedMultipleChoiceOptionSchema; exports.RedactedScoringError = _chunkRHJ5VNFBcjs.RedactedScoringError; exports.RedactedStimulusSchema = _chunkJFSZTWHLcjs.RedactedStimulusSchema; exports.RedactedWrittenResponseDataSchema = _chunkRHJ5VNFBcjs.RedactedWrittenResponseDataSchema; exports.StimulusSchema = _chunkJFSZTWHLcjs.StimulusSchema; exports.TextMatchPolicySchema = _chunkRHJ5VNFBcjs.TextMatchPolicySchema; exports.UnknownActivityTypeError = _chunkRHJ5VNFBcjs.UnknownActivityTypeError; exports.WrittenResponseDataSchema = _chunkRHJ5VNFBcjs.WrittenResponseDataSchema; exports.WrittenResponseRubricCriterionSchema = _chunkRHJ5VNFBcjs.WrittenResponseRubricCriterionSchema; exports.WrittenResponseRubricSchema = _chunkRHJ5VNFBcjs.WrittenResponseRubricSchema; exports.XAPIVerb = _chunk64NBQCREcjs.XAPIVerb; exports.XAPI_VERB_DISPLAY = _chunk64NBQCREcjs.XAPI_VERB_DISPLAY; exports.assertRedacted = assertRedacted; exports.assertRedactedItemGroup = assertRedactedItemGroup; exports.canonicalJson = canonicalJson; exports.classifyBand = _chunk4VH7RUX6cjs.classifyBand; exports.composeAssessmentScore = _chunk4VH7RUX6cjs.composeAssessmentScore; exports.computePassThreshold = _chunk4VH7RUX6cjs.computePassThreshold; exports.contentHash = contentHash; exports.countWords = _chunkRHJ5VNFBcjs.countWords; exports.defineActivityType = _chunkRHJ5VNFBcjs.defineActivityType; exports.diffResponses = diffResponses; exports.entryKeyOf = entryKeyOf; exports.evaluate = _chunk4VH7RUX6cjs.evaluate; exports.fillInTheBlanksJsonSchema = _chunkJFSZTWHLcjs.fillInTheBlanksJsonSchema; exports.fillInTheBlanksType = _chunkRHJ5VNFBcjs.fillInTheBlanksType; exports.fingerprint = fingerprint; exports.flattenSequence = flattenSequence; exports.getActivityTypeDescriptor = _chunkRHJ5VNFBcjs.getActivityTypeDescriptor; exports.gradeFromRubric = _chunk4VH7RUX6cjs.gradeFromRubric; exports.gte = _chunk4VH7RUX6cjs.gte; exports.hasGrade = _chunk4VH7RUX6cjs.hasGrade; exports.hashSeed = hashSeed; exports.isItemGroup = isItemGroup; exports.itemGroupJsonSchema = _chunkJFSZTWHLcjs.itemGroupJsonSchema; exports.jsonSchemaFor = _chunkJFSZTWHLcjs.jsonSchemaFor; exports.levenshteinDistance = _chunkRHJ5VNFBcjs.levenshteinDistance; exports.matchText = _chunkRHJ5VNFBcjs.matchText; exports.multipleChoiceJsonSchema = _chunkJFSZTWHLcjs.multipleChoiceJsonSchema; exports.multipleChoiceType = _chunkRHJ5VNFBcjs.multipleChoiceType; exports.outcomeFromGrade = _chunk4VH7RUX6cjs.outcomeFromGrade; exports.planAttempt = planAttempt; exports.planMediaBudgets = planMediaBudgets; exports.redact = redact; exports.redactItemGroup = redactItemGroup; exports.registerActivityType = _chunkRHJ5VNFBcjs.registerActivityType; exports.registeredActivityTypes = _chunkRHJ5VNFBcjs.registeredActivityTypes; exports.resolvePlaybackPolicy = resolvePlaybackPolicy; exports.restoreAttemptState = restoreAttemptState; exports.restoreMediaPlayLedger = restoreMediaPlayLedger; exports.roundGrade = _chunk4VH7RUX6cjs.roundGrade; exports.score = _chunk4VH7RUX6cjs.score; exports.scoredItemsFromPlan = scoredItemsFromPlan; exports.seededShuffle = seededShuffle; exports.serializeAttemptState = serializeAttemptState; exports.serializeMediaPlayLedger = serializeMediaPlayLedger; exports.slotMediaKey = slotMediaKey; exports.stimulusJsonSchema = _chunkJFSZTWHLcjs.stimulusJsonSchema; exports.stimulusMediaKey = stimulusMediaKey; exports.validateActivity = _chunkJFSZTWHLcjs.validateActivity; exports.validateItemGroup = _chunkJFSZTWHLcjs.validateItemGroup; exports.validateXAPIStatement = _chunk64NBQCREcjs.validateXAPIStatement; exports.verifyAttemptPlan = verifyAttemptPlan; exports.writtenResponseJsonSchema = _chunkJFSZTWHLcjs.writtenResponseJsonSchema; exports.writtenResponseType = _chunkRHJ5VNFBcjs.writtenResponseType; exports.xAPIBuilder = _chunk64NBQCREcjs.xAPIBuilder; exports.xapiDefinitionFor = _chunk64NBQCREcjs.xapiDefinitionFor;
|
|
726
873
|
//# sourceMappingURL=index.cjs.map
|