@learnosity/lib-qti-converter 0.10.4

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.
@@ -0,0 +1,338 @@
1
+ # Learnosity Bundle Format
2
+
3
+ This document describes the expected folder structure and file formats used as input for the `learnosity-to-qti-package` CLI command and the `convertLearnosityToQtiPackage()` library function.
4
+
5
+ ## Overview
6
+
7
+ A Learnosity bundle is a directory containing content exported from the [Learnosity Data API](https://help.learnosity.com/hc/en-us/articles/26076363707421-Local-device-assessment-Endpoints-Data-API). The converter expects this specific structure to successfully convert the content to QTI format.
8
+
9
+ ## Directory Structure
10
+
11
+ ```
12
+ bundle/
13
+ ├── manifest.json # Required - Bundle manifest with references
14
+ ├── activities/ # Optional - Activity JSON files
15
+ │ └── <hash>.json
16
+ ├── items/ # Required - Item JSON files (must have content)
17
+ │ └── <hash>.json
18
+ └── assets/ # Optional - Media assets (images, audio, etc.)
19
+ └── <hash>_<original_filename>
20
+ ```
21
+
22
+ ### Required Components
23
+
24
+ | Component | Description |
25
+ | --------------- | ---------------------------------------- |
26
+ | `manifest.json` | Bundle manifest file (required) |
27
+ | `items/` folder | Must contain at least one item JSON file |
28
+
29
+ ### Optional Components
30
+
31
+ | Component | Description |
32
+ | -------------------- | ---------------------------------------------- |
33
+ | `activities/` folder | Can be empty or contain activity definitions |
34
+ | `assets/` folder | Can be empty or contain referenced media files |
35
+
36
+ ---
37
+
38
+ ## manifest.json
39
+
40
+ The manifest file defines the structure of the bundle and maps activities to their items.
41
+
42
+ ### Structure
43
+
44
+ ```json
45
+ {
46
+ "diagnostics": {
47
+ "version": "0.8.0",
48
+ "timestamp": "2026-03-10T04:53:50.368Z",
49
+ "configuration": {
50
+ "organisationId": 12345,
51
+ "mediaVault": false,
52
+ "customAssetUrl": "https://cdn.example.com/assets",
53
+ "itemReferenceSource": "sourceFilename",
54
+ "itemFilenameSource": "qti"
55
+ }
56
+ },
57
+ "items": [
58
+ {
59
+ "id": "item_001",
60
+ "reference": "item_001",
61
+ "organisation_id": 12345
62
+ },
63
+ {
64
+ "id": "item_002",
65
+ "reference": "item_002",
66
+ "organisation_id": 12345
67
+ }
68
+ ],
69
+ "activities": {
70
+ "activity_001": {
71
+ "items": [
72
+ {
73
+ "id": "item_001",
74
+ "reference": "item_001",
75
+ "organisation_id": 12345
76
+ },
77
+ {
78
+ "id": "item_002",
79
+ "reference": "item_002",
80
+ "organisation_id": 12345
81
+ }
82
+ ],
83
+ "intro": {
84
+ "id": "intro_item",
85
+ "reference": "intro_item",
86
+ "organisation_id": 12345
87
+ }
88
+ }
89
+ },
90
+ "assets": {
91
+ "activities": {
92
+ "<activity_reference>": [
93
+ {
94
+ "url": "<original_cdn_url>",
95
+ "replacement": "<local_path>"
96
+ }
97
+ ]
98
+ },
99
+ "items": {
100
+ "<item_reference>": {
101
+ "questions": {
102
+ "<question_uuid>": [
103
+ {
104
+ "url": "<original_cdn_url>",
105
+ "replacement": "<local_path>"
106
+ }
107
+ ]
108
+ },
109
+ "features": {
110
+ "<feature_uuid>": [
111
+ {
112
+ "url": "<original_cdn_url>",
113
+ "replacement": "<local_path>"
114
+ }
115
+ ]
116
+ }
117
+ }
118
+ }
119
+ }
120
+ }
121
+ ```
122
+
123
+ ## activities/ Folder
124
+
125
+ Contains JSON files for each activity. File names are MD5 hashes of the activity reference.
126
+
127
+ ### Activity JSON Structure
128
+
129
+ ```json
130
+ {
131
+ "reference": "ACTIVITY_REFERENCE",
132
+ "data": {
133
+ "reference": "Activity Title",
134
+ "description": "Activity description",
135
+ "status": "published",
136
+ "rendering_type": "assess",
137
+ "items": [
138
+ {
139
+ "id": "<org_id>::<item_reference>",
140
+ "reference": "<item_reference>",
141
+ "organisation_id": <number>
142
+ }
143
+ ],
144
+ "config": {
145
+ "regions": { ... },
146
+ "navigation": {
147
+ "show_intro": true,
148
+ "intro_item": { ... },
149
+ "show_title": true,
150
+ "show_outro": true,
151
+ "show_prev": true,
152
+ "show_next": true
153
+ },
154
+ "time": { ... },
155
+ "configuration": {
156
+ "stylesheet": "<path_to_css>"
157
+ }
158
+ }
159
+ }
160
+ }
161
+ ```
162
+
163
+ ---
164
+
165
+ ## items/ Folder
166
+
167
+ Contains JSON files for each item. File names are MD5 hashes of the item reference.
168
+
169
+ **This folder must contain at least one file.**
170
+
171
+ ### Item JSON Structure
172
+
173
+ ```json
174
+ {
175
+ "reference": "<item_reference>",
176
+ "content": "<html_layout_with_placeholders>",
177
+ "workflow": null,
178
+ "metadata": {
179
+ "acknowledgements": null,
180
+ "scoring_type": "per-question"
181
+ },
182
+ "tags": {
183
+ "<tag_type>": ["<tag_value>"]
184
+ },
185
+ "questions": [
186
+ {
187
+ "reference": "<question_uuid>",
188
+ "data": {
189
+ "type": "mcq",
190
+ "stimulus": "<html_content>",
191
+ "options": [
192
+ { "label": "<html>", "value": "0" },
193
+ { "label": "<html>", "value": "1" }
194
+ ],
195
+ "validation": {
196
+ "scoring_type": "exactMatch",
197
+ "valid_response": {
198
+ "score": 1,
199
+ "value": ["1"]
200
+ }
201
+ }
202
+ }
203
+ }
204
+ ],
205
+ "features": [
206
+ {
207
+ "reference": "<feature_uuid>",
208
+ "data": {
209
+ "type": "sharedpassage",
210
+ "content": "<html_content>"
211
+ }
212
+ }
213
+ ],
214
+ "source": {
215
+ "id": "<org_id>::<reference>",
216
+ "reference": "<reference>",
217
+ "organisation_id": <number>
218
+ },
219
+ "id": "<org_id>::<reference>"
220
+ }
221
+ ```
222
+
223
+ ### Item Fields
224
+
225
+ | Field | Type | Required | Description |
226
+ | ----------- | -------- | -------- | ------------------------------------------------- |
227
+ | `reference` | `string` | Yes | Unique identifier for the item |
228
+ | `content` | `string` | Yes | HTML layout with question/feature placeholders |
229
+ | `questions` | `array` | No | Array of question objects |
230
+ | `features` | `array` | No | Array of feature objects (passages, videos, etc.) |
231
+ | `tags` | `object` | No | Metadata tags organized by type |
232
+ | `metadata` | `object` | No | Additional item metadata |
233
+ | `source` | `object` | No | Source information for round-trip conversions |
234
+
235
+ ### Question Types
236
+
237
+ Common question types that can appear in `questions[].data.type`:
238
+
239
+ | Type | Description |
240
+ | ----------------------- | ---------------------------- |
241
+ | `mcq` | Multiple choice question |
242
+ | `choicematrix` | Choice matrix / match table |
243
+ | `clozetext` | Fill in the blank (text) |
244
+ | `clozedropdown` | Fill in the blank (dropdown) |
245
+ | `orderlist` | Ordering / sequencing |
246
+ | `hotspot` | Image hotspot selection |
247
+ | `imageclozeassociation` | Drag and drop onto image |
248
+ | `longtextV2` | Extended text response |
249
+ | `plaintext` | Short text response |
250
+
251
+ ### Feature Types
252
+
253
+ Common feature types in `features[].data.type`:
254
+
255
+ | Type | Description |
256
+ | --------------- | ---------------------- |
257
+ | `sharedpassage` | Shared reading passage |
258
+ | `audioplayer` | Audio content |
259
+ | `videoplayer` | Video content |
260
+
261
+ ---
262
+
263
+ ## assets/ Folder
264
+
265
+ Contains binary media files referenced by items and activities. File names follow the pattern:
266
+
267
+ ```
268
+ <md5_hash>_<original_filename>
269
+ ```
270
+
271
+ ### Asset Types
272
+
273
+ | Extension | Description |
274
+ | ------------------------------ | -------------------------------------- |
275
+ | `.png`, `.jpg`, `.gif`, `.svg` | Images |
276
+ | `.mp3`, `.wav`, `.ogg` | Audio files |
277
+ | `.mp4`, `.webm` | Video files |
278
+ | `.css` | Stylesheets |
279
+ | (none) | Learnosity asset IDs (e.g., `m157700`) |
280
+
281
+ ### Asset References in Content
282
+
283
+ Assets are referenced in HTML content using local paths:
284
+
285
+ ```html
286
+ <!-- Image -->
287
+ <img src="/vendor/learnosity/itembank/assets/hash_filename.png" />
288
+
289
+ <!-- Audio player -->
290
+ <span
291
+ class="learnosity-feature"
292
+ data-type="audioplayer"
293
+ data-src="/vendor/learnosity/itembank/assets/hash_m157700"
294
+ >
295
+ </span>
296
+ ```
297
+
298
+ ---
299
+
300
+ ## Usage Example
301
+
302
+ ### CLI
303
+
304
+ ```bash
305
+ lcon learnosity-to-qti-package \
306
+ --in ./path/to/bundle \
307
+ --out output-package.zip \
308
+ --activity ACTIVITY_REFERENCE
309
+ ```
310
+
311
+ If no `--activity` is specified, all activities in the bundle are converted.
312
+
313
+ ### Library
314
+
315
+ ```typescript
316
+ import { convertLearnosityToQtiPackage } from '@learnosity/lib-qti-converter';
317
+
318
+ const result = convertLearnosityToQtiPackage({
319
+ inputPath: './path/to/bundle',
320
+ outputPath: 'output-package.zip',
321
+ activityRefs: ['ACTIVITY_REFERENCE'],
322
+ qtiVersion: '2.2',
323
+ });
324
+
325
+ console.log(result.diagnostics);
326
+ ```
327
+
328
+ If `activityRefs` is omitted, all activities in the bundle are converted. Omit `outputPath` to convert in-memory only.
329
+
330
+ ---
331
+
332
+ ## See Also
333
+
334
+ - [Getting Started](https://learnosity.github.io/lib-qti-converter/#/GETTING_STARTED) - Installation and basic usage
335
+ - [Diagnostics](https://learnosity.github.io/lib-qti-converter/#/DIAGNOSTICS) - Understanding diagnostics metadata and conversion messages
336
+ - [Learnosity Sections](https://learnosity.github.io/lib-qti-converter/#/LEARNOSITY_SECTIONS) - How activity sections map to QTI assessmentTest structure
337
+ - [Examples](https://learnosity.github.io/lib-qti-converter/#/EXAMPLES) - More conversion examples
338
+ - [Supported Interactions](https://learnosity.github.io/lib-qti-converter/#/SUPPORTED_INTERACTIONS) - Question type mappings