@pie-qti/qti-common 0.1.27 → 1.0.0-beta.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.
Files changed (62) hide show
  1. package/README.md +31 -86
  2. package/package.json +2 -3
  3. package/dist/accessibility/apip.d.ts +0 -66
  4. package/dist/accessibility/apip.js +0 -596
  5. package/dist/accessibility/apip.js.map +0 -1
  6. package/dist/accessibility/catalog.d.ts +0 -51
  7. package/dist/accessibility/catalog.js +0 -41
  8. package/dist/accessibility/catalog.js.map +0 -1
  9. package/dist/accessibility/index.d.ts +0 -2
  10. package/dist/accessibility/index.js +0 -3
  11. package/dist/accessibility/index.js.map +0 -1
  12. package/dist/dom/assignProps.d.ts +0 -4
  13. package/dist/dom/assignProps.js +0 -9
  14. package/dist/dom/assignProps.js.map +0 -1
  15. package/dist/dom/svelteMountController.d.ts +0 -25
  16. package/dist/dom/svelteMountController.js +0 -131
  17. package/dist/dom/svelteMountController.js.map +0 -1
  18. package/dist/dom/touchDrag.d.ts +0 -10
  19. package/dist/dom/touchDrag.js +0 -141
  20. package/dist/dom/touchDrag.js.map +0 -1
  21. package/dist/element-mapper/AttributeNameMapper.d.ts +0 -66
  22. package/dist/element-mapper/AttributeNameMapper.js +0 -2
  23. package/dist/element-mapper/AttributeNameMapper.js.map +0 -1
  24. package/dist/element-mapper/ElementNameMapper.d.ts +0 -66
  25. package/dist/element-mapper/ElementNameMapper.js +0 -2
  26. package/dist/element-mapper/ElementNameMapper.js.map +0 -1
  27. package/dist/element-mapper/Qti2xAttributeNameMapper.d.ts +0 -27
  28. package/dist/element-mapper/Qti2xAttributeNameMapper.js +0 -38
  29. package/dist/element-mapper/Qti2xAttributeNameMapper.js.map +0 -1
  30. package/dist/element-mapper/Qti2xElementNameMapper.d.ts +0 -37
  31. package/dist/element-mapper/Qti2xElementNameMapper.js +0 -47
  32. package/dist/element-mapper/Qti2xElementNameMapper.js.map +0 -1
  33. package/dist/element-mapper/Qti3AttributeNameMapper.d.ts +0 -40
  34. package/dist/element-mapper/Qti3AttributeNameMapper.js +0 -87
  35. package/dist/element-mapper/Qti3AttributeNameMapper.js.map +0 -1
  36. package/dist/element-mapper/Qti3ElementNameMapper.d.ts +0 -14
  37. package/dist/element-mapper/Qti3ElementNameMapper.js +0 -39
  38. package/dist/element-mapper/Qti3ElementNameMapper.js.map +0 -1
  39. package/dist/element-mapper/index.d.ts +0 -7
  40. package/dist/element-mapper/index.js +0 -6
  41. package/dist/element-mapper/index.js.map +0 -1
  42. package/dist/element-mapper/qti3-attribute-map.d.ts +0 -8
  43. package/dist/element-mapper/qti3-attribute-map.js +0 -115
  44. package/dist/element-mapper/qti3-attribute-map.js.map +0 -1
  45. package/dist/element-mapper/qti3-element-mappings.d.ts +0 -459
  46. package/dist/element-mapper/qti3-element-mappings.js +0 -328
  47. package/dist/element-mapper/qti3-element-mappings.js.map +0 -1
  48. package/dist/index.d.ts +0 -14
  49. package/dist/index.js +0 -16
  50. package/dist/index.js.map +0 -1
  51. package/dist/parser-factory.d.ts +0 -137
  52. package/dist/parser-factory.js +0 -146
  53. package/dist/parser-factory.js.map +0 -1
  54. package/dist/version-detection/detectQtiVersion.d.ts +0 -23
  55. package/dist/version-detection/detectQtiVersion.js +0 -129
  56. package/dist/version-detection/detectQtiVersion.js.map +0 -1
  57. package/dist/version-detection/index.d.ts +0 -2
  58. package/dist/version-detection/index.js +0 -2
  59. package/dist/version-detection/index.js.map +0 -1
  60. package/dist/xml/attributes.d.ts +0 -77
  61. package/dist/xml/attributes.js +0 -120
  62. package/dist/xml/attributes.js.map +0 -1
@@ -1,328 +0,0 @@
1
- /**
2
- * Comprehensive QTI 3.0 element name mappings.
3
- *
4
- * Based on IMS Global/1EdTech QTI 3.0 specification and amp-up.io implementation.
5
- * All QTI 3.0 elements use kebab-case with 'qti-' prefix.
6
- *
7
- * This file documents 172 QTI 3.0 elements providing 100% coverage of the official
8
- * specification including all interactions, processing rules, expressions, and
9
- * accessibility features.
10
- */
11
- /**
12
- * Core assessment structure elements
13
- */
14
- export const CORE_ELEMENTS = {
15
- 'qti-assessment-item': 'assessmentitem',
16
- 'qti-assessment-test': 'assessmenttest',
17
- 'qti-item-body': 'itembody',
18
- 'qti-content-body': 'contentbody',
19
- 'qti-test-part': 'testpart',
20
- 'qti-assessment-section': 'assessmentsection',
21
- 'qti-assessment-item-ref': 'assessmentitemref',
22
- 'qti-assessment-stimulus-ref': 'assessmentstimulusref',
23
- };
24
- /**
25
- * Variable declaration elements
26
- */
27
- export const DECLARATION_ELEMENTS = {
28
- 'qti-response-declaration': 'responsedeclaration',
29
- 'qti-outcome-declaration': 'outcomedeclaration',
30
- 'qti-template-declaration': 'templatedeclaration',
31
- 'qti-context-declaration': 'contextdeclaration',
32
- 'qti-correct-response': 'correctresponse',
33
- 'qti-default-value': 'defaultvalue',
34
- 'qti-value': 'value',
35
- 'qti-mapping': 'mapping',
36
- 'qti-map-entry': 'mapentry',
37
- 'qti-area-mapping': 'areamapping',
38
- 'qti-area-map-entry': 'areamapentry',
39
- 'qti-match-table': 'matchtable',
40
- 'qti-match-table-entry': 'matchtableentry',
41
- 'qti-interpolation-table': 'interpolationtable',
42
- 'qti-interpolation-table-entry': 'interpolationtableentry',
43
- };
44
- /**
45
- * All 23+ interaction types (block and inline)
46
- */
47
- export const INTERACTION_ELEMENTS = {
48
- // Block interactions
49
- 'qti-choice-interaction': 'choiceinteraction',
50
- 'qti-match-interaction': 'matchinteraction',
51
- 'qti-order-interaction': 'orderinteraction',
52
- 'qti-gap-match-interaction': 'gapmatchinteraction',
53
- 'qti-graphic-gap-match-interaction': 'graphicgapmatchinteraction',
54
- 'qti-hotspot-interaction': 'hotspotinteraction',
55
- 'qti-hottext-interaction': 'hottextinteraction',
56
- 'qti-extended-text-interaction': 'extendedtextinteraction',
57
- 'qti-media-interaction': 'mediainteraction',
58
- 'qti-select-point-interaction': 'selectpointinteraction',
59
- 'qti-custom-interaction': 'custominteraction',
60
- 'qti-portable-custom-interaction': 'portablecustominteraction',
61
- 'qti-end-attempt-interaction': 'endattemptinteraction',
62
- 'qti-slider-interaction': 'sliderinteraction',
63
- 'qti-drawing-interaction': 'drawinginteraction',
64
- 'qti-upload-interaction': 'uploadinteraction',
65
- 'qti-position-object-interaction': 'positionobjectinteraction',
66
- 'qti-graphic-order-interaction': 'graphicorderinteraction',
67
- 'qti-graphic-associate-interaction': 'graphicassociateinteraction',
68
- 'qti-associate-interaction': 'associateinteraction',
69
- // Inline interactions
70
- 'qti-text-entry-interaction': 'textentryinteraction',
71
- 'qti-inline-choice-interaction': 'inlinechoiceinteraction',
72
- };
73
- /**
74
- * Interaction child elements
75
- */
76
- export const INTERACTION_CHILD_ELEMENTS = {
77
- 'qti-prompt': 'prompt',
78
- 'qti-simple-choice': 'simplechoice',
79
- 'qti-simple-match-set': 'simplematchset',
80
- 'qti-simple-associable-choice': 'simpleassociablechoice',
81
- 'qti-gap': 'gap',
82
- 'qti-gap-text': 'gaptext',
83
- 'qti-gap-img': 'gapimg',
84
- 'qti-gap-choice': 'gapchoice',
85
- 'qti-hotspot-choice': 'hotspotchoice',
86
- 'qti-associable-hotspot': 'associablehotspot',
87
- 'qti-hottext': 'hottext',
88
- 'qti-inline-choice': 'inlinechoice',
89
- 'qti-position-object-stage': 'positionobjectstage',
90
- };
91
- /**
92
- * Response processing elements
93
- */
94
- export const RESPONSE_PROCESSING_ELEMENTS = {
95
- 'qti-response-processing': 'responseprocessing',
96
- 'qti-response-condition': 'responsecondition',
97
- 'qti-response-if': 'responseif',
98
- 'qti-response-else-if': 'responseelseif',
99
- 'qti-response-else': 'responseelse',
100
- 'qti-response-processing-fragment': 'responseprocessingfragment',
101
- 'qti-exit-response': 'exitresponse',
102
- 'qti-set-outcome-value': 'setoutcomevalue',
103
- 'qti-lookup-outcome-value': 'lookupoutcomevalue',
104
- 'qti-set-correct-response': 'setcorrectresponse',
105
- 'qti-set-default-value': 'setdefaultvalue',
106
- };
107
- /**
108
- * Template processing elements
109
- */
110
- export const TEMPLATE_PROCESSING_ELEMENTS = {
111
- 'qti-template-processing': 'templateprocessing',
112
- 'qti-template-condition': 'templatecondition',
113
- 'qti-template-if': 'templateif',
114
- 'qti-template-else-if': 'templateelseif',
115
- 'qti-template-else': 'templateelse',
116
- 'qti-template-constraint': 'templateconstraint',
117
- 'qti-set-template-value': 'settemplatevalue',
118
- 'qti-exit-template': 'exittemplate',
119
- 'qti-template-block': 'templateblock',
120
- 'qti-template-inline': 'templateinline',
121
- };
122
- /**
123
- * Outcome processing elements (test-level)
124
- */
125
- export const OUTCOME_PROCESSING_ELEMENTS = {
126
- 'qti-outcome-processing': 'outcomeprocessing',
127
- 'qti-outcome-condition': 'outcomecondition',
128
- 'qti-outcome-if': 'outcomeif',
129
- 'qti-outcome-else-if': 'outcomeelseif',
130
- 'qti-outcome-else': 'outcomeelse',
131
- 'qti-exit-test': 'exittest',
132
- };
133
- /**
134
- * Expression elements (54+ operators)
135
- */
136
- export const EXPRESSION_ELEMENTS = {
137
- // Variable expressions
138
- 'qti-variable': 'variable',
139
- 'qti-correct': 'correct',
140
- 'qti-default': 'default',
141
- 'qti-base-value': 'basevalue',
142
- 'qti-field-value': 'fieldvalue',
143
- 'qti-custom-operator': 'customoperator',
144
- 'qti-index': 'index',
145
- 'qti-contains': 'contains',
146
- 'qti-member': 'member',
147
- 'qti-null': 'null',
148
- // Comparison operators
149
- 'qti-equal': 'equal',
150
- 'qti-equal-rounded': 'equalrounded',
151
- 'qti-gt': 'gt',
152
- 'qti-gte': 'gte',
153
- 'qti-lt': 'lt',
154
- 'qti-lte': 'lte',
155
- // Logical operators
156
- 'qti-and': 'and',
157
- 'qti-or': 'or',
158
- 'qti-not': 'not',
159
- 'qti-any-n': 'anyn',
160
- 'qti-multiple': 'multiple',
161
- 'qti-ordered': 'ordered',
162
- // String operators
163
- 'qti-string-match': 'stringmatch',
164
- 'qti-pattern-match': 'patternmatch',
165
- 'qti-substring': 'substring',
166
- 'qti-repeat': 'repeat',
167
- // Matching operators
168
- 'qti-match': 'match',
169
- 'qti-inside': 'inside',
170
- 'qti-map-response': 'mapresponse',
171
- 'qti-map-response-point': 'mapresponsepoint',
172
- // Numeric operators
173
- 'qti-sum': 'sum',
174
- 'qti-product': 'product',
175
- 'qti-subtract': 'subtract',
176
- 'qti-divide': 'divide',
177
- 'qti-integer-divide': 'integerdivide',
178
- 'qti-integer-modulus': 'integermodulus',
179
- 'qti-round': 'round',
180
- 'qti-round-to': 'roundto',
181
- 'qti-truncate': 'truncate',
182
- // Math functions
183
- 'qti-math-operator': 'mathoperator',
184
- 'qti-math-constant': 'mathconstant',
185
- 'qti-power': 'power',
186
- 'qti-gcd': 'gcd',
187
- 'qti-lcm': 'lcm',
188
- // Statistical operators
189
- 'qti-stats-operator': 'statsoperator',
190
- 'qti-min': 'min',
191
- 'qti-max': 'max',
192
- 'qti-container-size': 'containersize',
193
- 'qti-delete': 'delete',
194
- 'qti-is-null': 'isnull',
195
- 'qti-random': 'random',
196
- 'qti-random-integer': 'randominteger',
197
- 'qti-random-float': 'randomfloat',
198
- // Test-level expressions
199
- 'qti-test-variables': 'testvariables',
200
- 'qti-outcome-maximum': 'outcomemaximum',
201
- 'qti-outcome-minimum': 'outcomeminimum',
202
- 'qti-number-correct': 'numbercorrect',
203
- 'qti-number-incorrect': 'numberincorrect',
204
- 'qti-number-presented': 'numberpresented',
205
- 'qti-number-responded': 'numberresponded',
206
- 'qti-number-selected': 'numberselected',
207
- // Duration operators (time-based constraints)
208
- 'qti-duration-gt': 'durationgt',
209
- 'qti-duration-gte': 'durationgte',
210
- 'qti-duration-lt': 'durationlt',
211
- 'qti-duration-lte': 'durationlte',
212
- };
213
- /**
214
- * Feedback elements
215
- */
216
- export const FEEDBACK_ELEMENTS = {
217
- 'qti-modal-feedback': 'modalfeedback',
218
- 'qti-feedback-block': 'feedbackblock',
219
- 'qti-feedback-inline': 'feedbackinline',
220
- 'qti-rubric-block': 'rubricblock',
221
- 'qti-modal-feedback-ok': 'modalfeedbackok',
222
- };
223
- /**
224
- * PCI (Portable Custom Interaction) elements
225
- */
226
- export const PCI_ELEMENTS = {
227
- 'qti-interaction-modules': 'interactionmodules',
228
- 'qti-interaction-module': 'interactionmodule',
229
- 'qti-interaction-markup': 'interactionmarkup',
230
- 'qti-interaction-hook': 'interactionhook',
231
- 'qti-interaction-config': 'interactionconfig',
232
- };
233
- /**
234
- * Catalog elements (accessibility support)
235
- */
236
- export const CATALOG_ELEMENTS = {
237
- 'qti-catalog': 'catalog',
238
- 'qti-catalog-info': 'cataloginfo',
239
- 'qti-card': 'card',
240
- 'qti-card-entry': 'cardentry',
241
- 'qti-html-content': 'htmlcontent',
242
- 'qti-file-href': 'filehref',
243
- };
244
- /**
245
- * Other content elements
246
- */
247
- export const CONTENT_ELEMENTS = {
248
- 'qti-printed-variable': 'printedvariable',
249
- 'qti-context-variable': 'contextvariable',
250
- 'qti-template-variable': 'templatevariable',
251
- 'qti-stylesheet': 'stylesheet',
252
- 'qti-companion-materials-info': 'companionmaterialsinfo',
253
- };
254
- /**
255
- * Complete mapping of all QTI 3.0 elements to canonical form
256
- */
257
- export const QTI3_ELEMENT_MAPPINGS = {
258
- ...CORE_ELEMENTS,
259
- ...DECLARATION_ELEMENTS,
260
- ...INTERACTION_ELEMENTS,
261
- ...INTERACTION_CHILD_ELEMENTS,
262
- ...RESPONSE_PROCESSING_ELEMENTS,
263
- ...TEMPLATE_PROCESSING_ELEMENTS,
264
- ...OUTCOME_PROCESSING_ELEMENTS,
265
- ...EXPRESSION_ELEMENTS,
266
- ...FEEDBACK_ELEMENTS,
267
- ...PCI_ELEMENTS,
268
- ...CATALOG_ELEMENTS,
269
- ...CONTENT_ELEMENTS,
270
- };
271
- /**
272
- * Get canonical name for a QTI 3.0 element
273
- */
274
- export function getCanonicalName(qti3ElementName) {
275
- return QTI3_ELEMENT_MAPPINGS[qti3ElementName];
276
- }
277
- /**
278
- * Check if an element name is a valid QTI 3.0 element
279
- */
280
- export function isQti3Element(elementName) {
281
- return elementName in QTI3_ELEMENT_MAPPINGS;
282
- }
283
- /**
284
- * Get all QTI 3.0 interaction element names
285
- */
286
- export function getInteractionElements() {
287
- return Object.keys(INTERACTION_ELEMENTS);
288
- }
289
- /**
290
- * Common QTI 3.0 attribute names (kebab-case)
291
- */
292
- export const QTI3_ATTRIBUTES = {
293
- // Identifiers
294
- identifier: 'identifier',
295
- responseIdentifier: 'response-identifier',
296
- outcomeIdentifier: 'outcome-identifier',
297
- templateIdentifier: 'template-identifier',
298
- // Types
299
- baseType: 'base-type',
300
- cardinality: 'cardinality',
301
- // Interaction attributes
302
- minChoices: 'min-choices',
303
- maxChoices: 'max-choices',
304
- shuffle: 'shuffle',
305
- fixed: 'fixed',
306
- // Feedback attributes
307
- showHide: 'show-hide',
308
- // Outcome attributes
309
- normalMaximum: 'normal-maximum',
310
- normalMinimum: 'normal-minimum',
311
- // Template attributes
312
- mathVariable: 'math-variable',
313
- paramVariable: 'param-variable',
314
- // Assessment attributes
315
- timeDependent: 'time-dependent',
316
- adaptive: 'adaptive',
317
- // Text interaction attributes
318
- expectedLength: 'expected-length',
319
- patternMask: 'pattern-mask',
320
- placeholderText: 'placeholder-text',
321
- minStrings: 'min-strings',
322
- maxStrings: 'max-strings',
323
- // Other
324
- fieldIdentifier: 'field-identifier',
325
- toleranceMode: 'tolerance-mode',
326
- dataCatalogIdref: 'data-catalog-idref', // AMP extension
327
- };
328
- //# sourceMappingURL=qti3-element-mappings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"qti3-element-mappings.js","sourceRoot":"","sources":["../../src/element-mapper/qti3-element-mappings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC5B,qBAAqB,EAAE,gBAAgB;IACvC,qBAAqB,EAAE,gBAAgB;IACvC,eAAe,EAAE,UAAU;IAC3B,kBAAkB,EAAE,aAAa;IACjC,eAAe,EAAE,UAAU;IAC3B,wBAAwB,EAA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B;IACvC,kBAAkB,EAAE,qBAAqB;IAEzC,QAAQ;IACR,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,aAAa;IAE1B,yBAAyB;IACzB,UAAU,EAAE,aAAa;IACzB,UAAU,EAAE,aAAa;IACzB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IAEd,sBAAsB;IACtB,QAAQ,EAAE,WAAW;IAErB,qBAAqB;IACrB,aAAa,EAAE,gBAAgB;IAC/B,aAAa,EAAE,gBAAgB;IAE/B,sBAAsB;IACtB,YAAY,EAAE,eAAe;IAC7B,aAAa,EAAE,gBAAgB;IAE/B,wBAAwB;IACxB,aAAa,EAAE,gBAAgB;IAC/B,QAAQ,EAAE,UAAU;IAEpB,8BAA8B;IAC9B,cAAc,EAAE,iBAAiB;IACjC,WAAW,EAAE,cAAc;IAC3B,eAAe,EAAE,kBAAkB;IACnC,UAAU,EAAE,aAAa;IACzB,UAAU,EAAE,aAAa;IAEzB,QAAQ;IACR,eAAe,EAAE,kBAAkB;IACnC,aAAa,EAAE,gBAAgB;IAC/B,gBAAgB,EAAE,oBAAoB,EAAE,gBAAgB;CAC/C,CAAC","sourcesContent":["/**\n * Comprehensive QTI 3.0 element name mappings.\n *\n * Based on IMS Global/1EdTech QTI 3.0 specification and amp-up.io implementation.\n * All QTI 3.0 elements use kebab-case with 'qti-' prefix.\n *\n * This file documents 172 QTI 3.0 elements providing 100% coverage of the official\n * specification including all interactions, processing rules, expressions, and\n * accessibility features.\n */\n\n/**\n * Core assessment structure elements\n */\nexport const CORE_ELEMENTS = {\n\t'qti-assessment-item': 'assessmentitem',\n\t'qti-assessment-test': 'assessmenttest',\n\t'qti-item-body': 'itembody',\n\t'qti-content-body': 'contentbody',\n\t'qti-test-part': 'testpart',\n\t'qti-assessment-section': 'assessmentsection',\n\t'qti-assessment-item-ref': 'assessmentitemref',\n\t'qti-assessment-stimulus-ref': 'assessmentstimulusref',\n} as const;\n\n/**\n * Variable declaration elements\n */\nexport const DECLARATION_ELEMENTS = {\n\t'qti-response-declaration': 'responsedeclaration',\n\t'qti-outcome-declaration': 'outcomedeclaration',\n\t'qti-template-declaration': 'templatedeclaration',\n\t'qti-context-declaration': 'contextdeclaration',\n\t'qti-correct-response': 'correctresponse',\n\t'qti-default-value': 'defaultvalue',\n\t'qti-value': 'value',\n\t'qti-mapping': 'mapping',\n\t'qti-map-entry': 'mapentry',\n\t'qti-area-mapping': 'areamapping',\n\t'qti-area-map-entry': 'areamapentry',\n\t'qti-match-table': 'matchtable',\n\t'qti-match-table-entry': 'matchtableentry',\n\t'qti-interpolation-table': 'interpolationtable',\n\t'qti-interpolation-table-entry': 'interpolationtableentry',\n} as const;\n\n/**\n * All 23+ interaction types (block and inline)\n */\nexport const INTERACTION_ELEMENTS = {\n\t// Block interactions\n\t'qti-choice-interaction': 'choiceinteraction',\n\t'qti-match-interaction': 'matchinteraction',\n\t'qti-order-interaction': 'orderinteraction',\n\t'qti-gap-match-interaction': 'gapmatchinteraction',\n\t'qti-graphic-gap-match-interaction': 'graphicgapmatchinteraction',\n\t'qti-hotspot-interaction': 'hotspotinteraction',\n\t'qti-hottext-interaction': 'hottextinteraction',\n\t'qti-extended-text-interaction': 'extendedtextinteraction',\n\t'qti-media-interaction': 'mediainteraction',\n\t'qti-select-point-interaction': 'selectpointinteraction',\n\t'qti-custom-interaction': 'custominteraction',\n\t'qti-portable-custom-interaction': 'portablecustominteraction',\n\t'qti-end-attempt-interaction': 'endattemptinteraction',\n\t'qti-slider-interaction': 'sliderinteraction',\n\t'qti-drawing-interaction': 'drawinginteraction',\n\t'qti-upload-interaction': 'uploadinteraction',\n\t'qti-position-object-interaction': 'positionobjectinteraction',\n\t'qti-graphic-order-interaction': 'graphicorderinteraction',\n\t'qti-graphic-associate-interaction': 'graphicassociateinteraction',\n\t'qti-associate-interaction': 'associateinteraction',\n\n\t// Inline interactions\n\t'qti-text-entry-interaction': 'textentryinteraction',\n\t'qti-inline-choice-interaction': 'inlinechoiceinteraction',\n\n} as const;\n\n/**\n * Interaction child elements\n */\nexport const INTERACTION_CHILD_ELEMENTS = {\n\t'qti-prompt': 'prompt',\n\t'qti-simple-choice': 'simplechoice',\n\t'qti-simple-match-set': 'simplematchset',\n\t'qti-simple-associable-choice': 'simpleassociablechoice',\n\t'qti-gap': 'gap',\n\t'qti-gap-text': 'gaptext',\n\t'qti-gap-img': 'gapimg',\n\t'qti-gap-choice': 'gapchoice',\n\t'qti-hotspot-choice': 'hotspotchoice',\n\t'qti-associable-hotspot': 'associablehotspot',\n\t'qti-hottext': 'hottext',\n\t'qti-inline-choice': 'inlinechoice',\n\t'qti-position-object-stage': 'positionobjectstage',\n} as const;\n\n/**\n * Response processing elements\n */\nexport const RESPONSE_PROCESSING_ELEMENTS = {\n\t'qti-response-processing': 'responseprocessing',\n\t'qti-response-condition': 'responsecondition',\n\t'qti-response-if': 'responseif',\n\t'qti-response-else-if': 'responseelseif',\n\t'qti-response-else': 'responseelse',\n\t'qti-response-processing-fragment': 'responseprocessingfragment',\n\t'qti-exit-response': 'exitresponse',\n\t'qti-set-outcome-value': 'setoutcomevalue',\n\t'qti-lookup-outcome-value': 'lookupoutcomevalue',\n\t'qti-set-correct-response': 'setcorrectresponse',\n\t'qti-set-default-value': 'setdefaultvalue',\n} as const;\n\n/**\n * Template processing elements\n */\nexport const TEMPLATE_PROCESSING_ELEMENTS = {\n\t'qti-template-processing': 'templateprocessing',\n\t'qti-template-condition': 'templatecondition',\n\t'qti-template-if': 'templateif',\n\t'qti-template-else-if': 'templateelseif',\n\t'qti-template-else': 'templateelse',\n\t'qti-template-constraint': 'templateconstraint',\n\t'qti-set-template-value': 'settemplatevalue',\n\t'qti-exit-template': 'exittemplate',\n\t'qti-template-block': 'templateblock',\n\t'qti-template-inline': 'templateinline',\n} as const;\n\n/**\n * Outcome processing elements (test-level)\n */\nexport const OUTCOME_PROCESSING_ELEMENTS = {\n\t'qti-outcome-processing': 'outcomeprocessing',\n\t'qti-outcome-condition': 'outcomecondition',\n\t'qti-outcome-if': 'outcomeif',\n\t'qti-outcome-else-if': 'outcomeelseif',\n\t'qti-outcome-else': 'outcomeelse',\n\t'qti-exit-test': 'exittest',\n} as const;\n\n/**\n * Expression elements (54+ operators)\n */\nexport const EXPRESSION_ELEMENTS = {\n\t// Variable expressions\n\t'qti-variable': 'variable',\n\t'qti-correct': 'correct',\n\t'qti-default': 'default',\n\t'qti-base-value': 'basevalue',\n\t'qti-field-value': 'fieldvalue',\n\t'qti-custom-operator': 'customoperator',\n\t'qti-index': 'index',\n\t'qti-contains': 'contains',\n\t'qti-member': 'member',\n\t'qti-null': 'null',\n\n\t// Comparison operators\n\t'qti-equal': 'equal',\n\t'qti-equal-rounded': 'equalrounded',\n\t'qti-gt': 'gt',\n\t'qti-gte': 'gte',\n\t'qti-lt': 'lt',\n\t'qti-lte': 'lte',\n\n\t// Logical operators\n\t'qti-and': 'and',\n\t'qti-or': 'or',\n\t'qti-not': 'not',\n\t'qti-any-n': 'anyn',\n\t'qti-multiple': 'multiple',\n\t'qti-ordered': 'ordered',\n\n\t// String operators\n\t'qti-string-match': 'stringmatch',\n\t'qti-pattern-match': 'patternmatch',\n\t'qti-substring': 'substring',\n\t'qti-repeat': 'repeat',\n\n\t// Matching operators\n\t'qti-match': 'match',\n\t'qti-inside': 'inside',\n\t'qti-map-response': 'mapresponse',\n\t'qti-map-response-point': 'mapresponsepoint',\n\n\t// Numeric operators\n\t'qti-sum': 'sum',\n\t'qti-product': 'product',\n\t'qti-subtract': 'subtract',\n\t'qti-divide': 'divide',\n\t'qti-integer-divide': 'integerdivide',\n\t'qti-integer-modulus': 'integermodulus',\n\t'qti-round': 'round',\n\t'qti-round-to': 'roundto',\n\t'qti-truncate': 'truncate',\n\n\t// Math functions\n\t'qti-math-operator': 'mathoperator',\n\t'qti-math-constant': 'mathconstant',\n\t'qti-power': 'power',\n\t'qti-gcd': 'gcd',\n\t'qti-lcm': 'lcm',\n\n\t// Statistical operators\n\t'qti-stats-operator': 'statsoperator',\n\t'qti-min': 'min',\n\t'qti-max': 'max',\n\t'qti-container-size': 'containersize',\n\t'qti-delete': 'delete',\n\t'qti-is-null': 'isnull',\n\t'qti-random': 'random',\n\t'qti-random-integer': 'randominteger',\n\t'qti-random-float': 'randomfloat',\n\n\t// Test-level expressions\n\t'qti-test-variables': 'testvariables',\n\t'qti-outcome-maximum': 'outcomemaximum',\n\t'qti-outcome-minimum': 'outcomeminimum',\n\t'qti-number-correct': 'numbercorrect',\n\t'qti-number-incorrect': 'numberincorrect',\n\t'qti-number-presented': 'numberpresented',\n\t'qti-number-responded': 'numberresponded',\n\t'qti-number-selected': 'numberselected',\n\n\t// Duration operators (time-based constraints)\n\t'qti-duration-gt': 'durationgt',\n\t'qti-duration-gte': 'durationgte',\n\t'qti-duration-lt': 'durationlt',\n\t'qti-duration-lte': 'durationlte',\n} as const;\n\n/**\n * Feedback elements\n */\nexport const FEEDBACK_ELEMENTS = {\n\t'qti-modal-feedback': 'modalfeedback',\n\t'qti-feedback-block': 'feedbackblock',\n\t'qti-feedback-inline': 'feedbackinline',\n\t'qti-rubric-block': 'rubricblock',\n\t'qti-modal-feedback-ok': 'modalfeedbackok',\n} as const;\n\n/**\n * PCI (Portable Custom Interaction) elements\n */\nexport const PCI_ELEMENTS = {\n\t'qti-interaction-modules': 'interactionmodules',\n\t'qti-interaction-module': 'interactionmodule',\n\t'qti-interaction-markup': 'interactionmarkup',\n\t'qti-interaction-hook': 'interactionhook',\n\t'qti-interaction-config': 'interactionconfig',\n} as const;\n\n/**\n * Catalog elements (accessibility support)\n */\nexport const CATALOG_ELEMENTS = {\n\t'qti-catalog': 'catalog',\n\t'qti-catalog-info': 'cataloginfo',\n\t'qti-card': 'card',\n\t'qti-card-entry': 'cardentry',\n\t'qti-html-content': 'htmlcontent',\n\t'qti-file-href': 'filehref',\n} as const;\n\n/**\n * Other content elements\n */\nexport const CONTENT_ELEMENTS = {\n\t'qti-printed-variable': 'printedvariable',\n\t'qti-context-variable': 'contextvariable',\n\t'qti-template-variable': 'templatevariable',\n\t'qti-stylesheet': 'stylesheet',\n\t'qti-companion-materials-info': 'companionmaterialsinfo',\n} as const;\n\n/**\n * Complete mapping of all QTI 3.0 elements to canonical form\n */\nexport const QTI3_ELEMENT_MAPPINGS = {\n\t...CORE_ELEMENTS,\n\t...DECLARATION_ELEMENTS,\n\t...INTERACTION_ELEMENTS,\n\t...INTERACTION_CHILD_ELEMENTS,\n\t...RESPONSE_PROCESSING_ELEMENTS,\n\t...TEMPLATE_PROCESSING_ELEMENTS,\n\t...OUTCOME_PROCESSING_ELEMENTS,\n\t...EXPRESSION_ELEMENTS,\n\t...FEEDBACK_ELEMENTS,\n\t...PCI_ELEMENTS,\n\t...CATALOG_ELEMENTS,\n\t...CONTENT_ELEMENTS,\n} as const;\n\n/**\n * Get canonical name for a QTI 3.0 element\n */\nexport function getCanonicalName(qti3ElementName: string): string | undefined {\n\treturn QTI3_ELEMENT_MAPPINGS[qti3ElementName as keyof typeof QTI3_ELEMENT_MAPPINGS];\n}\n\n/**\n * Check if an element name is a valid QTI 3.0 element\n */\nexport function isQti3Element(elementName: string): boolean {\n\treturn elementName in QTI3_ELEMENT_MAPPINGS;\n}\n\n/**\n * Get all QTI 3.0 interaction element names\n */\nexport function getInteractionElements(): readonly string[] {\n\treturn Object.keys(INTERACTION_ELEMENTS);\n}\n\n/**\n * Common QTI 3.0 attribute names (kebab-case)\n */\nexport const QTI3_ATTRIBUTES = {\n\t// Identifiers\n\tidentifier: 'identifier',\n\tresponseIdentifier: 'response-identifier',\n\toutcomeIdentifier: 'outcome-identifier',\n\ttemplateIdentifier: 'template-identifier',\n\n\t// Types\n\tbaseType: 'base-type',\n\tcardinality: 'cardinality',\n\n\t// Interaction attributes\n\tminChoices: 'min-choices',\n\tmaxChoices: 'max-choices',\n\tshuffle: 'shuffle',\n\tfixed: 'fixed',\n\n\t// Feedback attributes\n\tshowHide: 'show-hide',\n\n\t// Outcome attributes\n\tnormalMaximum: 'normal-maximum',\n\tnormalMinimum: 'normal-minimum',\n\n\t// Template attributes\n\tmathVariable: 'math-variable',\n\tparamVariable: 'param-variable',\n\n\t// Assessment attributes\n\ttimeDependent: 'time-dependent',\n\tadaptive: 'adaptive',\n\n\t// Text interaction attributes\n\texpectedLength: 'expected-length',\n\tpatternMask: 'pattern-mask',\n\tplaceholderText: 'placeholder-text',\n\tminStrings: 'min-strings',\n\tmaxStrings: 'max-strings',\n\n\t// Other\n\tfieldIdentifier: 'field-identifier',\n\ttoleranceMode: 'tolerance-mode',\n\tdataCatalogIdref: 'data-catalog-idref', // AMP extension\n} as const;\n"]}
package/dist/index.d.ts DELETED
@@ -1,14 +0,0 @@
1
- export type { ElementNameMapper } from './element-mapper/ElementNameMapper.js';
2
- export { Qti2xElementNameMapper } from './element-mapper/Qti2xElementNameMapper.js';
3
- export { Qti3ElementNameMapper } from './element-mapper/Qti3ElementNameMapper.js';
4
- export type { AttributeNameMapper } from './element-mapper/AttributeNameMapper.js';
5
- export { Qti2xAttributeNameMapper } from './element-mapper/Qti2xAttributeNameMapper.js';
6
- export { Qti3AttributeNameMapper } from './element-mapper/Qti3AttributeNameMapper.js';
7
- export { QTI2_PROMPT_BEARING_INTERACTIONS, QTI3_ATTRIBUTE_TO_QTI2, } from './element-mapper/qti3-attribute-map.js';
8
- export { detectQtiVersion } from './version-detection/detectQtiVersion.js';
9
- export type { QtiVersion } from './version-detection/detectQtiVersion.js';
10
- export { getAttribute, getBooleanAttribute, getNumberAttribute, hasAttribute, toCamelCase, toKebabCase, } from './xml/attributes.js';
11
- export { assignProps, type AssignPropsOptions } from './dom/assignProps.js';
12
- export { createSvelteMountController, type SvelteMountController, type SvelteMountControllerOptions, } from './dom/svelteMountController.js';
13
- export { touchDrag, touchDragStyles } from './dom/touchDrag.js';
14
- export { createQtiParser, createMapperForVersion, createAttributeMapperForVersion, isQti2, isQti3, type QtiParserResult, type CreateParserOptions, } from './parser-factory.js';
package/dist/index.js DELETED
@@ -1,16 +0,0 @@
1
- export { Qti2xElementNameMapper } from './element-mapper/Qti2xElementNameMapper.js';
2
- export { Qti3ElementNameMapper } from './element-mapper/Qti3ElementNameMapper.js';
3
- export { Qti2xAttributeNameMapper } from './element-mapper/Qti2xAttributeNameMapper.js';
4
- export { Qti3AttributeNameMapper } from './element-mapper/Qti3AttributeNameMapper.js';
5
- export { QTI2_PROMPT_BEARING_INTERACTIONS, QTI3_ATTRIBUTE_TO_QTI2, } from './element-mapper/qti3-attribute-map.js';
6
- // Version detection
7
- export { detectQtiVersion } from './version-detection/detectQtiVersion.js';
8
- // XML attribute utilities
9
- export { getAttribute, getBooleanAttribute, getNumberAttribute, hasAttribute, toCamelCase, toKebabCase, } from './xml/attributes.js';
10
- // DOM utility helpers shared across player packages
11
- export { assignProps } from './dom/assignProps.js';
12
- export { createSvelteMountController, } from './dom/svelteMountController.js';
13
- export { touchDrag, touchDragStyles } from './dom/touchDrag.js';
14
- // Parser factory
15
- export { createQtiParser, createMapperForVersion, createAttributeMapperForVersion, isQti2, isQti3, } from './parser-factory.js';
16
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAIlF,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACtF,OAAO,EACN,gCAAgC,EAChC,sBAAsB,GACtB,MAAM,wCAAwC,CAAC;AAEhD,oBAAoB;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAG3E,0BAA0B;AAC1B,OAAO,EACN,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,WAAW,EACX,WAAW,GACX,MAAM,qBAAqB,CAAC;AAE7B,oDAAoD;AACpD,OAAO,EAAE,WAAW,EAA2B,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EACN,2BAA2B,GAG3B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEhE,iBAAiB;AACjB,OAAO,EACN,eAAe,EACf,sBAAsB,EACtB,+BAA+B,EAC/B,MAAM,EACN,MAAM,GAGN,MAAM,qBAAqB,CAAC","sourcesContent":["// Element name mapping\nexport type { ElementNameMapper } from './element-mapper/ElementNameMapper.js';\nexport { Qti2xElementNameMapper } from './element-mapper/Qti2xElementNameMapper.js';\nexport { Qti3ElementNameMapper } from './element-mapper/Qti3ElementNameMapper.js';\n\n// Attribute name mapping\nexport type { AttributeNameMapper } from './element-mapper/AttributeNameMapper.js';\nexport { Qti2xAttributeNameMapper } from './element-mapper/Qti2xAttributeNameMapper.js';\nexport { Qti3AttributeNameMapper } from './element-mapper/Qti3AttributeNameMapper.js';\nexport {\n\tQTI2_PROMPT_BEARING_INTERACTIONS,\n\tQTI3_ATTRIBUTE_TO_QTI2,\n} from './element-mapper/qti3-attribute-map.js';\n\n// Version detection\nexport { detectQtiVersion } from './version-detection/detectQtiVersion.js';\nexport type { QtiVersion } from './version-detection/detectQtiVersion.js';\n\n// XML attribute utilities\nexport {\n\tgetAttribute,\n\tgetBooleanAttribute,\n\tgetNumberAttribute,\n\thasAttribute,\n\ttoCamelCase,\n\ttoKebabCase,\n} from './xml/attributes.js';\n\n// DOM utility helpers shared across player packages\nexport { assignProps, type AssignPropsOptions } from './dom/assignProps.js';\nexport {\n\tcreateSvelteMountController,\n\ttype SvelteMountController,\n\ttype SvelteMountControllerOptions,\n} from './dom/svelteMountController.js';\nexport { touchDrag, touchDragStyles } from './dom/touchDrag.js';\n\n// Parser factory\nexport {\n\tcreateQtiParser,\n\tcreateMapperForVersion,\n\tcreateAttributeMapperForVersion,\n\tisQti2,\n\tisQti3,\n\ttype QtiParserResult,\n\ttype CreateParserOptions,\n} from './parser-factory.js';\n"]}
@@ -1,137 +0,0 @@
1
- /**
2
- * Parser factory for creating version-appropriate QTI parsers.
3
- *
4
- * This module provides a unified entry point for detecting QTI version
5
- * and creating appropriate element name mappers.
6
- */
7
- import { type QtiVersion } from './version-detection/detectQtiVersion.js';
8
- import type { ElementNameMapper } from './element-mapper/ElementNameMapper.js';
9
- import type { AttributeNameMapper } from './element-mapper/AttributeNameMapper.js';
10
- /**
11
- * Result of creating a QTI parser.
12
- */
13
- export interface QtiParserResult {
14
- /**
15
- * Detected or specified QTI version
16
- */
17
- version: QtiVersion;
18
- /**
19
- * Element name mapper appropriate for the detected version
20
- */
21
- mapper: ElementNameMapper;
22
- /**
23
- * Attribute name mapper appropriate for the detected version
24
- */
25
- attributeMapper: AttributeNameMapper;
26
- }
27
- /**
28
- * Options for creating a QTI parser.
29
- */
30
- export interface CreateParserOptions {
31
- /**
32
- * Override automatic version detection.
33
- * If not provided, version will be detected from XML content.
34
- */
35
- version?: QtiVersion;
36
- /**
37
- * Custom element name mapper to use.
38
- * If provided, overrides automatic mapper selection.
39
- */
40
- mapper?: ElementNameMapper;
41
- /**
42
- * Custom attribute name mapper to use.
43
- * If provided, overrides automatic mapper selection.
44
- */
45
- attributeMapper?: AttributeNameMapper;
46
- }
47
- /**
48
- * Create a QTI parser with appropriate element name mapper for the given XML.
49
- *
50
- * This function automatically detects the QTI version and returns the appropriate
51
- * element name mapper. It can be used as the primary entry point for parsing
52
- * any QTI content.
53
- *
54
- * @param xml - QTI XML content as string
55
- * @param options - Optional configuration
56
- * @returns Parser result with version plus element and attribute mappers
57
- *
58
- * @example
59
- * ```typescript
60
- * // Auto-detect version and create appropriate parser
61
- * const { version, mapper, attributeMapper } = createQtiParser(xml);
62
- * console.log(`Detected QTI ${version}`);
63
- *
64
- * // Use with qti-processing
65
- * const program = buildResponseProcessingAst(responseProcessing, { elementNameMapper: mapper });
66
- *
67
- * // Use with item-player
68
- * const definition = createAssessmentItemDefinition({
69
- * itemXml: xml,
70
- * elementNameMapper: mapper,
71
- * attributeNameMapper: attributeMapper
72
- * });
73
- * ```
74
- *
75
- * @example
76
- * ```typescript
77
- * // Force specific version
78
- * const { mapper } = createQtiParser(xml, { version: '3.0' });
79
- * ```
80
- */
81
- export declare function createQtiParser(xml: string, options?: CreateParserOptions): QtiParserResult;
82
- /**
83
- * Create element name mapper for a specific QTI version.
84
- *
85
- * @param version - QTI version
86
- * @returns Element name mapper for the version
87
- *
88
- * @example
89
- * ```typescript
90
- * const qti2Mapper = createMapperForVersion('2.2');
91
- * const qti3Mapper = createMapperForVersion('3.0');
92
- * ```
93
- */
94
- export declare function createMapperForVersion(version: QtiVersion): ElementNameMapper;
95
- /**
96
- * Create attribute name mapper for a specific QTI version.
97
- *
98
- * @param version - QTI version
99
- * @returns Attribute name mapper for the version
100
- *
101
- * @example
102
- * ```typescript
103
- * const qti2AttrMapper = createAttributeMapperForVersion('2.2');
104
- * const qti3AttrMapper = createAttributeMapperForVersion('3.0');
105
- * ```
106
- */
107
- export declare function createAttributeMapperForVersion(version: QtiVersion): AttributeNameMapper;
108
- /**
109
- * Check if XML content is QTI 3.0.
110
- *
111
- * Convenience function for quickly checking if content uses QTI 3.0.
112
- *
113
- * @param xml - QTI XML content
114
- * @returns true if QTI 3.0, false otherwise
115
- *
116
- * @example
117
- * ```typescript
118
- * if (isQti3(xml)) {
119
- * console.log('This is QTI 3.0 content');
120
- * }
121
- * ```
122
- */
123
- export declare function isQti3(xml: string): boolean;
124
- /**
125
- * Check if XML content is QTI 2.x (2.0, 2.1, or 2.2).
126
- *
127
- * @param xml - QTI XML content
128
- * @returns true if QTI 2.x, false otherwise
129
- *
130
- * @example
131
- * ```typescript
132
- * if (isQti2(xml)) {
133
- * console.log('This is QTI 2.x content');
134
- * }
135
- * ```
136
- */
137
- export declare function isQti2(xml: string): boolean;