@qti-editor/interaction-select-point 1.1.0 → 1.2.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/dist/components/qti-select-point-interaction/qti-select-point-interaction.compose.d.ts.map +1 -1
- package/dist/components/qti-select-point-interaction/qti-select-point-interaction.compose.js +2 -0
- package/dist/components/qti-select-point-interaction/qti-select-point-interaction.schema.d.ts.map +1 -1
- package/dist/components/qti-select-point-interaction/qti-select-point-interaction.schema.js +4 -0
- package/dist/composer/metadata.d.ts +6 -0
- package/dist/composer/metadata.d.ts.map +1 -1
- package/dist/composer/metadata.js +3 -2
- package/dist/descriptor.d.ts +6 -0
- package/dist/descriptor.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/components/qti-select-point-interaction/qti-select-point-interaction.compose.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qti-select-point-interaction.compose.d.ts","sourceRoot":"","sources":["../../../src/components/qti-select-point-interaction/qti-select-point-interaction.compose.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAmB,wBAAwB,EAAmD,MAAM,kDAAkD,CAAC;AA8FnK,wBAAgB,oCAAoC,CAAC,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAG,wBAAwB,
|
|
1
|
+
{"version":3,"file":"qti-select-point-interaction.compose.d.ts","sourceRoot":"","sources":["../../../src/components/qti-select-point-interaction/qti-select-point-interaction.compose.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAmB,wBAAwB,EAAmD,MAAM,kDAAkD,CAAC;AA8FnK,wBAAgB,oCAAoC,CAAC,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAG,wBAAwB,CAoFvH"}
|
package/dist/components/qti-select-point-interaction/qti-select-point-interaction.compose.js
CHANGED
|
@@ -84,6 +84,7 @@ export function composeSelectPointInteractionElement(sourceElement, xmlDoc) {
|
|
|
84
84
|
const responseIdentifier = toNonEmptyString(sourceElement.getAttribute('response-identifier'));
|
|
85
85
|
const maxChoices = toFiniteNumber(sourceElement.getAttribute('max-choices'), 1);
|
|
86
86
|
const minChoices = toFiniteNumber(sourceElement.getAttribute('min-choices'), 0);
|
|
87
|
+
const score = toFiniteNumber(sourceElement.getAttribute('score'), 1);
|
|
87
88
|
const promptFromChild = sourceElement.querySelector('qti-prompt')?.textContent;
|
|
88
89
|
const prompt = toNonEmptyString(promptFromChild ?? null);
|
|
89
90
|
const imageElement = sourceElement.querySelector('img');
|
|
@@ -141,6 +142,7 @@ export function composeSelectPointInteractionElement(sourceElement, xmlDoc) {
|
|
|
141
142
|
correctResponse: correctResponse ?? undefined,
|
|
142
143
|
areaMapping: areaMappingResult.areaMapping,
|
|
143
144
|
sourceTag: metadata.tagName,
|
|
145
|
+
score,
|
|
144
146
|
};
|
|
145
147
|
}
|
|
146
148
|
return {
|
package/dist/components/qti-select-point-interaction/qti-select-point-interaction.schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qti-select-point-interaction.schema.d.ts","sourceRoot":"","sources":["../../../src/components/qti-select-point-interaction/qti-select-point-interaction.schema.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA0C,QAAQ,EAAU,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"qti-select-point-interaction.schema.d.ts","sourceRoot":"","sources":["../../../src/components/qti-select-point-interaction/qti-select-point-interaction.schema.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAA0C,QAAQ,EAAU,MAAM,mBAAmB,CAAC;AAwElG,eAAO,MAAM,iCAAiC,EAAE,QA6C/C,CAAC"}
|
|
@@ -14,6 +14,7 @@ function isElementLike(node) {
|
|
|
14
14
|
typeof node.querySelector === 'function');
|
|
15
15
|
}
|
|
16
16
|
function parseWrapperAttrs(node) {
|
|
17
|
+
const scoreAttr = node.getAttribute('score');
|
|
17
18
|
return {
|
|
18
19
|
responseIdentifier: node.getAttribute('response-identifier'),
|
|
19
20
|
maxChoices: parseNumberAttribute(node.getAttribute('max-choices')) ?? 0,
|
|
@@ -21,6 +22,7 @@ function parseWrapperAttrs(node) {
|
|
|
21
22
|
class: node.getAttribute('class') || null,
|
|
22
23
|
areaMappings: node.getAttribute('area-mappings') || '[]',
|
|
23
24
|
correctResponse: node.getAttribute('correct-response') || null,
|
|
25
|
+
score: scoreAttr && Number.isFinite(Number(scoreAttr)) ? Number(scoreAttr) : 1,
|
|
24
26
|
};
|
|
25
27
|
}
|
|
26
28
|
function buildPromptNode(schema, node) {
|
|
@@ -61,6 +63,7 @@ export const qtiSelectPointInteractionNodeSpec = {
|
|
|
61
63
|
class: { default: null },
|
|
62
64
|
areaMappings: { default: '[]' },
|
|
63
65
|
correctResponse: { default: null },
|
|
66
|
+
score: { default: 1 },
|
|
64
67
|
},
|
|
65
68
|
parseDOM: [
|
|
66
69
|
{
|
|
@@ -93,6 +96,7 @@ export const qtiSelectPointInteractionNodeSpec = {
|
|
|
93
96
|
attrs['area-mappings'] = String(node.attrs.areaMappings);
|
|
94
97
|
if (node.attrs.correctResponse)
|
|
95
98
|
attrs['correct-response'] = String(node.attrs.correctResponse);
|
|
99
|
+
attrs.score = String(node.attrs.score ?? 1);
|
|
96
100
|
return ['qti-select-point-interaction', attrs, 0];
|
|
97
101
|
},
|
|
98
102
|
};
|
|
@@ -17,6 +17,12 @@ export declare const selectPointNodeAttributePanelMetadataByNodeTypeName: {
|
|
|
17
17
|
[x: string]: {
|
|
18
18
|
nodeTypeName: "qtiSelectPointInteraction";
|
|
19
19
|
editableAttributes: string[];
|
|
20
|
+
fields: {
|
|
21
|
+
score: {
|
|
22
|
+
label: string;
|
|
23
|
+
input: "number";
|
|
24
|
+
};
|
|
25
|
+
};
|
|
20
26
|
};
|
|
21
27
|
};
|
|
22
28
|
//# sourceMappingURL=metadata.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/composer/metadata.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,2BAA2B,gFACuC,CAAC;AAWhF,eAAO,MAAM,4BAA4B,EAAG,8BAAuC,CAAC;AACpF,eAAO,MAAM,kCAAkC,EAAG,2BAAoC,CAAC;AAEvF,eAAO,MAAM,sCAAsC;;;;;;;;;;;CAWZ,CAAC;AAExC,eAAO,MAAM,mDAAmD
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/composer/metadata.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,2BAA2B,gFACuC,CAAC;AAWhF,eAAO,MAAM,4BAA4B,EAAG,8BAAuC,CAAC;AACpF,eAAO,MAAM,kCAAkC,EAAG,2BAAoC,CAAC;AAEvF,eAAO,MAAM,sCAAsC;;;;;;;;;;;CAWZ,CAAC;AAExC,eAAO,MAAM,mDAAmD;;;;;;;;;;;CAMV,CAAC"}
|
|
@@ -18,12 +18,13 @@ export const selectPointInteractionComposerMetadata = {
|
|
|
18
18
|
internalKind: 'map_response_point',
|
|
19
19
|
internalSourceXml: MAP_RESPONSE_POINT_INTERNAL_TEMPLATE,
|
|
20
20
|
},
|
|
21
|
-
editorOnlyAttributes: ['class', 'area-mappings', 'correct-response'],
|
|
22
|
-
userEditableAttributes: ['maxChoices', 'minChoices'],
|
|
21
|
+
editorOnlyAttributes: ['class', 'area-mappings', 'correct-response', 'score'],
|
|
22
|
+
userEditableAttributes: ['maxChoices', 'minChoices', 'score'],
|
|
23
23
|
};
|
|
24
24
|
export const selectPointNodeAttributePanelMetadataByNodeTypeName = {
|
|
25
25
|
[SELECT_POINT_INTERACTION_NODE_TYPE.toLowerCase()]: {
|
|
26
26
|
nodeTypeName: SELECT_POINT_INTERACTION_NODE_TYPE,
|
|
27
27
|
editableAttributes: selectPointInteractionComposerMetadata.userEditableAttributes,
|
|
28
|
+
fields: { score: { label: 'Score', input: 'number' } },
|
|
28
29
|
},
|
|
29
30
|
};
|
package/dist/descriptor.d.ts
CHANGED
package/dist/descriptor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor.d.ts","sourceRoot":"","sources":["../src/descriptor.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,gCAAgC
|
|
1
|
+
{"version":3,"file":"descriptor.d.ts","sourceRoot":"","sources":["../src/descriptor.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAYZ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qti-editor/interaction-select-point",
|
|
3
3
|
"description": "QTI select-point interaction schemas, components, commands, and composer",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/Citolab/qti-editor",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@qti-components/select-point-interaction": "^1.0.1",
|
|
25
|
-
"@qti-editor/interaction-shared": "1.
|
|
26
|
-
"@qti-editor/interfaces": "1.
|
|
25
|
+
"@qti-editor/interaction-shared": "1.3.0",
|
|
26
|
+
"@qti-editor/interfaces": "1.2.0",
|
|
27
27
|
"prosemirror-model": "^1.25.4",
|
|
28
28
|
"prosemirror-state": "^1.4.4",
|
|
29
29
|
"prosemirror-view": "^1.31.0"
|