@qti-components/elements 1.6.3 → 1.6.5
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-assessment-item/qti-assessment-item.d.ts +5 -10
- package/dist/components/qti-assessment-item/qti-assessment-item.js +15 -48
- package/dist/components/qti-assessment-item/qti-assessment-item.js.map +1 -1
- package/dist/components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.js +3 -7
- package/dist/components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.js.map +1 -1
- package/dist/components/qti-companion-materials-info/qti-companion-materials-info.js +2 -13
- package/dist/components/qti-companion-materials-info/qti-companion-materials-info.js.map +1 -1
- package/dist/components/qti-content-body/qti-content-body.js +6 -8
- package/dist/components/qti-content-body/qti-content-body.js.map +1 -1
- package/dist/components/qti-context-declaration/qti-context-declaration.js +3 -7
- package/dist/components/qti-context-declaration/qti-context-declaration.js.map +1 -1
- package/dist/components/qti-custom-operator/qti-custom-operator.js +3 -7
- package/dist/components/qti-custom-operator/qti-custom-operator.js.map +1 -1
- package/dist/components/qti-feedback-block/qti-feedback-block.js +2 -13
- package/dist/components/qti-feedback-block/qti-feedback-block.js.map +1 -1
- package/dist/components/qti-feedback-inline/qti-feedback-inline.js +2 -13
- package/dist/components/qti-feedback-inline/qti-feedback-inline.js.map +1 -1
- package/dist/components/qti-item-body/qti-item-body.js +2 -13
- package/dist/components/qti-item-body/qti-item-body.js.map +1 -1
- package/dist/components/qti-modal-feedback/qti-modal-feedback.js +12 -24
- package/dist/components/qti-modal-feedback/qti-modal-feedback.js.map +1 -1
- package/dist/components/qti-outcome-declaration/qti-outcome-declaration.js +3 -7
- package/dist/components/qti-outcome-declaration/qti-outcome-declaration.js.map +1 -1
- package/dist/components/qti-response-declaration/qti-response-declaration.js +3 -7
- package/dist/components/qti-response-declaration/qti-response-declaration.js.map +1 -1
- package/dist/components/qti-response-processing/qti-response-processing.d.ts +0 -1
- package/dist/components/qti-response-processing/qti-response-processing.js +22 -34
- package/dist/components/qti-response-processing/qti-response-processing.js.map +1 -1
- package/dist/components/qti-rubric-block/qti-rubric-block.js +3 -7
- package/dist/components/qti-rubric-block/qti-rubric-block.js.map +1 -1
- package/dist/components/qti-stylesheet/qti-stylesheet.js +2 -13
- package/dist/components/qti-stylesheet/qti-stylesheet.js.map +1 -1
- package/dist/components/qti-template-constraint/qti-template-constraint.js +2 -13
- package/dist/components/qti-template-constraint/qti-template-constraint.js.map +1 -1
- package/dist/components/qti-template-declaration/qti-template-declaration.js +3 -7
- package/dist/components/qti-template-declaration/qti-template-declaration.js.map +1 -1
- package/dist/components/qti-template-processing/qti-template-processing.js +2 -13
- package/dist/components/qti-template-processing/qti-template-processing.js.map +1 -1
- package/dist/elements.d.ts +74 -0
- package/dist/elements.js +40 -0
- package/dist/elements.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/template-strings.d.ts +3 -3
- package/dist/internal/template-strings.js +46 -52
- package/dist/internal/template-strings.js.map +1 -1
- package/dist/register.d.ts +1 -0
- package/dist/register.js +7 -0
- package/dist/register.js.map +1 -0
- package/package.json +22 -5
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
1
|
import { LitElement, html } from 'lit';
|
|
8
|
-
import { customElement } from 'lit/decorators.js';
|
|
9
2
|
/**
|
|
10
3
|
* @summary The qti-template-constraint element is a processing rule available only in Template Processing.
|
|
11
4
|
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-constraint
|
|
@@ -15,7 +8,7 @@ import { customElement } from 'lit/decorators.js';
|
|
|
15
8
|
* the Template Processing with different randomly-generated values until a predetermined
|
|
16
9
|
* condition is satisfied.
|
|
17
10
|
*/
|
|
18
|
-
|
|
11
|
+
export class QtiTemplateConstraint extends LitElement {
|
|
19
12
|
render() {
|
|
20
13
|
return html `<slot></slot>`;
|
|
21
14
|
}
|
|
@@ -55,9 +48,5 @@ let QtiTemplateConstraint = class QtiTemplateConstraint extends LitElement {
|
|
|
55
48
|
}
|
|
56
49
|
return constraintSatisfied;
|
|
57
50
|
}
|
|
58
|
-
}
|
|
59
|
-
QtiTemplateConstraint = __decorate([
|
|
60
|
-
customElement('qti-template-constraint')
|
|
61
|
-
], QtiTemplateConstraint);
|
|
62
|
-
export { QtiTemplateConstraint };
|
|
51
|
+
}
|
|
63
52
|
//# sourceMappingURL=qti-template-constraint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qti-template-constraint.js","sourceRoot":"","sources":["../../../src/components/qti-template-constraint/qti-template-constraint.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"qti-template-constraint.js","sourceRoot":"","sources":["../../../src/components/qti-template-constraint/qti-template-constraint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAKvC;;;;;;;;GAQG;AAEH,MAAM,OAAO,qBAAsB,SAAQ,UAAU;IAC1C,MAAM;QACb,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACI,SAAS;QACd,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,CAA6B,CAAC;QAEnE,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC7B,OAAO,CAAC,KAAK,CAAC,gEAAgE,CAAC,CAAC;YAChF,OAAO,IAAI,CAAC,CAAC,yBAAyB;QACxC,CAAC;QAED,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;YAC1C,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC;YAC9D,OAAO,IAAI,CAAC,CAAC,yBAAyB;QACxC,CAAC;IACH,CAAC;IAED;;OAEG;IACI,WAAW;QAChB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED;;;OAGG;IACI,OAAO;QACZ,MAAM,mBAAmB,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAE7C,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACzB,OAAO,CAAC,KAAK,CAAC,mEAAmE,CAAC,CAAC;QACrF,CAAC;QAED,OAAO,mBAAmB,CAAC;IAC7B,CAAC;CACF","sourcesContent":["import { LitElement, html } from 'lit';\n\nimport type { QtiExpression } from '@qti-components/base';\nimport type { QtiRuleBase } from '@qti-components/base';\n\n/**\n * @summary The qti-template-constraint element is a processing rule available only in Template Processing.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-constraint\n *\n * It terminates Template Processing and re-runs it from the beginning if the condition\n * specified in the template constraint is not satisfied. This can be used to iterate\n * the Template Processing with different randomly-generated values until a predetermined\n * condition is satisfied.\n */\n\nexport class QtiTemplateConstraint extends LitElement implements QtiRuleBase {\n override render() {\n return html`<slot></slot>`;\n }\n\n /**\n * Evaluates the constraint condition\n * @returns true if constraint is satisfied, false if template processing should restart\n */\n public calculate(): boolean {\n const expressions = [...this.children] as QtiExpression<boolean>[];\n\n if (expressions.length !== 1) {\n console.error('qti-template-constraint must have exactly one child expression');\n return true; // Don't restart on error\n }\n\n try {\n const result = expressions[0].calculate();\n return Boolean(result);\n } catch (error) {\n console.error('Error evaluating template constraint:', error);\n return true; // Don't restart on error\n }\n }\n\n /**\n * Template constraints don't have sub-rules like conditions\n */\n public getSubRules(): QtiRuleBase[] {\n return [];\n }\n\n /**\n * Process the template constraint\n * @returns true if constraint is satisfied, false if template processing should restart\n */\n public process(): boolean {\n const constraintSatisfied = this.calculate();\n\n if (!constraintSatisfied) {\n console.debug('Template constraint not satisfied, restarting template processing');\n }\n\n return constraintSatisfied;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-template-constraint': QtiTemplateConstraint;\n }\n}\n"]}
|
|
@@ -5,12 +5,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { css, LitElement, html } from 'lit';
|
|
8
|
-
import {
|
|
8
|
+
import { property } from 'lit/decorators.js';
|
|
9
9
|
/**
|
|
10
10
|
* @summary The qti-template-declaration element declares template variables for item cloning.
|
|
11
11
|
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-declaration
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
export class QtiTemplateDeclaration extends LitElement {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
16
|
this.identifier = '';
|
|
@@ -106,7 +106,7 @@ let QtiTemplateDeclaration = class QtiTemplateDeclaration extends LitElement {
|
|
|
106
106
|
paramVariable: this.paramVariable
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
}
|
|
109
|
+
}
|
|
110
110
|
__decorate([
|
|
111
111
|
property({ type: String })
|
|
112
112
|
], QtiTemplateDeclaration.prototype, "identifier", void 0);
|
|
@@ -122,8 +122,4 @@ __decorate([
|
|
|
122
122
|
__decorate([
|
|
123
123
|
property({ type: Boolean, attribute: 'param-variable' })
|
|
124
124
|
], QtiTemplateDeclaration.prototype, "paramVariable", void 0);
|
|
125
|
-
QtiTemplateDeclaration = __decorate([
|
|
126
|
-
customElement('qti-template-declaration')
|
|
127
|
-
], QtiTemplateDeclaration);
|
|
128
|
-
export { QtiTemplateDeclaration };
|
|
129
125
|
//# sourceMappingURL=qti-template-declaration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qti-template-declaration.js","sourceRoot":"","sources":["../../../src/components/qti-template-declaration/qti-template-declaration.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"qti-template-declaration.js","sourceRoot":"","sources":["../../../src/components/qti-template-declaration/qti-template-declaration.ts"],"names":[],"mappings":"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","sourcesContent":["import { css, LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport type { TemplateVariable } from '@qti-components/base';\nimport type { BaseType } from '@qti-components/base';\n\n/**\n * @summary The qti-template-declaration element declares template variables for item cloning.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-declaration\n */\n\nexport class QtiTemplateDeclaration extends LitElement {\n @property({ type: String }) identifier: string = '';\n @property({ type: String }) cardinality: 'single' | 'multiple' | 'ordered' | 'record' = 'single';\n @property({ type: String, attribute: 'base-type' }) baseType: BaseType = 'string';\n @property({ type: Boolean, attribute: 'math-variable' }) mathVariable: boolean = false;\n @property({ type: Boolean, attribute: 'param-variable' }) paramVariable: boolean = false;\n\n #defaultValue: any = null;\n\n static override styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n override render() {\n return html`<slot></slot>`;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.updateComplete.then(() => {\n this.#processDefaultValue();\n this.#registerTemplateVariable();\n });\n }\n\n /**\n * Process qti-default-value to extract the default value\n */\n #processDefaultValue(): void {\n const defaultValueElement = this.querySelector('qti-default-value');\n if (!defaultValueElement) {\n return;\n }\n\n // For now, just get the text content - this could be enhanced to handle expressions\n const textContent = defaultValueElement.textContent?.trim() || '';\n this.#defaultValue = this.#convertValue(textContent);\n }\n\n /**\n * Convert string value based on base-type\n */\n #convertValue(value: string): any {\n if (!value) return null;\n\n switch (this.baseType) {\n case 'integer':\n return parseInt(value, 10);\n case 'float':\n case 'duration':\n return parseFloat(value);\n case 'boolean':\n return value.toLowerCase() === 'true';\n case 'string':\n default:\n return value;\n }\n }\n\n /**\n * Register this template variable with the assessment item\n */\n #registerTemplateVariable(): void {\n const templateVariable: TemplateVariable = {\n identifier: this.identifier,\n cardinality: this.cardinality,\n baseType: this.baseType,\n defaultValue: this.#defaultValue,\n value: this.#defaultValue,\n type: 'template',\n mathVariable: this.mathVariable,\n paramVariable: this.paramVariable\n };\n\n // Dispatch event to register the variable\n\n // value must string or string[]\n const variable = { ...templateVariable, value: this.#defaultValue?.toString() || '' };\n this.dispatchEvent(\n new CustomEvent('qti-register-variable', {\n bubbles: true,\n composed: true,\n detail: { variable }\n })\n );\n }\n\n /**\n * Get the template variable definition\n */\n public getTemplateVariable(): TemplateVariable {\n return {\n identifier: this.identifier,\n cardinality: this.cardinality,\n baseType: this.baseType,\n value: this.#defaultValue,\n type: 'template',\n mathVariable: this.mathVariable,\n paramVariable: this.paramVariable\n };\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-template-declaration': QtiTemplateDeclaration;\n }\n}\n"]}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
1
|
import { css, html, LitElement } from 'lit';
|
|
8
|
-
import { customElement } from 'lit/decorators.js';
|
|
9
2
|
/**
|
|
10
3
|
* @summary The qti-template-processing element contains template processing rules.
|
|
11
4
|
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-processing
|
|
12
5
|
*/
|
|
13
|
-
|
|
6
|
+
export class QtiTemplateProcessing extends LitElement {
|
|
14
7
|
static { this.styles = [
|
|
15
8
|
css `
|
|
16
9
|
:host {
|
|
@@ -76,9 +69,5 @@ let QtiTemplateProcessing = class QtiTemplateProcessing extends LitElement {
|
|
|
76
69
|
console.info('Template processing with external template not yet implemented');
|
|
77
70
|
}
|
|
78
71
|
}
|
|
79
|
-
}
|
|
80
|
-
QtiTemplateProcessing = __decorate([
|
|
81
|
-
customElement('qti-template-processing')
|
|
82
|
-
], QtiTemplateProcessing);
|
|
83
|
-
export { QtiTemplateProcessing };
|
|
72
|
+
}
|
|
84
73
|
//# sourceMappingURL=qti-template-processing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"qti-template-processing.js","sourceRoot":"","sources":["../../../src/components/qti-template-processing/qti-template-processing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"qti-template-processing.js","sourceRoot":"","sources":["../../../src/components/qti-template-processing/qti-template-processing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAM5C;;;GAGG;AAEH,MAAM,OAAO,qBAAsB,SAAQ,UAAU;aACnC,WAAM,GAAG;QACvB,GAAG,CAAA;;;;KAIF;KACF,CAAC;IAEF,cAAc,GAAG,GAAG,CAAC,CAAC,iDAAiD;IAE9D,MAAM;QACb,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;IAED;;OAEG;IACI,OAAO;QACZ,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;QAC3D,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,OAAO,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC;YAC3E,OAAO;QACT,CAAC;QAED,IAAI,UAAU,GAAG,CAAC,CAAC;QACnB,IAAI,eAAe,GAAG,KAAK,CAAC;QAE5B,GAAG,CAAC;YACF,eAAe,GAAG,KAAK,CAAC;YACxB,UAAU,EAAE,CAAC;YAEb,IAAI,UAAU,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;gBACrC,OAAO,CAAC,KAAK,CAAC,0EAA0E,CAAC,CAAC;gBAC1F,MAAM;YACR,CAAC;YAED,IAAI,CAAC;gBACH,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAyC,CAAC;gBACzE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;oBACzB,qDAAqD;oBACrD,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,yBAAyB,EAAE,CAAC;wBAC7D,MAAM,gBAAgB,GAAI,IAA8B,CAAC,SAAS,EAAE,CAAC;wBACrE,IAAI,gBAAgB,KAAK,KAAK,EAAE,CAAC;4BAC/B,iDAAiD;4BACjD,eAAe,GAAG,IAAI,CAAC;4BACvB,MAAM;wBACR,CAAC;oBACH,CAAC;yBAAM,CAAC;wBACN,IAAI,CAAC,OAAO,EAAE,CAAC;oBACjB,CAAC;gBACH,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;gBAC1D,MAAM;YACR,CAAC;QACH,CAAC,QAAQ,eAAe,EAAE;QAE1B,sDAAsD;QACtD,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,kCAAkC,EAAE;YAClD,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,EAAE,UAAU,EAAE;SACvB,CAAC,CACH,CAAC;IACJ,CAAC;IAEe,YAAY,CAAC,kBAAqE;QAChG,wFAAwF;QACxF,kFAAkF;QAClF,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC;YAClC,OAAO,CAAC,IAAI,CAAC,gEAAgE,CAAC,CAAC;QACjF,CAAC;IACH,CAAC","sourcesContent":["import { css, html, LitElement } from 'lit';\n\nimport type { QtiRuleBase } from '@qti-components/base';\nimport type { QtiTemplateConstraint } from '../qti-template-constraint/qti-template-constraint';\nimport type { PropertyValueMap } from 'lit';\n\n/**\n * @summary The qti-template-processing element contains template processing rules.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-processing\n */\n\nexport class QtiTemplateProcessing extends LitElement {\n static override styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n #maxIterations = 100; // Prevent infinite loops in template constraints\n\n override render() {\n return html`<slot></slot>`;\n }\n\n /**\n * Process template rules to set template variable values\n */\n public process(): void {\n const assessmentItem = this.closest('qti-assessment-item');\n if (!assessmentItem) {\n console.warn('qti-template-processing must be inside qti-assessment-item');\n return;\n }\n\n let iterations = 0;\n let shouldReprocess = false;\n\n do {\n shouldReprocess = false;\n iterations++;\n\n if (iterations > this.#maxIterations) {\n console.error('Template processing exceeded maximum iterations. Possible infinite loop.');\n break;\n }\n\n try {\n const rules = [...this.children] as unknown as (Element & QtiRuleBase)[];\n for (const rule of rules) {\n // Check if this is a template constraint that failed\n if (rule.tagName.toLowerCase() === 'qti-template-constraint') {\n const constraintResult = (rule as QtiTemplateConstraint).calculate();\n if (constraintResult === false) {\n // Template constraint failed, restart processing\n shouldReprocess = true;\n break;\n }\n } else {\n rule.process();\n }\n }\n } catch (error) {\n console.error('Error during template processing:', error);\n break;\n }\n } while (shouldReprocess);\n\n // Dispatch event that template processing is complete\n this.dispatchEvent(\n new CustomEvent('qti-template-processing-complete', {\n bubbles: true,\n composed: true,\n detail: { iterations }\n })\n );\n }\n\n public override firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n // Template processing doesn't typically use external templates like response processing\n // But we could add support for common template processing patterns here if needed\n if (this.getAttribute('template')) {\n console.info('Template processing with external template not yet implemented');\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-template-processing': QtiTemplateProcessing;\n }\n}\n"]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { QtiAssessmentItem } from './components/qti-assessment-item/qti-assessment-item';
|
|
2
|
+
import { QtiAssessmentStimulusRef } from './components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref';
|
|
3
|
+
import { QtiCompanionMaterialsInfo } from './components/qti-companion-materials-info/qti-companion-materials-info';
|
|
4
|
+
import { QtiContentBody } from './components/qti-content-body/qti-content-body';
|
|
5
|
+
import { QtiContextDeclaration } from './components/qti-context-declaration/qti-context-declaration';
|
|
6
|
+
import { QtiCustomOperator } from './components/qti-custom-operator/qti-custom-operator';
|
|
7
|
+
import { QtiFeedbackBlock } from './components/qti-feedback-block/qti-feedback-block';
|
|
8
|
+
import { QtiFeedbackInline } from './components/qti-feedback-inline/qti-feedback-inline';
|
|
9
|
+
import { QtiItemBody } from './components/qti-item-body/qti-item-body';
|
|
10
|
+
import { QtiModalFeedback } from './components/qti-modal-feedback/qti-modal-feedback';
|
|
11
|
+
import { QtiOutcomeDeclaration } from './components/qti-outcome-declaration/qti-outcome-declaration';
|
|
12
|
+
import { QtiResponseDeclaration } from './components/qti-response-declaration/qti-response-declaration';
|
|
13
|
+
import { QtiResponseProcessing } from './components/qti-response-processing/qti-response-processing';
|
|
14
|
+
import { QtiRubricBlock } from './components/qti-rubric-block/qti-rubric-block';
|
|
15
|
+
import { QtiStylesheet } from './components/qti-stylesheet/qti-stylesheet';
|
|
16
|
+
import { QtiTemplateConstraint } from './components/qti-template-constraint/qti-template-constraint';
|
|
17
|
+
import { QtiTemplateDeclaration } from './components/qti-template-declaration/qti-template-declaration';
|
|
18
|
+
import { QtiTemplateProcessing } from './components/qti-template-processing/qti-template-processing';
|
|
19
|
+
export { QtiAssessmentItem, QtiAssessmentStimulusRef, QtiCompanionMaterialsInfo, QtiContentBody, QtiContextDeclaration, QtiCustomOperator, QtiFeedbackBlock, QtiFeedbackInline, QtiItemBody, QtiModalFeedback, QtiOutcomeDeclaration, QtiResponseDeclaration, QtiResponseProcessing, QtiRubricBlock, QtiStylesheet, QtiTemplateConstraint, QtiTemplateDeclaration, QtiTemplateProcessing };
|
|
20
|
+
export declare const qtiContentElements: readonly [{
|
|
21
|
+
readonly tag: "qti-assessment-item";
|
|
22
|
+
readonly ctor: typeof QtiAssessmentItem;
|
|
23
|
+
}, {
|
|
24
|
+
readonly tag: "qti-assessment-stimulus-ref";
|
|
25
|
+
readonly ctor: typeof QtiAssessmentStimulusRef;
|
|
26
|
+
}, {
|
|
27
|
+
readonly tag: "qti-companion-materials-info";
|
|
28
|
+
readonly ctor: typeof QtiCompanionMaterialsInfo;
|
|
29
|
+
}, {
|
|
30
|
+
readonly tag: "qti-content-body";
|
|
31
|
+
readonly ctor: typeof QtiContentBody;
|
|
32
|
+
}, {
|
|
33
|
+
readonly tag: "qti-context-declaration";
|
|
34
|
+
readonly ctor: typeof QtiContextDeclaration;
|
|
35
|
+
}, {
|
|
36
|
+
readonly tag: "qti-custom-operator";
|
|
37
|
+
readonly ctor: typeof QtiCustomOperator;
|
|
38
|
+
}, {
|
|
39
|
+
readonly tag: "qti-feedback-block";
|
|
40
|
+
readonly ctor: typeof QtiFeedbackBlock;
|
|
41
|
+
}, {
|
|
42
|
+
readonly tag: "qti-feedback-inline";
|
|
43
|
+
readonly ctor: typeof QtiFeedbackInline;
|
|
44
|
+
}, {
|
|
45
|
+
readonly tag: "qti-item-body";
|
|
46
|
+
readonly ctor: typeof QtiItemBody;
|
|
47
|
+
}, {
|
|
48
|
+
readonly tag: "qti-modal-feedback";
|
|
49
|
+
readonly ctor: typeof QtiModalFeedback;
|
|
50
|
+
}, {
|
|
51
|
+
readonly tag: "qti-outcome-declaration";
|
|
52
|
+
readonly ctor: typeof QtiOutcomeDeclaration;
|
|
53
|
+
}, {
|
|
54
|
+
readonly tag: "qti-response-declaration";
|
|
55
|
+
readonly ctor: typeof QtiResponseDeclaration;
|
|
56
|
+
}, {
|
|
57
|
+
readonly tag: "qti-response-processing";
|
|
58
|
+
readonly ctor: typeof QtiResponseProcessing;
|
|
59
|
+
}, {
|
|
60
|
+
readonly tag: "qti-rubric-block";
|
|
61
|
+
readonly ctor: typeof QtiRubricBlock;
|
|
62
|
+
}, {
|
|
63
|
+
readonly tag: "qti-stylesheet";
|
|
64
|
+
readonly ctor: typeof QtiStylesheet;
|
|
65
|
+
}, {
|
|
66
|
+
readonly tag: "qti-template-constraint";
|
|
67
|
+
readonly ctor: typeof QtiTemplateConstraint;
|
|
68
|
+
}, {
|
|
69
|
+
readonly tag: "qti-template-declaration";
|
|
70
|
+
readonly ctor: typeof QtiTemplateDeclaration;
|
|
71
|
+
}, {
|
|
72
|
+
readonly tag: "qti-template-processing";
|
|
73
|
+
readonly ctor: typeof QtiTemplateProcessing;
|
|
74
|
+
}];
|
package/dist/elements.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { QtiAssessmentItem } from './components/qti-assessment-item/qti-assessment-item';
|
|
2
|
+
import { QtiAssessmentStimulusRef } from './components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref';
|
|
3
|
+
import { QtiCompanionMaterialsInfo } from './components/qti-companion-materials-info/qti-companion-materials-info';
|
|
4
|
+
import { QtiContentBody } from './components/qti-content-body/qti-content-body';
|
|
5
|
+
import { QtiContextDeclaration } from './components/qti-context-declaration/qti-context-declaration';
|
|
6
|
+
import { QtiCustomOperator } from './components/qti-custom-operator/qti-custom-operator';
|
|
7
|
+
import { QtiFeedbackBlock } from './components/qti-feedback-block/qti-feedback-block';
|
|
8
|
+
import { QtiFeedbackInline } from './components/qti-feedback-inline/qti-feedback-inline';
|
|
9
|
+
import { QtiItemBody } from './components/qti-item-body/qti-item-body';
|
|
10
|
+
import { QtiModalFeedback } from './components/qti-modal-feedback/qti-modal-feedback';
|
|
11
|
+
import { QtiOutcomeDeclaration } from './components/qti-outcome-declaration/qti-outcome-declaration';
|
|
12
|
+
import { QtiResponseDeclaration } from './components/qti-response-declaration/qti-response-declaration';
|
|
13
|
+
import { QtiResponseProcessing } from './components/qti-response-processing/qti-response-processing';
|
|
14
|
+
import { QtiRubricBlock } from './components/qti-rubric-block/qti-rubric-block';
|
|
15
|
+
import { QtiStylesheet } from './components/qti-stylesheet/qti-stylesheet';
|
|
16
|
+
import { QtiTemplateConstraint } from './components/qti-template-constraint/qti-template-constraint';
|
|
17
|
+
import { QtiTemplateDeclaration } from './components/qti-template-declaration/qti-template-declaration';
|
|
18
|
+
import { QtiTemplateProcessing } from './components/qti-template-processing/qti-template-processing';
|
|
19
|
+
export { QtiAssessmentItem, QtiAssessmentStimulusRef, QtiCompanionMaterialsInfo, QtiContentBody, QtiContextDeclaration, QtiCustomOperator, QtiFeedbackBlock, QtiFeedbackInline, QtiItemBody, QtiModalFeedback, QtiOutcomeDeclaration, QtiResponseDeclaration, QtiResponseProcessing, QtiRubricBlock, QtiStylesheet, QtiTemplateConstraint, QtiTemplateDeclaration, QtiTemplateProcessing };
|
|
20
|
+
export const qtiContentElements = [
|
|
21
|
+
{ tag: 'qti-assessment-item', ctor: QtiAssessmentItem },
|
|
22
|
+
{ tag: 'qti-assessment-stimulus-ref', ctor: QtiAssessmentStimulusRef },
|
|
23
|
+
{ tag: 'qti-companion-materials-info', ctor: QtiCompanionMaterialsInfo },
|
|
24
|
+
{ tag: 'qti-content-body', ctor: QtiContentBody },
|
|
25
|
+
{ tag: 'qti-context-declaration', ctor: QtiContextDeclaration },
|
|
26
|
+
{ tag: 'qti-custom-operator', ctor: QtiCustomOperator },
|
|
27
|
+
{ tag: 'qti-feedback-block', ctor: QtiFeedbackBlock },
|
|
28
|
+
{ tag: 'qti-feedback-inline', ctor: QtiFeedbackInline },
|
|
29
|
+
{ tag: 'qti-item-body', ctor: QtiItemBody },
|
|
30
|
+
{ tag: 'qti-modal-feedback', ctor: QtiModalFeedback },
|
|
31
|
+
{ tag: 'qti-outcome-declaration', ctor: QtiOutcomeDeclaration },
|
|
32
|
+
{ tag: 'qti-response-declaration', ctor: QtiResponseDeclaration },
|
|
33
|
+
{ tag: 'qti-response-processing', ctor: QtiResponseProcessing },
|
|
34
|
+
{ tag: 'qti-rubric-block', ctor: QtiRubricBlock },
|
|
35
|
+
{ tag: 'qti-stylesheet', ctor: QtiStylesheet },
|
|
36
|
+
{ tag: 'qti-template-constraint', ctor: QtiTemplateConstraint },
|
|
37
|
+
{ tag: 'qti-template-declaration', ctor: QtiTemplateDeclaration },
|
|
38
|
+
{ tag: 'qti-template-processing', ctor: QtiTemplateProcessing }
|
|
39
|
+
];
|
|
40
|
+
//# sourceMappingURL=elements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"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","sourcesContent":["import { QtiAssessmentItem } from './components/qti-assessment-item/qti-assessment-item';\nimport { QtiAssessmentStimulusRef } from './components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref';\nimport { QtiCompanionMaterialsInfo } from './components/qti-companion-materials-info/qti-companion-materials-info';\nimport { QtiContentBody } from './components/qti-content-body/qti-content-body';\nimport { QtiContextDeclaration } from './components/qti-context-declaration/qti-context-declaration';\nimport { QtiCustomOperator } from './components/qti-custom-operator/qti-custom-operator';\nimport { QtiFeedbackBlock } from './components/qti-feedback-block/qti-feedback-block';\nimport { QtiFeedbackInline } from './components/qti-feedback-inline/qti-feedback-inline';\nimport { QtiItemBody } from './components/qti-item-body/qti-item-body';\nimport { QtiModalFeedback } from './components/qti-modal-feedback/qti-modal-feedback';\nimport { QtiOutcomeDeclaration } from './components/qti-outcome-declaration/qti-outcome-declaration';\nimport { QtiResponseDeclaration } from './components/qti-response-declaration/qti-response-declaration';\nimport { QtiResponseProcessing } from './components/qti-response-processing/qti-response-processing';\nimport { QtiRubricBlock } from './components/qti-rubric-block/qti-rubric-block';\nimport { QtiStylesheet } from './components/qti-stylesheet/qti-stylesheet';\nimport { QtiTemplateConstraint } from './components/qti-template-constraint/qti-template-constraint';\nimport { QtiTemplateDeclaration } from './components/qti-template-declaration/qti-template-declaration';\nimport { QtiTemplateProcessing } from './components/qti-template-processing/qti-template-processing';\n\nexport {\n QtiAssessmentItem,\n QtiAssessmentStimulusRef,\n QtiCompanionMaterialsInfo,\n QtiContentBody,\n QtiContextDeclaration,\n QtiCustomOperator,\n QtiFeedbackBlock,\n QtiFeedbackInline,\n QtiItemBody,\n QtiModalFeedback,\n QtiOutcomeDeclaration,\n QtiResponseDeclaration,\n QtiResponseProcessing,\n QtiRubricBlock,\n QtiStylesheet,\n QtiTemplateConstraint,\n QtiTemplateDeclaration,\n QtiTemplateProcessing\n};\n\nexport const qtiContentElements = [\n { tag: 'qti-assessment-item', ctor: QtiAssessmentItem },\n { tag: 'qti-assessment-stimulus-ref', ctor: QtiAssessmentStimulusRef },\n { tag: 'qti-companion-materials-info', ctor: QtiCompanionMaterialsInfo },\n { tag: 'qti-content-body', ctor: QtiContentBody },\n { tag: 'qti-context-declaration', ctor: QtiContextDeclaration },\n { tag: 'qti-custom-operator', ctor: QtiCustomOperator },\n { tag: 'qti-feedback-block', ctor: QtiFeedbackBlock },\n { tag: 'qti-feedback-inline', ctor: QtiFeedbackInline },\n { tag: 'qti-item-body', ctor: QtiItemBody },\n { tag: 'qti-modal-feedback', ctor: QtiModalFeedback },\n { tag: 'qti-outcome-declaration', ctor: QtiOutcomeDeclaration },\n { tag: 'qti-response-declaration', ctor: QtiResponseDeclaration },\n { tag: 'qti-response-processing', ctor: QtiResponseProcessing },\n { tag: 'qti-rubric-block', ctor: QtiRubricBlock },\n { tag: 'qti-stylesheet', ctor: QtiStylesheet },\n { tag: 'qti-template-constraint', ctor: QtiTemplateConstraint },\n { tag: 'qti-template-declaration', ctor: QtiTemplateDeclaration },\n { tag: 'qti-template-processing', ctor: QtiTemplateProcessing }\n] as const;\n"]}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sDAAsD,CAAC;AACrE,cAAc,sEAAsE,CAAC;AACrF,cAAc,wEAAwE,CAAC;AACvF,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AACnE,cAAc,0CAA0C,CAAC;AACzD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,gEAAgE,CAAC;AAC/E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,gEAAgE,CAAC;AAC/E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,8DAA8D,CAAC","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AAEpB,cAAc,sDAAsD,CAAC;AACrE,cAAc,sEAAsE,CAAC;AACrF,cAAc,wEAAwE,CAAC;AACvF,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AACnE,cAAc,0CAA0C,CAAC;AACzD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,gEAAgE,CAAC;AAC/E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,gEAAgE,CAAC;AAC/E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,8DAA8D,CAAC","sourcesContent":["import './register';\n\nexport * from './components/qti-assessment-item/qti-assessment-item';\nexport * from './components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref';\nexport * from './components/qti-companion-materials-info/qti-companion-materials-info';\nexport * from './components/qti-custom-operator/qti-custom-operator';\nexport * from './components/qti-feedback-block/qti-feedback-block';\nexport * from './components/qti-feedback-inline/qti-feedback-inline';\nexport * from './components/qti-modal-feedback/qti-modal-feedback';\nexport * from './components/qti-item-body/qti-item-body';\nexport * from './components/qti-content-body/qti-content-body';\nexport * from './components/qti-rubric-block/qti-rubric-block';\nexport * from './components/qti-stylesheet/qti-stylesheet';\nexport * from './components/qti-response-declaration/qti-response-declaration';\nexport * from './components/qti-outcome-declaration/qti-outcome-declaration';\nexport * from './components/qti-response-processing/qti-response-processing';\nexport * from './components/qti-template-declaration/qti-template-declaration';\nexport * from './components/qti-template-processing/qti-template-processing';\nexport * from './components/qti-template-constraint/qti-template-constraint';\nexport * from './components/qti-context-declaration/qti-context-declaration';\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const matchCorrect = "<qti-response-
|
|
2
|
-
export declare const mapResponse = "<qti-response-
|
|
3
|
-
export declare const mapResponsePoint = "<qti-response-
|
|
1
|
+
export declare const matchCorrect = "<qti-response-condition>\n <qti-response-if>\n <qti-match>\n <qti-variable identifier=\"RESPONSE\"></qti-variable>\n <qti-correct identifier=\"RESPONSE\"></qti-correct>\n </qti-match>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-base-value base-type=\"float\">1</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-base-value base-type=\"float\">0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-else>\n</qti-response-condition>";
|
|
2
|
+
export declare const mapResponse = "<qti-response-condition>\n <qti-response-if>\n <qti-is-null>\n <qti-variable identifier=\"RESPONSE\"></qti-variable>\n </qti-is-null>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-base-value base-type=\"float\">0.0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-map-response identifier=\"RESPONSE\"> </qti-map-response>\n </qti-set-outcome-value>\n </qti-response-else>\n</qti-response-condition>";
|
|
3
|
+
export declare const mapResponsePoint = "<qti-response-condition>\n <qti-response-if>\n <qti-is-null>\n <qti-variable identifier=\"RESPONSE\"></qti-variable>\n </qti-is-null>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-base-value base-type=\"float\">0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-map-response-point identifier=\"RESPONSE\"></qti-map-response-point>\n </qti-set-outcome-value>\n </qti-response-else>\n</qti-response-condition>";
|
|
@@ -1,53 +1,47 @@
|
|
|
1
|
-
export const matchCorrect = `<qti-response-
|
|
2
|
-
<qti-response-
|
|
3
|
-
<qti-
|
|
4
|
-
<qti-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<qti-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<qti-
|
|
13
|
-
<qti-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<qti-set-outcome-value identifier="SCORE">
|
|
48
|
-
<qti-map-response-point identifier="RESPONSE"></qti-map-response-point>
|
|
49
|
-
</qti-set-outcome-value>
|
|
50
|
-
</qti-response-else>
|
|
51
|
-
</qti-response-condition>
|
|
52
|
-
</qti-response-processing>`;
|
|
1
|
+
export const matchCorrect = `<qti-response-condition>
|
|
2
|
+
<qti-response-if>
|
|
3
|
+
<qti-match>
|
|
4
|
+
<qti-variable identifier="RESPONSE"></qti-variable>
|
|
5
|
+
<qti-correct identifier="RESPONSE"></qti-correct>
|
|
6
|
+
</qti-match>
|
|
7
|
+
<qti-set-outcome-value identifier="SCORE">
|
|
8
|
+
<qti-base-value base-type="float">1</qti-base-value>
|
|
9
|
+
</qti-set-outcome-value>
|
|
10
|
+
</qti-response-if>
|
|
11
|
+
<qti-response-else>
|
|
12
|
+
<qti-set-outcome-value identifier="SCORE">
|
|
13
|
+
<qti-base-value base-type="float">0</qti-base-value>
|
|
14
|
+
</qti-set-outcome-value>
|
|
15
|
+
</qti-response-else>
|
|
16
|
+
</qti-response-condition>`;
|
|
17
|
+
export const mapResponse = `<qti-response-condition>
|
|
18
|
+
<qti-response-if>
|
|
19
|
+
<qti-is-null>
|
|
20
|
+
<qti-variable identifier="RESPONSE"></qti-variable>
|
|
21
|
+
</qti-is-null>
|
|
22
|
+
<qti-set-outcome-value identifier="SCORE">
|
|
23
|
+
<qti-base-value base-type="float">0.0</qti-base-value>
|
|
24
|
+
</qti-set-outcome-value>
|
|
25
|
+
</qti-response-if>
|
|
26
|
+
<qti-response-else>
|
|
27
|
+
<qti-set-outcome-value identifier="SCORE">
|
|
28
|
+
<qti-map-response identifier="RESPONSE"> </qti-map-response>
|
|
29
|
+
</qti-set-outcome-value>
|
|
30
|
+
</qti-response-else>
|
|
31
|
+
</qti-response-condition>`;
|
|
32
|
+
export const mapResponsePoint = `<qti-response-condition>
|
|
33
|
+
<qti-response-if>
|
|
34
|
+
<qti-is-null>
|
|
35
|
+
<qti-variable identifier="RESPONSE"></qti-variable>
|
|
36
|
+
</qti-is-null>
|
|
37
|
+
<qti-set-outcome-value identifier="SCORE">
|
|
38
|
+
<qti-base-value base-type="float">0</qti-base-value>
|
|
39
|
+
</qti-set-outcome-value>
|
|
40
|
+
</qti-response-if>
|
|
41
|
+
<qti-response-else>
|
|
42
|
+
<qti-set-outcome-value identifier="SCORE">
|
|
43
|
+
<qti-map-response-point identifier="RESPONSE"></qti-map-response-point>
|
|
44
|
+
</qti-set-outcome-value>
|
|
45
|
+
</qti-response-else>
|
|
46
|
+
</qti-response-condition>`;
|
|
53
47
|
//# sourceMappingURL=template-strings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-strings.js","sourceRoot":"","sources":["../../src/internal/template-strings.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG
|
|
1
|
+
{"version":3,"file":"template-strings.js","sourceRoot":"","sources":["../../src/internal/template-strings.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;0BAeF,CAAC;AAE3B,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;0BAcD,CAAC;AAE3B,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;0BAcN,CAAC","sourcesContent":["export const matchCorrect = `<qti-response-condition>\n <qti-response-if>\n <qti-match>\n <qti-variable identifier=\"RESPONSE\"></qti-variable>\n <qti-correct identifier=\"RESPONSE\"></qti-correct>\n </qti-match>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-base-value base-type=\"float\">1</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-base-value base-type=\"float\">0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-else>\n</qti-response-condition>`;\n\nexport const mapResponse = `<qti-response-condition>\n <qti-response-if>\n <qti-is-null>\n <qti-variable identifier=\"RESPONSE\"></qti-variable>\n </qti-is-null>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-base-value base-type=\"float\">0.0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-map-response identifier=\"RESPONSE\"> </qti-map-response>\n </qti-set-outcome-value>\n </qti-response-else>\n</qti-response-condition>`;\n\nexport const mapResponsePoint = `<qti-response-condition>\n <qti-response-if>\n <qti-is-null>\n <qti-variable identifier=\"RESPONSE\"></qti-variable>\n </qti-is-null>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-base-value base-type=\"float\">0</qti-base-value>\n </qti-set-outcome-value>\n </qti-response-if>\n <qti-response-else>\n <qti-set-outcome-value identifier=\"SCORE\">\n <qti-map-response-point identifier=\"RESPONSE\"></qti-map-response-point>\n </qti-set-outcome-value>\n </qti-response-else>\n</qti-response-condition>`;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/register.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,KAAK,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,kBAAkB,EAAE,CAAC;IAC/C,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7B,cAAc,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;AACH,CAAC","sourcesContent":["import { qtiContentElements } from './elements';\n\nfor (const { tag, ctor } of qtiContentElements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qti-components/elements",
|
|
3
3
|
"description": "QTI elements utilities",
|
|
4
|
-
"version": "1.6.
|
|
4
|
+
"version": "1.6.5",
|
|
5
5
|
"author": "",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@qti-components/base": "^1.
|
|
8
|
-
"@qti-components/
|
|
9
|
-
"@qti-components/
|
|
7
|
+
"@qti-components/base": "^2.1.0",
|
|
8
|
+
"@qti-components/transformers": "^1.7.2",
|
|
9
|
+
"@qti-components/utilities": "^1.3.3"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@lit/context": "^1.1.6",
|
|
@@ -18,6 +18,21 @@
|
|
|
18
18
|
],
|
|
19
19
|
"license": "GPL-3.0-only",
|
|
20
20
|
"main": "dist/index.js",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./elements": {
|
|
27
|
+
"types": "./dist/elements.d.ts",
|
|
28
|
+
"import": "./dist/elements.js"
|
|
29
|
+
},
|
|
30
|
+
"./register": {
|
|
31
|
+
"types": "./dist/register.d.ts",
|
|
32
|
+
"import": "./dist/register.js"
|
|
33
|
+
},
|
|
34
|
+
"./*": "./dist/*"
|
|
35
|
+
},
|
|
21
36
|
"peerDependencies": {
|
|
22
37
|
"@lit/context": "^1.1.6",
|
|
23
38
|
"lit": "^3.3.1"
|
|
@@ -39,6 +54,8 @@
|
|
|
39
54
|
"scripts": {
|
|
40
55
|
"attw": "attw --profile esm-only --pack",
|
|
41
56
|
"build": "tsc --paths null",
|
|
42
|
-
"clean": "rm -rf dist"
|
|
57
|
+
"clean": "rm -rf dist",
|
|
58
|
+
"yalc": "yalc publish",
|
|
59
|
+
"yalc:push": "yalc push"
|
|
43
60
|
}
|
|
44
61
|
}
|