@pie-qti/qti-common 0.1.28 → 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.
- package/README.md +31 -86
- package/package.json +2 -3
- package/dist/accessibility/apip.d.ts +0 -66
- package/dist/accessibility/apip.js +0 -576
- package/dist/accessibility/apip.js.map +0 -1
- package/dist/accessibility/catalog-info.d.ts +0 -17
- package/dist/accessibility/catalog-info.js +0 -60
- package/dist/accessibility/catalog-info.js.map +0 -1
- package/dist/accessibility/catalog.d.ts +0 -53
- package/dist/accessibility/catalog.js +0 -68
- package/dist/accessibility/catalog.js.map +0 -1
- package/dist/accessibility/index.d.ts +0 -3
- package/dist/accessibility/index.js +0 -4
- package/dist/accessibility/index.js.map +0 -1
- package/dist/dom/assignProps.d.ts +0 -4
- package/dist/dom/assignProps.js +0 -9
- package/dist/dom/assignProps.js.map +0 -1
- package/dist/dom/svelteMountController.d.ts +0 -25
- package/dist/dom/svelteMountController.js +0 -131
- package/dist/dom/svelteMountController.js.map +0 -1
- package/dist/dom/touchDrag.d.ts +0 -10
- package/dist/dom/touchDrag.js +0 -141
- package/dist/dom/touchDrag.js.map +0 -1
- package/dist/element-mapper/AttributeNameMapper.d.ts +0 -66
- package/dist/element-mapper/AttributeNameMapper.js +0 -2
- package/dist/element-mapper/AttributeNameMapper.js.map +0 -1
- package/dist/element-mapper/ElementNameMapper.d.ts +0 -66
- package/dist/element-mapper/ElementNameMapper.js +0 -2
- package/dist/element-mapper/ElementNameMapper.js.map +0 -1
- package/dist/element-mapper/Qti2xAttributeNameMapper.d.ts +0 -27
- package/dist/element-mapper/Qti2xAttributeNameMapper.js +0 -38
- package/dist/element-mapper/Qti2xAttributeNameMapper.js.map +0 -1
- package/dist/element-mapper/Qti2xElementNameMapper.d.ts +0 -37
- package/dist/element-mapper/Qti2xElementNameMapper.js +0 -47
- package/dist/element-mapper/Qti2xElementNameMapper.js.map +0 -1
- package/dist/element-mapper/Qti3AttributeNameMapper.d.ts +0 -40
- package/dist/element-mapper/Qti3AttributeNameMapper.js +0 -87
- package/dist/element-mapper/Qti3AttributeNameMapper.js.map +0 -1
- package/dist/element-mapper/Qti3ElementNameMapper.d.ts +0 -14
- package/dist/element-mapper/Qti3ElementNameMapper.js +0 -39
- package/dist/element-mapper/Qti3ElementNameMapper.js.map +0 -1
- package/dist/element-mapper/index.d.ts +0 -8
- package/dist/element-mapper/index.js +0 -7
- package/dist/element-mapper/index.js.map +0 -1
- package/dist/element-mapper/qti2-to-qti3.d.ts +0 -36
- package/dist/element-mapper/qti2-to-qti3.js +0 -228
- package/dist/element-mapper/qti2-to-qti3.js.map +0 -1
- package/dist/element-mapper/qti3-attribute-map.d.ts +0 -8
- package/dist/element-mapper/qti3-attribute-map.js +0 -115
- package/dist/element-mapper/qti3-attribute-map.js.map +0 -1
- package/dist/element-mapper/qti3-element-mappings.d.ts +0 -538
- package/dist/element-mapper/qti3-element-mappings.js +0 -381
- package/dist/element-mapper/qti3-element-mappings.js.map +0 -1
- package/dist/index.d.ts +0 -15
- package/dist/index.js +0 -17
- package/dist/index.js.map +0 -1
- package/dist/parser-factory.d.ts +0 -137
- package/dist/parser-factory.js +0 -146
- package/dist/parser-factory.js.map +0 -1
- package/dist/version-detection/detectQtiVersion.d.ts +0 -23
- package/dist/version-detection/detectQtiVersion.js +0 -129
- package/dist/version-detection/detectQtiVersion.js.map +0 -1
- package/dist/version-detection/index.d.ts +0 -2
- package/dist/version-detection/index.js +0 -2
- package/dist/version-detection/index.js.map +0 -1
- package/dist/xml/attributes.d.ts +0 -77
- package/dist/xml/attributes.js +0 -120
- package/dist/xml/attributes.js.map +0 -1
|
@@ -1,381 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* QTI 3.0 element name mappings: every `qti-*` element of the 1EdTech QTI 3.0 ASI schema,
|
|
3
|
-
* mapped to its lowercase canonical name. `qti3-xsd-conformance.test.ts` checks the map
|
|
4
|
-
* against the schema vendored in `schemas/qti3/`, in both directions.
|
|
5
|
-
*
|
|
6
|
-
* XHTML and HTML5 content elements keep their unprefixed names in QTI 3 and are not listed.
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Core assessment structure elements
|
|
10
|
-
*/
|
|
11
|
-
export const CORE_ELEMENTS = {
|
|
12
|
-
'qti-assessment-item': 'assessmentitem',
|
|
13
|
-
'qti-assessment-test': 'assessmenttest',
|
|
14
|
-
'qti-item-body': 'itembody',
|
|
15
|
-
'qti-content-body': 'contentbody',
|
|
16
|
-
'qti-test-part': 'testpart',
|
|
17
|
-
'qti-assessment-section': 'assessmentsection',
|
|
18
|
-
'qti-assessment-item-ref': 'assessmentitemref',
|
|
19
|
-
'qti-assessment-stimulus-ref': 'assessmentstimulusref',
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Test structure elements
|
|
23
|
-
*/
|
|
24
|
-
export const TEST_STRUCTURE_ELEMENTS = {
|
|
25
|
-
'qti-assessment-section-ref': 'assessmentsectionref',
|
|
26
|
-
'qti-item-session-control': 'itemsessioncontrol',
|
|
27
|
-
'qti-time-limits': 'timelimits',
|
|
28
|
-
'qti-selection': 'selection',
|
|
29
|
-
'qti-ordering': 'ordering',
|
|
30
|
-
'qti-branch-rule': 'branchrule',
|
|
31
|
-
'qti-pre-condition': 'precondition',
|
|
32
|
-
'qti-test-feedback': 'testfeedback',
|
|
33
|
-
'qti-template-default': 'templatedefault',
|
|
34
|
-
'qti-variable-mapping': 'variablemapping',
|
|
35
|
-
'qti-weight': 'weight',
|
|
36
|
-
'qti-outcome-processing-fragment': 'outcomeprocessingfragment',
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Shared stimulus elements
|
|
40
|
-
*/
|
|
41
|
-
export const STIMULUS_ELEMENTS = {
|
|
42
|
-
'qti-assessment-stimulus': 'assessmentstimulus',
|
|
43
|
-
'qti-stimulus-body': 'stimulusbody',
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* Variable declaration elements
|
|
47
|
-
*/
|
|
48
|
-
export const DECLARATION_ELEMENTS = {
|
|
49
|
-
'qti-response-declaration': 'responsedeclaration',
|
|
50
|
-
'qti-outcome-declaration': 'outcomedeclaration',
|
|
51
|
-
'qti-template-declaration': 'templatedeclaration',
|
|
52
|
-
'qti-context-declaration': 'contextdeclaration',
|
|
53
|
-
'qti-correct-response': 'correctresponse',
|
|
54
|
-
'qti-default-value': 'defaultvalue',
|
|
55
|
-
'qti-value': 'value',
|
|
56
|
-
'qti-mapping': 'mapping',
|
|
57
|
-
'qti-map-entry': 'mapentry',
|
|
58
|
-
'qti-area-mapping': 'areamapping',
|
|
59
|
-
'qti-area-map-entry': 'areamapentry',
|
|
60
|
-
'qti-match-table': 'matchtable',
|
|
61
|
-
'qti-match-table-entry': 'matchtableentry',
|
|
62
|
-
'qti-interpolation-table': 'interpolationtable',
|
|
63
|
-
'qti-interpolation-table-entry': 'interpolationtableentry',
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* All 23+ interaction types (block and inline)
|
|
67
|
-
*/
|
|
68
|
-
export const INTERACTION_ELEMENTS = {
|
|
69
|
-
// Block interactions
|
|
70
|
-
'qti-choice-interaction': 'choiceinteraction',
|
|
71
|
-
'qti-match-interaction': 'matchinteraction',
|
|
72
|
-
'qti-order-interaction': 'orderinteraction',
|
|
73
|
-
'qti-gap-match-interaction': 'gapmatchinteraction',
|
|
74
|
-
'qti-graphic-gap-match-interaction': 'graphicgapmatchinteraction',
|
|
75
|
-
'qti-hotspot-interaction': 'hotspotinteraction',
|
|
76
|
-
'qti-hottext-interaction': 'hottextinteraction',
|
|
77
|
-
'qti-extended-text-interaction': 'extendedtextinteraction',
|
|
78
|
-
'qti-media-interaction': 'mediainteraction',
|
|
79
|
-
'qti-select-point-interaction': 'selectpointinteraction',
|
|
80
|
-
'qti-custom-interaction': 'custominteraction',
|
|
81
|
-
'qti-portable-custom-interaction': 'portablecustominteraction',
|
|
82
|
-
'qti-end-attempt-interaction': 'endattemptinteraction',
|
|
83
|
-
'qti-slider-interaction': 'sliderinteraction',
|
|
84
|
-
'qti-drawing-interaction': 'drawinginteraction',
|
|
85
|
-
'qti-upload-interaction': 'uploadinteraction',
|
|
86
|
-
'qti-position-object-interaction': 'positionobjectinteraction',
|
|
87
|
-
'qti-graphic-order-interaction': 'graphicorderinteraction',
|
|
88
|
-
'qti-graphic-associate-interaction': 'graphicassociateinteraction',
|
|
89
|
-
'qti-associate-interaction': 'associateinteraction',
|
|
90
|
-
// Inline interactions
|
|
91
|
-
'qti-text-entry-interaction': 'textentryinteraction',
|
|
92
|
-
'qti-inline-choice-interaction': 'inlinechoiceinteraction',
|
|
93
|
-
};
|
|
94
|
-
/**
|
|
95
|
-
* Interaction child elements
|
|
96
|
-
*/
|
|
97
|
-
export const INTERACTION_CHILD_ELEMENTS = {
|
|
98
|
-
'qti-prompt': 'prompt',
|
|
99
|
-
'qti-simple-choice': 'simplechoice',
|
|
100
|
-
'qti-simple-match-set': 'simplematchset',
|
|
101
|
-
'qti-simple-associable-choice': 'simpleassociablechoice',
|
|
102
|
-
'qti-gap': 'gap',
|
|
103
|
-
'qti-gap-text': 'gaptext',
|
|
104
|
-
'qti-gap-img': 'gapimg',
|
|
105
|
-
'qti-hotspot-choice': 'hotspotchoice',
|
|
106
|
-
'qti-associable-hotspot': 'associablehotspot',
|
|
107
|
-
'qti-hottext': 'hottext',
|
|
108
|
-
'qti-inline-choice': 'inlinechoice',
|
|
109
|
-
'qti-position-object-stage': 'positionobjectstage',
|
|
110
|
-
};
|
|
111
|
-
/**
|
|
112
|
-
* Response processing elements
|
|
113
|
-
*/
|
|
114
|
-
export const RESPONSE_PROCESSING_ELEMENTS = {
|
|
115
|
-
'qti-response-processing': 'responseprocessing',
|
|
116
|
-
'qti-response-condition': 'responsecondition',
|
|
117
|
-
'qti-response-if': 'responseif',
|
|
118
|
-
'qti-response-else-if': 'responseelseif',
|
|
119
|
-
'qti-response-else': 'responseelse',
|
|
120
|
-
'qti-response-processing-fragment': 'responseprocessingfragment',
|
|
121
|
-
'qti-exit-response': 'exitresponse',
|
|
122
|
-
'qti-set-outcome-value': 'setoutcomevalue',
|
|
123
|
-
'qti-lookup-outcome-value': 'lookupoutcomevalue',
|
|
124
|
-
'qti-set-correct-response': 'setcorrectresponse',
|
|
125
|
-
'qti-set-default-value': 'setdefaultvalue',
|
|
126
|
-
};
|
|
127
|
-
/**
|
|
128
|
-
* Template processing elements
|
|
129
|
-
*/
|
|
130
|
-
export const TEMPLATE_PROCESSING_ELEMENTS = {
|
|
131
|
-
'qti-template-processing': 'templateprocessing',
|
|
132
|
-
'qti-template-condition': 'templatecondition',
|
|
133
|
-
'qti-template-if': 'templateif',
|
|
134
|
-
'qti-template-else-if': 'templateelseif',
|
|
135
|
-
'qti-template-else': 'templateelse',
|
|
136
|
-
'qti-template-constraint': 'templateconstraint',
|
|
137
|
-
'qti-set-template-value': 'settemplatevalue',
|
|
138
|
-
'qti-exit-template': 'exittemplate',
|
|
139
|
-
'qti-template-block': 'templateblock',
|
|
140
|
-
'qti-template-inline': 'templateinline',
|
|
141
|
-
};
|
|
142
|
-
/**
|
|
143
|
-
* Outcome processing elements (test-level)
|
|
144
|
-
*/
|
|
145
|
-
export const OUTCOME_PROCESSING_ELEMENTS = {
|
|
146
|
-
'qti-outcome-processing': 'outcomeprocessing',
|
|
147
|
-
'qti-outcome-condition': 'outcomecondition',
|
|
148
|
-
'qti-outcome-if': 'outcomeif',
|
|
149
|
-
'qti-outcome-else-if': 'outcomeelseif',
|
|
150
|
-
'qti-outcome-else': 'outcomeelse',
|
|
151
|
-
'qti-exit-test': 'exittest',
|
|
152
|
-
};
|
|
153
|
-
/**
|
|
154
|
-
* Expression elements (54+ operators)
|
|
155
|
-
*/
|
|
156
|
-
export const EXPRESSION_ELEMENTS = {
|
|
157
|
-
// Variable expressions
|
|
158
|
-
'qti-variable': 'variable',
|
|
159
|
-
'qti-correct': 'correct',
|
|
160
|
-
'qti-default': 'default',
|
|
161
|
-
'qti-base-value': 'basevalue',
|
|
162
|
-
'qti-field-value': 'fieldvalue',
|
|
163
|
-
'qti-custom-operator': 'customoperator',
|
|
164
|
-
'qti-index': 'index',
|
|
165
|
-
'qti-contains': 'contains',
|
|
166
|
-
'qti-member': 'member',
|
|
167
|
-
'qti-null': 'null',
|
|
168
|
-
// Comparison operators
|
|
169
|
-
'qti-equal': 'equal',
|
|
170
|
-
'qti-equal-rounded': 'equalrounded',
|
|
171
|
-
'qti-gt': 'gt',
|
|
172
|
-
'qti-gte': 'gte',
|
|
173
|
-
'qti-lt': 'lt',
|
|
174
|
-
'qti-lte': 'lte',
|
|
175
|
-
// Logical operators
|
|
176
|
-
'qti-and': 'and',
|
|
177
|
-
'qti-or': 'or',
|
|
178
|
-
'qti-not': 'not',
|
|
179
|
-
'qti-any-n': 'anyn',
|
|
180
|
-
'qti-multiple': 'multiple',
|
|
181
|
-
'qti-ordered': 'ordered',
|
|
182
|
-
// String operators
|
|
183
|
-
'qti-string-match': 'stringmatch',
|
|
184
|
-
'qti-pattern-match': 'patternmatch',
|
|
185
|
-
'qti-substring': 'substring',
|
|
186
|
-
'qti-repeat': 'repeat',
|
|
187
|
-
// Matching operators
|
|
188
|
-
'qti-match': 'match',
|
|
189
|
-
'qti-inside': 'inside',
|
|
190
|
-
'qti-map-response': 'mapresponse',
|
|
191
|
-
'qti-map-response-point': 'mapresponsepoint',
|
|
192
|
-
// Numeric operators
|
|
193
|
-
'qti-sum': 'sum',
|
|
194
|
-
'qti-product': 'product',
|
|
195
|
-
'qti-subtract': 'subtract',
|
|
196
|
-
'qti-divide': 'divide',
|
|
197
|
-
'qti-integer-divide': 'integerdivide',
|
|
198
|
-
'qti-integer-modulus': 'integermodulus',
|
|
199
|
-
'qti-round': 'round',
|
|
200
|
-
'qti-round-to': 'roundto',
|
|
201
|
-
'qti-truncate': 'truncate',
|
|
202
|
-
// Math functions
|
|
203
|
-
'qti-math-operator': 'mathoperator',
|
|
204
|
-
'qti-math-constant': 'mathconstant',
|
|
205
|
-
'qti-power': 'power',
|
|
206
|
-
'qti-gcd': 'gcd',
|
|
207
|
-
'qti-lcm': 'lcm',
|
|
208
|
-
// Statistical operators
|
|
209
|
-
'qti-stats-operator': 'statsoperator',
|
|
210
|
-
'qti-min': 'min',
|
|
211
|
-
'qti-max': 'max',
|
|
212
|
-
'qti-container-size': 'containersize',
|
|
213
|
-
'qti-delete': 'delete',
|
|
214
|
-
'qti-is-null': 'isnull',
|
|
215
|
-
'qti-random': 'random',
|
|
216
|
-
'qti-random-integer': 'randominteger',
|
|
217
|
-
'qti-random-float': 'randomfloat',
|
|
218
|
-
// Test-level expressions
|
|
219
|
-
'qti-test-variables': 'testvariables',
|
|
220
|
-
'qti-outcome-maximum': 'outcomemaximum',
|
|
221
|
-
'qti-outcome-minimum': 'outcomeminimum',
|
|
222
|
-
'qti-number-correct': 'numbercorrect',
|
|
223
|
-
'qti-number-incorrect': 'numberincorrect',
|
|
224
|
-
'qti-number-presented': 'numberpresented',
|
|
225
|
-
'qti-number-responded': 'numberresponded',
|
|
226
|
-
'qti-number-selected': 'numberselected',
|
|
227
|
-
// Type conversion
|
|
228
|
-
'qti-integer-to-float': 'integertofloat',
|
|
229
|
-
// Duration operators (QTI 2 durationGTE and durationLT)
|
|
230
|
-
'qti-duration-gte': 'durationgte',
|
|
231
|
-
'qti-duration-lt': 'durationlt',
|
|
232
|
-
};
|
|
233
|
-
/**
|
|
234
|
-
* Feedback elements
|
|
235
|
-
*/
|
|
236
|
-
export const FEEDBACK_ELEMENTS = {
|
|
237
|
-
'qti-modal-feedback': 'modalfeedback',
|
|
238
|
-
'qti-feedback-block': 'feedbackblock',
|
|
239
|
-
'qti-feedback-inline': 'feedbackinline',
|
|
240
|
-
'qti-rubric-block': 'rubricblock',
|
|
241
|
-
};
|
|
242
|
-
/**
|
|
243
|
-
* PCI (Portable Custom Interaction) elements
|
|
244
|
-
*/
|
|
245
|
-
export const PCI_ELEMENTS = {
|
|
246
|
-
'qti-interaction-modules': 'interactionmodules',
|
|
247
|
-
'qti-interaction-module': 'interactionmodule',
|
|
248
|
-
'qti-interaction-markup': 'interactionmarkup',
|
|
249
|
-
};
|
|
250
|
-
/**
|
|
251
|
-
* Catalog elements (accessibility support)
|
|
252
|
-
*/
|
|
253
|
-
export const CATALOG_ELEMENTS = {
|
|
254
|
-
'qti-catalog': 'catalog',
|
|
255
|
-
'qti-catalog-info': 'cataloginfo',
|
|
256
|
-
'qti-card': 'card',
|
|
257
|
-
'qti-card-entry': 'cardentry',
|
|
258
|
-
'qti-html-content': 'htmlcontent',
|
|
259
|
-
'qti-file-href': 'filehref',
|
|
260
|
-
};
|
|
261
|
-
/**
|
|
262
|
-
* Other content elements
|
|
263
|
-
*/
|
|
264
|
-
export const CONTENT_ELEMENTS = {
|
|
265
|
-
'qti-printed-variable': 'printedvariable',
|
|
266
|
-
'qti-context-variable': 'contextvariable',
|
|
267
|
-
'qti-template-variable': 'templatevariable',
|
|
268
|
-
'qti-stylesheet': 'stylesheet',
|
|
269
|
-
};
|
|
270
|
-
/**
|
|
271
|
-
* Companion materials (calculators, rulers, protractors, reference material)
|
|
272
|
-
*/
|
|
273
|
-
export const COMPANION_MATERIAL_ELEMENTS = {
|
|
274
|
-
'qti-companion-materials-info': 'companionmaterialsinfo',
|
|
275
|
-
'qti-calculator': 'calculator',
|
|
276
|
-
'qti-calculator-info': 'calculatorinfo',
|
|
277
|
-
'qti-calculator-type': 'calculatortype',
|
|
278
|
-
'qti-description': 'description',
|
|
279
|
-
'qti-digital-material': 'digitalmaterial',
|
|
280
|
-
'qti-physical-material': 'physicalmaterial',
|
|
281
|
-
'qti-label': 'label',
|
|
282
|
-
'qti-protractor': 'protractor',
|
|
283
|
-
'qti-rule': 'rule',
|
|
284
|
-
'qti-rule-system-si': 'rulesystemsi',
|
|
285
|
-
'qti-rule-system-us': 'rulesystemus',
|
|
286
|
-
'qti-increment-si': 'incrementsi',
|
|
287
|
-
'qti-increment-us': 'incrementus',
|
|
288
|
-
'qti-major-increment': 'majorincrement',
|
|
289
|
-
'qti-minor-increment': 'minorincrement',
|
|
290
|
-
'qti-minimum-length': 'minimumlength',
|
|
291
|
-
};
|
|
292
|
-
/**
|
|
293
|
-
* Adaptive delivery and metadata references
|
|
294
|
-
*/
|
|
295
|
-
export const REFERENCE_ELEMENTS = {
|
|
296
|
-
'qti-adaptive-selection': 'adaptiveselection',
|
|
297
|
-
'qti-adaptive-engine-ref': 'adaptiveengineref',
|
|
298
|
-
'qti-adaptive-settings-ref': 'adaptivesettingsref',
|
|
299
|
-
'qti-metadata-ref': 'metadataref',
|
|
300
|
-
'qti-usagedata-ref': 'usagedataref',
|
|
301
|
-
'qti-resource-icon': 'resourceicon',
|
|
302
|
-
};
|
|
303
|
-
/**
|
|
304
|
-
* Complete mapping of all QTI 3.0 elements to canonical form
|
|
305
|
-
*/
|
|
306
|
-
export const QTI3_ELEMENT_MAPPINGS = {
|
|
307
|
-
...CORE_ELEMENTS,
|
|
308
|
-
...TEST_STRUCTURE_ELEMENTS,
|
|
309
|
-
...STIMULUS_ELEMENTS,
|
|
310
|
-
...DECLARATION_ELEMENTS,
|
|
311
|
-
...INTERACTION_ELEMENTS,
|
|
312
|
-
...INTERACTION_CHILD_ELEMENTS,
|
|
313
|
-
...RESPONSE_PROCESSING_ELEMENTS,
|
|
314
|
-
...TEMPLATE_PROCESSING_ELEMENTS,
|
|
315
|
-
...OUTCOME_PROCESSING_ELEMENTS,
|
|
316
|
-
...EXPRESSION_ELEMENTS,
|
|
317
|
-
...FEEDBACK_ELEMENTS,
|
|
318
|
-
...PCI_ELEMENTS,
|
|
319
|
-
...CATALOG_ELEMENTS,
|
|
320
|
-
...CONTENT_ELEMENTS,
|
|
321
|
-
...COMPANION_MATERIAL_ELEMENTS,
|
|
322
|
-
...REFERENCE_ELEMENTS,
|
|
323
|
-
};
|
|
324
|
-
/**
|
|
325
|
-
* Get canonical name for a QTI 3.0 element
|
|
326
|
-
*/
|
|
327
|
-
export function getCanonicalName(qti3ElementName) {
|
|
328
|
-
return QTI3_ELEMENT_MAPPINGS[qti3ElementName];
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* Check if an element name is a valid QTI 3.0 element
|
|
332
|
-
*/
|
|
333
|
-
export function isQti3Element(elementName) {
|
|
334
|
-
return elementName in QTI3_ELEMENT_MAPPINGS;
|
|
335
|
-
}
|
|
336
|
-
/**
|
|
337
|
-
* Get all QTI 3.0 interaction element names
|
|
338
|
-
*/
|
|
339
|
-
export function getInteractionElements() {
|
|
340
|
-
return Object.keys(INTERACTION_ELEMENTS);
|
|
341
|
-
}
|
|
342
|
-
/**
|
|
343
|
-
* Common QTI 3.0 attribute names (kebab-case)
|
|
344
|
-
*/
|
|
345
|
-
export const QTI3_ATTRIBUTES = {
|
|
346
|
-
// Identifiers
|
|
347
|
-
identifier: 'identifier',
|
|
348
|
-
responseIdentifier: 'response-identifier',
|
|
349
|
-
outcomeIdentifier: 'outcome-identifier',
|
|
350
|
-
templateIdentifier: 'template-identifier',
|
|
351
|
-
// Types
|
|
352
|
-
baseType: 'base-type',
|
|
353
|
-
cardinality: 'cardinality',
|
|
354
|
-
// Interaction attributes
|
|
355
|
-
minChoices: 'min-choices',
|
|
356
|
-
maxChoices: 'max-choices',
|
|
357
|
-
shuffle: 'shuffle',
|
|
358
|
-
fixed: 'fixed',
|
|
359
|
-
// Feedback attributes
|
|
360
|
-
showHide: 'show-hide',
|
|
361
|
-
// Outcome attributes
|
|
362
|
-
normalMaximum: 'normal-maximum',
|
|
363
|
-
normalMinimum: 'normal-minimum',
|
|
364
|
-
// Template attributes
|
|
365
|
-
mathVariable: 'math-variable',
|
|
366
|
-
paramVariable: 'param-variable',
|
|
367
|
-
// Assessment attributes
|
|
368
|
-
timeDependent: 'time-dependent',
|
|
369
|
-
adaptive: 'adaptive',
|
|
370
|
-
// Text interaction attributes
|
|
371
|
-
expectedLength: 'expected-length',
|
|
372
|
-
patternMask: 'pattern-mask',
|
|
373
|
-
placeholderText: 'placeholder-text',
|
|
374
|
-
minStrings: 'min-strings',
|
|
375
|
-
maxStrings: 'max-strings',
|
|
376
|
-
// Other
|
|
377
|
-
fieldIdentifier: 'field-identifier',
|
|
378
|
-
toleranceMode: 'tolerance-mode',
|
|
379
|
-
dataCatalogIdref: 'data-catalog-idref', // AMP extension
|
|
380
|
-
};
|
|
381
|
-
//# 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;;;;;;GAMG;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,EAAE,mBAAmB;IAC7C,yBAAyB,EAAE,mBAAmB;IAC9C,6BAA6B,EAAE,uBAAuB;CAC7C,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACtC,4BAA4B,EAAE,sBAAsB;IACpD,0BAA0B,EAAE,oBAAoB;IAChD,iBAAiB,EAAE,YAAY;IAC/B,eAAe,EAAE,WAAW;IAC5B,cAAc,EAAE,UAAU;IAC1B,iBAAiB,EAAE,YAAY;IAC/B,mBAAmB,EAAE,cAAc;IACnC,mBAAmB,EAAE,cAAc;IACnC,sBAAsB,EAAE,iBAAiB;IACzC,sBAAsB,EAAE,iBAAiB;IACzC,YAAY,EAAE,QAAQ;IACtB,iCAAiC,EAAE,2BAA2B;CACrD,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC,yBAAyB,EAAE,oBAAoB;IAC/C,mBAAmB,EAAE,cAAc;CAC1B,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,oB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gBAAgB,EAAE,oBAAoB,EAAE,gBAAgB;CAC/C,CAAC","sourcesContent":["/**\n * QTI 3.0 element name mappings: every `qti-*` element of the 1EdTech QTI 3.0 ASI schema,\n * mapped to its lowercase canonical name. `qti3-xsd-conformance.test.ts` checks the map\n * against the schema vendored in `schemas/qti3/`, in both directions.\n *\n * XHTML and HTML5 content elements keep their unprefixed names in QTI 3 and are not listed.\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 * Test structure elements\n */\nexport const TEST_STRUCTURE_ELEMENTS = {\n\t'qti-assessment-section-ref': 'assessmentsectionref',\n\t'qti-item-session-control': 'itemsessioncontrol',\n\t'qti-time-limits': 'timelimits',\n\t'qti-selection': 'selection',\n\t'qti-ordering': 'ordering',\n\t'qti-branch-rule': 'branchrule',\n\t'qti-pre-condition': 'precondition',\n\t'qti-test-feedback': 'testfeedback',\n\t'qti-template-default': 'templatedefault',\n\t'qti-variable-mapping': 'variablemapping',\n\t'qti-weight': 'weight',\n\t'qti-outcome-processing-fragment': 'outcomeprocessingfragment',\n} as const;\n\n/**\n * Shared stimulus elements\n */\nexport const STIMULUS_ELEMENTS = {\n\t'qti-assessment-stimulus': 'assessmentstimulus',\n\t'qti-stimulus-body': 'stimulusbody',\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-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// Type conversion\n\t'qti-integer-to-float': 'integertofloat',\n\n\t// Duration operators (QTI 2 durationGTE and durationLT)\n\t'qti-duration-gte': 'durationgte',\n\t'qti-duration-lt': 'durationlt',\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} 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} 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} as const;\n\n/**\n * Companion materials (calculators, rulers, protractors, reference material)\n */\nexport const COMPANION_MATERIAL_ELEMENTS = {\n\t'qti-companion-materials-info': 'companionmaterialsinfo',\n\t'qti-calculator': 'calculator',\n\t'qti-calculator-info': 'calculatorinfo',\n\t'qti-calculator-type': 'calculatortype',\n\t'qti-description': 'description',\n\t'qti-digital-material': 'digitalmaterial',\n\t'qti-physical-material': 'physicalmaterial',\n\t'qti-label': 'label',\n\t'qti-protractor': 'protractor',\n\t'qti-rule': 'rule',\n\t'qti-rule-system-si': 'rulesystemsi',\n\t'qti-rule-system-us': 'rulesystemus',\n\t'qti-increment-si': 'incrementsi',\n\t'qti-increment-us': 'incrementus',\n\t'qti-major-increment': 'majorincrement',\n\t'qti-minor-increment': 'minorincrement',\n\t'qti-minimum-length': 'minimumlength',\n} as const;\n\n/**\n * Adaptive delivery and metadata references\n */\nexport const REFERENCE_ELEMENTS = {\n\t'qti-adaptive-selection': 'adaptiveselection',\n\t'qti-adaptive-engine-ref': 'adaptiveengineref',\n\t'qti-adaptive-settings-ref': 'adaptivesettingsref',\n\t'qti-metadata-ref': 'metadataref',\n\t'qti-usagedata-ref': 'usagedataref',\n\t'qti-resource-icon': 'resourceicon',\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...TEST_STRUCTURE_ELEMENTS,\n\t...STIMULUS_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\t...COMPANION_MATERIAL_ELEMENTS,\n\t...REFERENCE_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,15 +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 { convertQti2ToQti3, QTI3_ASI_SCHEMA_LOCATION, QTI3_NAMESPACE, QTI3_RPTEMPLATE_BASE, } from './element-mapper/qti2-to-qti3.js';
|
|
9
|
-
export { detectQtiVersion } from './version-detection/detectQtiVersion.js';
|
|
10
|
-
export type { QtiVersion } from './version-detection/detectQtiVersion.js';
|
|
11
|
-
export { getAttribute, getBooleanAttribute, getNumberAttribute, hasAttribute, toCamelCase, toKebabCase, } from './xml/attributes.js';
|
|
12
|
-
export { assignProps, type AssignPropsOptions } from './dom/assignProps.js';
|
|
13
|
-
export { createSvelteMountController, type SvelteMountController, type SvelteMountControllerOptions, } from './dom/svelteMountController.js';
|
|
14
|
-
export { touchDrag, touchDragStyles } from './dom/touchDrag.js';
|
|
15
|
-
export { createQtiParser, createMapperForVersion, createAttributeMapperForVersion, isQti2, isQti3, type QtiParserResult, type CreateParserOptions, } from './parser-factory.js';
|
package/dist/index.js
DELETED
|
@@ -1,17 +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
|
-
export { convertQti2ToQti3, QTI3_ASI_SCHEMA_LOCATION, QTI3_NAMESPACE, QTI3_RPTEMPLATE_BASE, } from './element-mapper/qti2-to-qti3.js';
|
|
7
|
-
// Version detection
|
|
8
|
-
export { detectQtiVersion } from './version-detection/detectQtiVersion.js';
|
|
9
|
-
// XML attribute utilities
|
|
10
|
-
export { getAttribute, getBooleanAttribute, getNumberAttribute, hasAttribute, toCamelCase, toKebabCase, } from './xml/attributes.js';
|
|
11
|
-
// DOM utility helpers shared across player packages
|
|
12
|
-
export { assignProps } from './dom/assignProps.js';
|
|
13
|
-
export { createSvelteMountController, } from './dom/svelteMountController.js';
|
|
14
|
-
export { touchDrag, touchDragStyles } from './dom/touchDrag.js';
|
|
15
|
-
// Parser factory
|
|
16
|
-
export { createQtiParser, createMapperForVersion, createAttributeMapperForVersion, isQti2, isQti3, } from './parser-factory.js';
|
|
17
|
-
//# 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;AAChD,OAAO,EACN,iBAAiB,EACjB,wBAAwB,EACxB,cAAc,EACd,oBAAoB,GACpB,MAAM,kCAAkC,CAAC;AAE1C,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';\nexport {\n\tconvertQti2ToQti3,\n\tQTI3_ASI_SCHEMA_LOCATION,\n\tQTI3_NAMESPACE,\n\tQTI3_RPTEMPLATE_BASE,\n} from './element-mapper/qti2-to-qti3.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"]}
|
package/dist/parser-factory.d.ts
DELETED
|
@@ -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;
|