@lessonkit/lxpack 0.9.3 → 1.0.1
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/README.md +16 -15
- package/dist/bridge.cjs +81 -8
- package/dist/bridge.d.cts +8 -2
- package/dist/bridge.d.ts +8 -2
- package/dist/bridge.js +65 -3
- package/dist/chunk-DYQI222N.js +41 -0
- package/dist/index.cjs +626 -141
- package/dist/index.d.cts +92 -7
- package/dist/index.d.ts +92 -7
- package/dist/index.js +609 -142
- package/lessonkit-manifest.v1.json +100 -0
- package/package.json +12 -10
- package/dist/chunk-PSUSESH3.js +0 -32
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://lessonkit.dev/schemas/lessonkit-manifest.v1.json",
|
|
4
|
+
"title": "LessonkitManifestV1",
|
|
5
|
+
"description": "Root lessonkit.json project manifest (schemaVersion 1)",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["schemaVersion", "name", "course", "paths"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"schemaVersion": { "const": 1 },
|
|
11
|
+
"name": { "type": "string", "minLength": 1 },
|
|
12
|
+
"course": { "$ref": "#/$defs/LessonkitCourseDescriptor" },
|
|
13
|
+
"paths": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"required": ["spaDistDir", "lxpackOutDir", "outputBaseDir"],
|
|
17
|
+
"properties": {
|
|
18
|
+
"spaDistDir": { "type": "string", "minLength": 1 },
|
|
19
|
+
"lxpackOutDir": { "type": "string", "minLength": 1 },
|
|
20
|
+
"outputBaseDir": { "type": "string", "minLength": 1 }
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"$defs": {
|
|
25
|
+
"LessonkitId": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"pattern": "^[a-zA-Z][a-zA-Z0-9_-]{0,63}$",
|
|
28
|
+
"maxLength": 64
|
|
29
|
+
},
|
|
30
|
+
"LessonkitCourseDescriptor": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"required": ["courseId", "title", "layout", "lessons"],
|
|
33
|
+
"properties": {
|
|
34
|
+
"courseId": { "$ref": "#/$defs/LessonkitId" },
|
|
35
|
+
"title": { "type": "string", "minLength": 1 },
|
|
36
|
+
"version": { "type": "string" },
|
|
37
|
+
"layout": { "enum": ["single-spa", "per-lesson-spa"] },
|
|
38
|
+
"lessons": {
|
|
39
|
+
"type": "array",
|
|
40
|
+
"minItems": 1,
|
|
41
|
+
"items": { "$ref": "#/$defs/LessonDescriptor" }
|
|
42
|
+
},
|
|
43
|
+
"assessments": {
|
|
44
|
+
"type": "array",
|
|
45
|
+
"items": { "$ref": "#/$defs/AssessmentDescriptor" }
|
|
46
|
+
},
|
|
47
|
+
"theme": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"properties": {
|
|
50
|
+
"preset": { "enum": ["default", "light", "dark", "brand"] },
|
|
51
|
+
"theme": { "type": "object" }
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"tracking": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"properties": {
|
|
57
|
+
"completion": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"properties": {
|
|
60
|
+
"threshold": { "type": "number", "minimum": 0, "maximum": 1 }
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"xapi": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"properties": {
|
|
66
|
+
"activityIri": { "type": "string", "minLength": 1 }
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"spaDistDir": { "type": "string", "minLength": 1 },
|
|
72
|
+
"spaLessonId": { "$ref": "#/$defs/LessonkitId" }
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"LessonDescriptor": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"required": ["id", "title"],
|
|
78
|
+
"properties": {
|
|
79
|
+
"id": { "$ref": "#/$defs/LessonkitId" },
|
|
80
|
+
"title": { "type": "string", "minLength": 1 },
|
|
81
|
+
"spaPath": { "type": "string", "minLength": 1 }
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"AssessmentDescriptor": {
|
|
85
|
+
"type": "object",
|
|
86
|
+
"required": ["checkId", "question", "choices", "answer"],
|
|
87
|
+
"properties": {
|
|
88
|
+
"checkId": { "$ref": "#/$defs/LessonkitId" },
|
|
89
|
+
"question": { "type": "string", "minLength": 1 },
|
|
90
|
+
"choices": {
|
|
91
|
+
"type": "array",
|
|
92
|
+
"minItems": 1,
|
|
93
|
+
"items": { "type": "string", "minLength": 1 }
|
|
94
|
+
},
|
|
95
|
+
"answer": { "type": "string", "minLength": 1 },
|
|
96
|
+
"passingScore": { "type": "number", "exclusiveMinimum": 0 }
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lessonkit/lxpack",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "LXPack export adapter for LessonKit courses (SCORM, standalone, xAPI, cmi5).",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"elearning"
|
|
23
23
|
],
|
|
24
24
|
"engines": {
|
|
25
|
-
"node": ">=
|
|
25
|
+
"node": ">=18"
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
28
|
"main": "./dist/index.cjs",
|
|
@@ -38,10 +38,12 @@
|
|
|
38
38
|
"types": "./dist/bridge.d.ts",
|
|
39
39
|
"import": "./dist/bridge.js",
|
|
40
40
|
"require": "./dist/bridge.cjs"
|
|
41
|
-
}
|
|
41
|
+
},
|
|
42
|
+
"./lessonkit-manifest.v1.json": "./lessonkit-manifest.v1.json"
|
|
42
43
|
},
|
|
43
44
|
"files": [
|
|
44
|
-
"dist"
|
|
45
|
+
"dist",
|
|
46
|
+
"lessonkit-manifest.v1.json"
|
|
45
47
|
],
|
|
46
48
|
"scripts": {
|
|
47
49
|
"build": "tsup src/index.ts src/bridge.ts --format esm,cjs --dts",
|
|
@@ -53,12 +55,12 @@
|
|
|
53
55
|
"lint": "echo \"(no lint configured yet)\""
|
|
54
56
|
},
|
|
55
57
|
"dependencies": {
|
|
56
|
-
"@lessonkit/core": "0.
|
|
57
|
-
"@lessonkit/themes": "0.
|
|
58
|
-
"@lxpack/api": "^0.6.
|
|
59
|
-
"@lxpack/spa-bridge": "^0.6.
|
|
60
|
-
"@lxpack/tracking-schema": "^0.6.
|
|
61
|
-
"@lxpack/validators": "^0.6.
|
|
58
|
+
"@lessonkit/core": "1.0.1",
|
|
59
|
+
"@lessonkit/themes": "1.0.1",
|
|
60
|
+
"@lxpack/api": "^0.6.2",
|
|
61
|
+
"@lxpack/spa-bridge": "^0.6.2",
|
|
62
|
+
"@lxpack/tracking-schema": "^0.6.2",
|
|
63
|
+
"@lxpack/validators": "^0.6.2"
|
|
62
64
|
},
|
|
63
65
|
"devDependencies": {
|
|
64
66
|
"@types/node": "^22.13.10",
|
package/dist/chunk-PSUSESH3.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// src/telemetry.ts
|
|
2
|
-
import { LESSONKIT_TELEMETRY_EVENTS } from "@lxpack/tracking-schema";
|
|
3
|
-
var SUPPORTED = new Set(LESSONKIT_TELEMETRY_EVENTS);
|
|
4
|
-
function telemetryEventToLessonkit(event) {
|
|
5
|
-
if (!SUPPORTED.has(event.name)) {
|
|
6
|
-
return null;
|
|
7
|
-
}
|
|
8
|
-
const name = event.name;
|
|
9
|
-
const mapped = {
|
|
10
|
-
name,
|
|
11
|
-
lessonId: event.lessonId
|
|
12
|
-
};
|
|
13
|
-
if (name === "quiz_completed" || name === "quiz_answered") {
|
|
14
|
-
const data = event.data;
|
|
15
|
-
mapped.assessmentId = data?.checkId;
|
|
16
|
-
if (data && "score" in data) {
|
|
17
|
-
mapped.score = data.score;
|
|
18
|
-
mapped.maxScore = data.maxScore;
|
|
19
|
-
mapped.passingScore = data.passingScore;
|
|
20
|
-
}
|
|
21
|
-
if (data) {
|
|
22
|
-
mapped.data = data;
|
|
23
|
-
}
|
|
24
|
-
} else if (name === "interaction" && event.data) {
|
|
25
|
-
mapped.data = event.data;
|
|
26
|
-
}
|
|
27
|
-
return mapped;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export {
|
|
31
|
-
telemetryEventToLessonkit
|
|
32
|
-
};
|