@intellectif/lk-core 0.21.0 → 1.0.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 +31 -0
- package/README.md +6 -5
- package/dist/{activity-xhGV-Aeh.d.cts → activity-DgpBJeBc.d.cts} +137 -22
- package/dist/{activity-xhGV-Aeh.d.ts → activity-DgpBJeBc.d.ts} +137 -22
- package/dist/ai-check.cjs +104 -16
- package/dist/ai-check.cjs.map +1 -1
- package/dist/ai-check.d.cts +9 -5
- package/dist/ai-check.d.ts +9 -5
- package/dist/ai-check.js +103 -15
- package/dist/ai-check.js.map +1 -1
- package/dist/{chunk-2CV6NU32.cjs → chunk-2JT2WUQ2.cjs} +77 -39
- package/dist/chunk-2JT2WUQ2.cjs.map +1 -0
- package/dist/{chunk-D4TOPSHV.cjs → chunk-DSDXL3JO.cjs} +1216 -1105
- package/dist/chunk-DSDXL3JO.cjs.map +1 -0
- package/dist/{chunk-D3GP5MET.js → chunk-FBKTION6.js} +1093 -982
- package/dist/chunk-FBKTION6.js.map +1 -0
- package/dist/{chunk-Q7MV3IXJ.js → chunk-IARLJ5MW.js} +15 -16
- package/dist/chunk-IARLJ5MW.js.map +1 -0
- package/dist/{chunk-IHOEP4EB.js → chunk-RCZCP5OE.js} +311 -25
- package/dist/chunk-RCZCP5OE.js.map +1 -0
- package/dist/{chunk-X5DAXBJI.js → chunk-SJVRUPJT.js} +2 -2
- package/dist/{chunk-EOFWSGLU.cjs → chunk-TJJFKKH2.cjs} +4 -4
- package/dist/{chunk-EOFWSGLU.cjs.map → chunk-TJJFKKH2.cjs.map} +1 -1
- package/dist/{chunk-WQVZPIN7.cjs → chunk-VSH7ECQL.cjs} +44 -45
- package/dist/chunk-VSH7ECQL.cjs.map +1 -0
- package/dist/{chunk-NRTP7WCW.cjs → chunk-W5KB3DNT.cjs} +315 -29
- package/dist/chunk-W5KB3DNT.cjs.map +1 -0
- package/dist/{chunk-Z7QQZ53L.js → chunk-XS6U2ARZ.js} +70 -32
- package/dist/chunk-XS6U2ARZ.js.map +1 -0
- package/dist/index-BVNeSCWC.d.ts +548 -0
- package/dist/index-BlOLlwOi.d.cts +548 -0
- package/dist/index.cjs +129 -198
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +175 -18
- package/dist/index.d.ts +175 -18
- package/dist/index.js +34 -103
- package/dist/index.js.map +1 -1
- package/dist/schemas.cjs +3 -94
- package/dist/schemas.cjs.map +1 -1
- package/dist/schemas.d.cts +2 -3
- package/dist/schemas.d.ts +2 -3
- package/dist/schemas.js +6 -97
- 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 +4 -4
- package/vectors/README.md +32 -2
- package/vectors/scoring.json +1 -498
- package/vectors/validation.json +6742 -0
- package/vectors/validation.mjs +195 -0
- package/dist/chunk-2CV6NU32.cjs.map +0 -1
- package/dist/chunk-D3GP5MET.js.map +0 -1
- package/dist/chunk-D4TOPSHV.cjs.map +0 -1
- package/dist/chunk-IHOEP4EB.js.map +0 -1
- package/dist/chunk-NRTP7WCW.cjs.map +0 -1
- package/dist/chunk-Q7MV3IXJ.js.map +0 -1
- package/dist/chunk-WQVZPIN7.cjs.map +0 -1
- package/dist/chunk-Z7QQZ53L.js.map +0 -1
- package/dist/index-BuD8Hc8o.d.cts +0 -2303
- package/dist/index-DnJ_PI4d.d.ts +0 -2303
- /package/dist/{chunk-X5DAXBJI.js.map → chunk-SJVRUPJT.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -4,20 +4,15 @@ import {
|
|
|
4
4
|
validateXAPIStatement,
|
|
5
5
|
xAPIBuilder,
|
|
6
6
|
xapiDefinitionFor
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SJVRUPJT.js";
|
|
8
8
|
import {
|
|
9
9
|
INTERACTIVE_VIDEO_ITEM_TYPES,
|
|
10
10
|
ItemGroupSchema,
|
|
11
|
-
MediaTimelineSchema,
|
|
12
11
|
RedactedItemGroupSchema,
|
|
13
|
-
RedactedStimulusSchema,
|
|
14
|
-
StimulusSchema,
|
|
15
12
|
TIMELINE_MAX_CHAPTERS,
|
|
16
13
|
TIMELINE_MAX_ITEMS,
|
|
17
14
|
TIMELINE_MAX_QUIZZES,
|
|
18
15
|
TIMELINE_MAX_TITLE_LENGTH,
|
|
19
|
-
TimelineChapterSchema,
|
|
20
|
-
TimelineCueSchema,
|
|
21
16
|
dictationJsonSchema,
|
|
22
17
|
fillInTheBlanksJsonSchema,
|
|
23
18
|
gapSelectJsonSchema,
|
|
@@ -29,23 +24,29 @@ import {
|
|
|
29
24
|
stimulusJsonSchema,
|
|
30
25
|
validateActivity,
|
|
31
26
|
validateItemGroup,
|
|
27
|
+
validateMedia,
|
|
28
|
+
validateOptionMedia,
|
|
32
29
|
writtenResponseJsonSchema
|
|
33
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-XS6U2ARZ.js";
|
|
34
31
|
import {
|
|
35
32
|
AI_EXPLANATION_TYPES,
|
|
36
33
|
AI_HINT_TYPES,
|
|
37
34
|
AI_TEXT_MAX_LENGTH,
|
|
35
|
+
AI_WRITING_MAX_CORRECTIONS,
|
|
36
|
+
AI_WRITING_MAX_FIELD_LENGTH,
|
|
38
37
|
aiAllowedByContent,
|
|
39
38
|
aiExplanationRequest,
|
|
40
39
|
aiGradeOf,
|
|
41
40
|
aiHintRequest,
|
|
42
41
|
aiSupports,
|
|
42
|
+
aiWritingFeedbackRequest,
|
|
43
43
|
buildAiFacts,
|
|
44
44
|
checkAiExplanation,
|
|
45
45
|
checkAiHint,
|
|
46
|
+
checkAiWritingFeedback,
|
|
46
47
|
hintRevealsAnswer,
|
|
47
48
|
readAiTextResult
|
|
48
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-RCZCP5OE.js";
|
|
49
50
|
import {
|
|
50
51
|
DEFAULT_ITEM_SCORING_POLICY,
|
|
51
52
|
DEFAULT_PASS_THRESHOLD,
|
|
@@ -70,11 +71,9 @@ import {
|
|
|
70
71
|
scoreTries,
|
|
71
72
|
validateItemScoringPolicy,
|
|
72
73
|
validateSpeechAssessment
|
|
73
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-IARLJ5MW.js";
|
|
74
75
|
import {
|
|
75
76
|
ActivitySchemaError,
|
|
76
|
-
AiPermissionsSchema,
|
|
77
|
-
BlankConfigSchema,
|
|
78
77
|
DICTATION_MAX_ACCEPTED_TRANSCRIPTS,
|
|
79
78
|
DICTATION_MAX_EQUIVALENCES,
|
|
80
79
|
DICTATION_MAX_EQUIVALENCE_LENGTH,
|
|
@@ -82,53 +81,15 @@ import {
|
|
|
82
81
|
DICTATION_MAX_TRANSCRIPT_LENGTH,
|
|
83
82
|
DRAFT_ISSUE_SEVERITY,
|
|
84
83
|
DeferredScoringError,
|
|
85
|
-
DictationDataSchema,
|
|
86
|
-
DictationEquivalenceSchema,
|
|
87
|
-
DictationSlowMediaSchema,
|
|
88
|
-
DictationToleranceSchema,
|
|
89
|
-
FeedbackSchema,
|
|
90
|
-
FillInTheBlanksDataSchema,
|
|
91
84
|
GROUP_CAPTIONS_REVEAL_DICTATION,
|
|
92
|
-
GapSelectBankSchema,
|
|
93
|
-
GapSelectChoiceSchema,
|
|
94
|
-
GapSelectDataSchema,
|
|
95
|
-
GapSelectGapSchema,
|
|
96
85
|
MEDIA_FIELD_POLICY,
|
|
97
|
-
MediaPlaybackSchema,
|
|
98
|
-
MediaSchema,
|
|
99
|
-
MediaTrackSchema,
|
|
100
|
-
MediaUrlSchema,
|
|
101
|
-
MultipleChoiceDataSchema,
|
|
102
|
-
MultipleChoiceOptionMediaSchema,
|
|
103
|
-
MultipleChoiceOptionSchema,
|
|
104
|
-
NativeControlHintSchema,
|
|
105
86
|
READ_ALOUD_MAX_DIMENSION_WEIGHT,
|
|
106
87
|
READ_ALOUD_MAX_REFERENCE_LENGTH,
|
|
107
88
|
READ_ALOUD_MAX_SECONDS,
|
|
108
89
|
READ_ALOUD_MAX_TAKES,
|
|
109
|
-
ReadAloudDataSchema,
|
|
110
|
-
ReadAloudSlowMediaSchema,
|
|
111
|
-
RedactedBlankConfigSchema,
|
|
112
|
-
RedactedDictationDataSchema,
|
|
113
|
-
RedactedDictationSlowMediaSchema,
|
|
114
|
-
RedactedFillInTheBlanksDataSchema,
|
|
115
|
-
RedactedGapSelectBankSchema,
|
|
116
|
-
RedactedGapSelectChoiceSchema,
|
|
117
|
-
RedactedGapSelectDataSchema,
|
|
118
|
-
RedactedGapSelectGapSchema,
|
|
119
|
-
RedactedMediaSchema,
|
|
120
|
-
RedactedMultipleChoiceDataSchema,
|
|
121
|
-
RedactedMultipleChoiceOptionMediaSchema,
|
|
122
|
-
RedactedMultipleChoiceOptionSchema,
|
|
123
|
-
RedactedReadAloudDataSchema,
|
|
124
90
|
RedactedScoringError,
|
|
125
|
-
RedactedWrittenResponseDataSchema,
|
|
126
91
|
SPEECH_ASSESSMENT_MAX_WORDS,
|
|
127
|
-
TextMatchPolicySchema,
|
|
128
92
|
UnknownActivityTypeError,
|
|
129
|
-
WrittenResponseDataSchema,
|
|
130
|
-
WrittenResponseRubricCriterionSchema,
|
|
131
|
-
WrittenResponseRubricSchema,
|
|
132
93
|
alignDictation,
|
|
133
94
|
checkMedia,
|
|
134
95
|
countWords,
|
|
@@ -151,12 +112,13 @@ import {
|
|
|
151
112
|
multipleChoiceType,
|
|
152
113
|
pathKey,
|
|
153
114
|
readAloudType,
|
|
115
|
+
readSchema,
|
|
154
116
|
refusesEmpty,
|
|
155
117
|
registerActivityType,
|
|
156
118
|
registeredActivityTypes,
|
|
157
119
|
withValidationScope,
|
|
158
120
|
writtenResponseType
|
|
159
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-FBKTION6.js";
|
|
160
122
|
|
|
161
123
|
// src/content-hash.ts
|
|
162
124
|
function canonicalJson(value, seen = /* @__PURE__ */ new Set()) {
|
|
@@ -1317,11 +1279,13 @@ function validateDraftInScope(type, draft) {
|
|
|
1317
1279
|
}
|
|
1318
1280
|
const reported = isRecord(draft) && descriptor.authoring?.checkDraft !== void 0 ? descriptor.authoring.checkDraft(draft).map(normalise) : [];
|
|
1319
1281
|
const issues = [...reported];
|
|
1320
|
-
const parsed = descriptor.schema
|
|
1282
|
+
const parsed = readSchema(descriptor.schema, draft, `Activity type "${descriptor.type}"`, {
|
|
1283
|
+
reportInput: true
|
|
1284
|
+
});
|
|
1321
1285
|
if (!parsed.success) {
|
|
1322
1286
|
const covered = coveredPathsOf(reported);
|
|
1323
1287
|
const reportedEmpty = /* @__PURE__ */ new Set();
|
|
1324
|
-
for (const schemaIssue of parsed.
|
|
1288
|
+
for (const schemaIssue of parsed.issues) {
|
|
1325
1289
|
const path = schemaIssue.path.map(String);
|
|
1326
1290
|
if (covered.has(pathKey(path))) {
|
|
1327
1291
|
continue;
|
|
@@ -1459,11 +1423,15 @@ function redact(data, options = {}) {
|
|
|
1459
1423
|
const projected = redactValue(data, effectivePolicy, reveal);
|
|
1460
1424
|
const result = { ...projected, redacted: true };
|
|
1461
1425
|
if (reveal === "none" && descriptor.redactedSchema !== void 0) {
|
|
1462
|
-
const parsed =
|
|
1426
|
+
const parsed = readSchema(
|
|
1427
|
+
descriptor.redactedSchema,
|
|
1428
|
+
result,
|
|
1429
|
+
`Activity type "${descriptor.type}"`
|
|
1430
|
+
);
|
|
1463
1431
|
if (!parsed.success) {
|
|
1464
1432
|
throw new ActivitySchemaError(
|
|
1465
1433
|
descriptor.type,
|
|
1466
|
-
parsed.
|
|
1434
|
+
parsed.issues.map((issue2) => ({
|
|
1467
1435
|
path: issue2.path.map(String),
|
|
1468
1436
|
message: issue2.message,
|
|
1469
1437
|
code: issue2.code
|
|
@@ -1503,11 +1471,15 @@ function assertRedacted(data) {
|
|
|
1503
1471
|
}
|
|
1504
1472
|
]);
|
|
1505
1473
|
}
|
|
1506
|
-
const parsed =
|
|
1474
|
+
const parsed = readSchema(
|
|
1475
|
+
descriptor.redactedSchema,
|
|
1476
|
+
candidate,
|
|
1477
|
+
`Activity type "${descriptor.type}"`
|
|
1478
|
+
);
|
|
1507
1479
|
if (!parsed.success) {
|
|
1508
1480
|
throw new ActivitySchemaError(
|
|
1509
1481
|
descriptor.type,
|
|
1510
|
-
parsed.
|
|
1482
|
+
parsed.issues.map((issue2) => ({
|
|
1511
1483
|
path: issue2.path.map(String),
|
|
1512
1484
|
message: issue2.message,
|
|
1513
1485
|
code: issue2.code
|
|
@@ -1662,9 +1634,9 @@ export {
|
|
|
1662
1634
|
AI_EXPLANATION_TYPES,
|
|
1663
1635
|
AI_HINT_TYPES,
|
|
1664
1636
|
AI_TEXT_MAX_LENGTH,
|
|
1637
|
+
AI_WRITING_MAX_CORRECTIONS,
|
|
1638
|
+
AI_WRITING_MAX_FIELD_LENGTH,
|
|
1665
1639
|
ActivitySchemaError,
|
|
1666
|
-
AiPermissionsSchema,
|
|
1667
|
-
BlankConfigSchema,
|
|
1668
1640
|
DEFAULT_ITEM_SCORING_POLICY,
|
|
1669
1641
|
DEFAULT_PASS_THRESHOLD,
|
|
1670
1642
|
DICTATION_MAX_ACCEPTED_TRANSCRIPTS,
|
|
@@ -1673,65 +1645,20 @@ export {
|
|
|
1673
1645
|
DICTATION_MAX_TEXT_LENGTH,
|
|
1674
1646
|
DICTATION_MAX_TRANSCRIPT_LENGTH,
|
|
1675
1647
|
DeferredScoringError,
|
|
1676
|
-
DictationDataSchema,
|
|
1677
|
-
DictationEquivalenceSchema,
|
|
1678
|
-
DictationSlowMediaSchema,
|
|
1679
|
-
DictationToleranceSchema,
|
|
1680
|
-
FeedbackSchema,
|
|
1681
|
-
FillInTheBlanksDataSchema,
|
|
1682
|
-
GapSelectBankSchema,
|
|
1683
|
-
GapSelectChoiceSchema,
|
|
1684
|
-
GapSelectDataSchema,
|
|
1685
|
-
GapSelectGapSchema,
|
|
1686
1648
|
INTERACTIVE_VIDEO_ITEM_TYPES,
|
|
1687
1649
|
ITEM_SCORING_MAX_RETRIES,
|
|
1688
|
-
ItemGroupSchema,
|
|
1689
|
-
MediaPlaybackSchema,
|
|
1690
|
-
MediaSchema,
|
|
1691
|
-
MediaTimelineSchema,
|
|
1692
|
-
MediaTrackSchema,
|
|
1693
|
-
MediaUrlSchema,
|
|
1694
|
-
MultipleChoiceDataSchema,
|
|
1695
|
-
MultipleChoiceOptionMediaSchema,
|
|
1696
|
-
MultipleChoiceOptionSchema,
|
|
1697
|
-
NativeControlHintSchema,
|
|
1698
1650
|
OPEN_DELIVERY_POLICY,
|
|
1699
1651
|
READ_ALOUD_MAX_DIMENSION_WEIGHT,
|
|
1700
1652
|
READ_ALOUD_MAX_REFERENCE_LENGTH,
|
|
1701
1653
|
READ_ALOUD_MAX_SECONDS,
|
|
1702
1654
|
READ_ALOUD_MAX_TAKES,
|
|
1703
|
-
ReadAloudDataSchema,
|
|
1704
|
-
ReadAloudSlowMediaSchema,
|
|
1705
|
-
RedactedBlankConfigSchema,
|
|
1706
|
-
RedactedDictationDataSchema,
|
|
1707
|
-
RedactedDictationSlowMediaSchema,
|
|
1708
|
-
RedactedFillInTheBlanksDataSchema,
|
|
1709
|
-
RedactedGapSelectBankSchema,
|
|
1710
|
-
RedactedGapSelectChoiceSchema,
|
|
1711
|
-
RedactedGapSelectDataSchema,
|
|
1712
|
-
RedactedGapSelectGapSchema,
|
|
1713
|
-
RedactedItemGroupSchema,
|
|
1714
|
-
RedactedMediaSchema,
|
|
1715
|
-
RedactedMultipleChoiceDataSchema,
|
|
1716
|
-
RedactedMultipleChoiceOptionMediaSchema,
|
|
1717
|
-
RedactedMultipleChoiceOptionSchema,
|
|
1718
|
-
RedactedReadAloudDataSchema,
|
|
1719
1655
|
RedactedScoringError,
|
|
1720
|
-
RedactedStimulusSchema,
|
|
1721
|
-
RedactedWrittenResponseDataSchema,
|
|
1722
1656
|
SPEECH_ASSESSMENT_MAX_WORDS,
|
|
1723
|
-
StimulusSchema,
|
|
1724
1657
|
TIMELINE_MAX_CHAPTERS,
|
|
1725
1658
|
TIMELINE_MAX_ITEMS,
|
|
1726
1659
|
TIMELINE_MAX_QUIZZES,
|
|
1727
1660
|
TIMELINE_MAX_TITLE_LENGTH,
|
|
1728
|
-
TextMatchPolicySchema,
|
|
1729
|
-
TimelineChapterSchema,
|
|
1730
|
-
TimelineCueSchema,
|
|
1731
1661
|
UnknownActivityTypeError,
|
|
1732
|
-
WrittenResponseDataSchema,
|
|
1733
|
-
WrittenResponseRubricCriterionSchema,
|
|
1734
|
-
WrittenResponseRubricSchema,
|
|
1735
1662
|
XAPIVerb,
|
|
1736
1663
|
XAPI_VERB_DISPLAY,
|
|
1737
1664
|
aiAllowedByContent,
|
|
@@ -1739,6 +1666,7 @@ export {
|
|
|
1739
1666
|
aiGradeOf,
|
|
1740
1667
|
aiHintRequest,
|
|
1741
1668
|
aiSupports,
|
|
1669
|
+
aiWritingFeedbackRequest,
|
|
1742
1670
|
alignDictation,
|
|
1743
1671
|
alignReadAloud,
|
|
1744
1672
|
assertRedacted,
|
|
@@ -1747,6 +1675,7 @@ export {
|
|
|
1747
1675
|
canonicalJson,
|
|
1748
1676
|
checkAiExplanation,
|
|
1749
1677
|
checkAiHint,
|
|
1678
|
+
checkAiWritingFeedback,
|
|
1750
1679
|
classifyBand,
|
|
1751
1680
|
combineDeliveryPolicies,
|
|
1752
1681
|
composeAssessmentScore,
|
|
@@ -1821,6 +1750,8 @@ export {
|
|
|
1821
1750
|
validateItemGroup,
|
|
1822
1751
|
validateItemGroupDraft,
|
|
1823
1752
|
validateItemScoringPolicy,
|
|
1753
|
+
validateMedia,
|
|
1754
|
+
validateOptionMedia,
|
|
1824
1755
|
validateSpeechAssessment,
|
|
1825
1756
|
validateXAPIStatement,
|
|
1826
1757
|
verifyAttemptPlan,
|