@citolab/qti-components 6.0.22 → 6.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/chunk-BVYXUE3V.js +1 -0
  2. package/dist/chunk-C4C24R3I.cjs +1 -0
  3. package/dist/chunk-NT6UB5QT.cjs +17 -0
  4. package/dist/chunk-RGNNQ7CN.js +17 -0
  5. package/dist/{chunk-YDFMBQT4.js → chunk-WFE4NR22.js} +28 -6
  6. package/dist/{chunk-GEVRCVN2.cjs → chunk-XHNCXKJ6.cjs} +28 -6
  7. package/dist/custom-elements.json +6817 -0
  8. package/dist/decorators/index.cjs +1 -1
  9. package/dist/decorators/index.js +1 -1
  10. package/dist/index.cjs +84 -62
  11. package/dist/index.css +2215 -0
  12. package/dist/index.d.cts +30 -50
  13. package/dist/index.d.ts +30 -50
  14. package/dist/index.js +76 -54
  15. package/dist/qti-components/index.cjs +21 -21
  16. package/dist/qti-components/index.d.cts +11 -11
  17. package/dist/qti-components/index.d.ts +11 -11
  18. package/dist/qti-components/index.js +57 -57
  19. package/dist/qti-item/index.cjs +1 -1
  20. package/dist/qti-item/index.d.cts +1 -2
  21. package/dist/qti-item/index.d.ts +1 -2
  22. package/dist/qti-item/index.js +1 -1
  23. package/dist/qti-item-395a9535.d.ts +19 -0
  24. package/dist/qti-item-react/index.cjs +1 -1
  25. package/dist/qti-item-react/index.d.cts +7 -15
  26. package/dist/qti-item-react/index.d.ts +7 -15
  27. package/dist/qti-item-react/index.js +1 -1
  28. package/dist/{qti-simple-choice-e28cfb34.d.ts → qti-simple-choice-6d581309.d.ts} +109 -5
  29. package/dist/qti-transform/index.cjs +1 -17
  30. package/dist/qti-transform/index.js +1 -17
  31. package/package.json +3 -4
  32. package/dist/chunk-3O4URV5U.cjs +0 -1
  33. package/dist/chunk-6RJ7J4AE.cjs +0 -1
  34. package/dist/chunk-M7QOVOG6.js +0 -1
  35. package/dist/chunk-WFLR5TH7.js +0 -1
  36. package/dist/qti-assessment-item-c1eb7de3.d.ts +0 -121
  37. package/dist/qti-item-e2edd87f.d.ts +0 -30
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkGEVRCVN2cjs = require('../chunk-GEVRCVN2.cjs');require('../chunk-GGEPFBR7.cjs');require('../chunk-3O4URV5U.cjs');require('../chunk-HOQW4KDA.cjs');exports.QtiItem = _chunkGEVRCVN2cjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkXHNCXKJ6cjs = require('../chunk-XHNCXKJ6.cjs');require('../chunk-GGEPFBR7.cjs');require('../chunk-NT6UB5QT.cjs');require('../chunk-HOQW4KDA.cjs');exports.QtiItem = _chunkXHNCXKJ6cjs.a;
@@ -1,4 +1,3 @@
1
- export { Q as QtiItem } from '../qti-item-e2edd87f.js';
1
+ export { Q as QtiItem } from '../qti-item-395a9535.js';
2
2
  import 'lit-html';
3
3
  import 'lit';
4
- import '../qti-assessment-item-c1eb7de3.js';
@@ -1,4 +1,3 @@
1
- export { Q as QtiItem } from '../qti-item-e2edd87f.js';
1
+ export { Q as QtiItem } from '../qti-item-395a9535.js';
2
2
  import 'lit-html';
3
3
  import 'lit';
4
- import '../qti-assessment-item-c1eb7de3.js';
@@ -1 +1 @@
1
- import{a as o}from"../chunk-YDFMBQT4.js";import"../chunk-5GG2XAUT.js";import"../chunk-WFLR5TH7.js";import"../chunk-NMCIOGD2.js";export{o as QtiItem};
1
+ import{a as o}from"../chunk-WFE4NR22.js";import"../chunk-5GG2XAUT.js";import"../chunk-RGNNQ7CN.js";import"../chunk-NMCIOGD2.js";export{o as QtiItem};
@@ -0,0 +1,19 @@
1
+ import * as lit_html from 'lit-html';
2
+ import * as lit from 'lit';
3
+ import { LitElement } from 'lit';
4
+
5
+ declare class QtiItem extends LitElement {
6
+ itemLocation: string;
7
+ set audienceContext(context: {
8
+ view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
9
+ });
10
+ private provider;
11
+ private _xml;
12
+ set xml(val: string);
13
+ get xml(): string;
14
+ static styles: lit.CSSResult;
15
+ connectedCallback(): void;
16
+ render: () => lit_html.TemplateResult<1>;
17
+ }
18
+
19
+ export { QtiItem as Q };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkGEVRCVN2cjs = require('../chunk-GEVRCVN2.cjs');require('../chunk-GGEPFBR7.cjs');require('../chunk-3O4URV5U.cjs');require('../chunk-HOQW4KDA.cjs');var _react = require('react'); var _react2 = _interopRequireDefault(_react);var _react3 = require('@lit-labs/react');var c=_react3.createComponent.call(void 0, {tagName:"qti-item",react:_react2.default,elementClass:_chunkGEVRCVN2cjs.a,events:{qtioutcomechanged:"qti-outcome-changed",qtiinteractionchanged:"qti-interaction-changed",qtiitemconnected:"qti-item-connected"}});exports.QtiItem = c;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkXHNCXKJ6cjs = require('../chunk-XHNCXKJ6.cjs');require('../chunk-GGEPFBR7.cjs');require('../chunk-NT6UB5QT.cjs');require('../chunk-HOQW4KDA.cjs');var _react = require('react'); var _react2 = _interopRequireDefault(_react);var _react3 = require('@lit-labs/react');var c=_react3.createComponent.call(void 0, {tagName:"qti-item",react:_react2.default,elementClass:_chunkXHNCXKJ6cjs.a,events:{"qti-outcome-changed":"qti-outcome-changed","qti-interaction-changed":"qti-interaction-changed","qti-item-connected":"qti-item-connected"}});exports.QtiItem = c;
@@ -1,7 +1,6 @@
1
1
  import React, { Ref } from 'react';
2
- import { Q as QtiItem$1 } from '../qti-item-e2edd87f.js';
3
- import { a as ResponseInteraction } from '../qti-assessment-item-c1eb7de3.js';
4
- import { O as OutcomeChangedDetails, b as InteractionChangedDetails } from '../qti-simple-choice-e28cfb34.js';
2
+ import { Q as QtiItem$1 } from '../qti-item-395a9535.js';
3
+ import { h as OutcomeChangedDetails, j as InteractionChangedDetails, b as QtiAssessmentItem } from '../qti-simple-choice-6d581309.js';
5
4
  import 'lit-html';
6
5
  import 'lit';
7
6
  import 'lit-html/directives/ref';
@@ -9,21 +8,14 @@ import 'lit-html/directives/ref';
9
8
  interface QtiItemProps {
10
9
  ref?: Ref<QtiItem$1>;
11
10
  className?: string;
12
- responses?: ResponseInteraction[];
13
11
  xml: string;
14
- disabled?: boolean;
15
- qtiContext?: {
12
+ audienceContext?: {
16
13
  view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
17
14
  };
18
- processResponse?: () => void;
19
- showCorrectResponse?: () => void;
20
- validateResponses?: () => boolean;
21
- resetInteractions?: () => void;
22
- qtioutcomechanged?: (e: CustomEvent<OutcomeChangedDetails>) => void;
23
- qtiinteractionchanged?: (e: CustomEvent<InteractionChangedDetails>) => void;
24
- qtiitemconnected?: (e: CustomEvent<{
25
- identifier: string;
26
- }>) => void;
15
+ 'item-location'?: string;
16
+ 'qti-outcome-changed'?: (e: CustomEvent<OutcomeChangedDetails>) => void;
17
+ 'qti-interaction-changed'?: (e: CustomEvent<InteractionChangedDetails>) => void;
18
+ 'qti-item-connected'?: (e: CustomEvent<QtiAssessmentItem>) => void;
27
19
  }
28
20
  declare const QtiItem: React.ForwardRefExoticComponent<QtiItemProps>;
29
21
 
@@ -1,7 +1,6 @@
1
1
  import React, { Ref } from 'react';
2
- import { Q as QtiItem$1 } from '../qti-item-e2edd87f.js';
3
- import { a as ResponseInteraction } from '../qti-assessment-item-c1eb7de3.js';
4
- import { O as OutcomeChangedDetails, b as InteractionChangedDetails } from '../qti-simple-choice-e28cfb34.js';
2
+ import { Q as QtiItem$1 } from '../qti-item-395a9535.js';
3
+ import { h as OutcomeChangedDetails, j as InteractionChangedDetails, b as QtiAssessmentItem } from '../qti-simple-choice-6d581309.js';
5
4
  import 'lit-html';
6
5
  import 'lit';
7
6
  import 'lit-html/directives/ref';
@@ -9,21 +8,14 @@ import 'lit-html/directives/ref';
9
8
  interface QtiItemProps {
10
9
  ref?: Ref<QtiItem$1>;
11
10
  className?: string;
12
- responses?: ResponseInteraction[];
13
11
  xml: string;
14
- disabled?: boolean;
15
- qtiContext?: {
12
+ audienceContext?: {
16
13
  view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
17
14
  };
18
- processResponse?: () => void;
19
- showCorrectResponse?: () => void;
20
- validateResponses?: () => boolean;
21
- resetInteractions?: () => void;
22
- qtioutcomechanged?: (e: CustomEvent<OutcomeChangedDetails>) => void;
23
- qtiinteractionchanged?: (e: CustomEvent<InteractionChangedDetails>) => void;
24
- qtiitemconnected?: (e: CustomEvent<{
25
- identifier: string;
26
- }>) => void;
15
+ 'item-location'?: string;
16
+ 'qti-outcome-changed'?: (e: CustomEvent<OutcomeChangedDetails>) => void;
17
+ 'qti-interaction-changed'?: (e: CustomEvent<InteractionChangedDetails>) => void;
18
+ 'qti-item-connected'?: (e: CustomEvent<QtiAssessmentItem>) => void;
27
19
  }
28
20
  declare const QtiItem: React.ForwardRefExoticComponent<QtiItemProps>;
29
21
 
@@ -1 +1 @@
1
- import{a as e}from"../chunk-YDFMBQT4.js";import"../chunk-5GG2XAUT.js";import"../chunk-WFLR5TH7.js";import"../chunk-NMCIOGD2.js";import t from"react";import{createComponent as o}from"@lit-labs/react";var c=o({tagName:"qti-item",react:t,elementClass:e,events:{qtioutcomechanged:"qti-outcome-changed",qtiinteractionchanged:"qti-interaction-changed",qtiitemconnected:"qti-item-connected"}});export{c as QtiItem};
1
+ import{a as t}from"../chunk-WFE4NR22.js";import"../chunk-5GG2XAUT.js";import"../chunk-RGNNQ7CN.js";import"../chunk-NMCIOGD2.js";import e from"react";import{createComponent as o}from"@lit-labs/react";var c=o({tagName:"qti-item",react:e,elementClass:t,events:{"qti-outcome-changed":"qti-outcome-changed","qti-interaction-changed":"qti-interaction-changed","qti-item-connected":"qti-item-connected"}});export{c as QtiItem};
@@ -1,13 +1,30 @@
1
- import { a as ResponseInteraction, V as VariableDeclaration } from './qti-assessment-item-c1eb7de3.js';
2
1
  import * as lit_html from 'lit-html';
3
2
  import * as lit from 'lit';
4
3
  import { LitElement, CSSResultGroup } from 'lit';
5
4
  import * as lit_html_directives_ref from 'lit-html/directives/ref';
6
5
 
6
+ interface directedPair {
7
+ destination: string;
8
+ source: string;
9
+ }
10
+ interface ResponseInteraction {
11
+ responseIdentifier: string;
12
+ response: string | string[];
13
+ }
14
+ interface Calculate {
15
+ calculate: () => string | string[];
16
+ }
17
+ type float = number;
18
+ type integer = number;
19
+ type BaseType = 'boolean' | 'directedPair' | 'duration' | 'float' | 'integer' | 'string' | 'identifier' | 'pair';
20
+ type Multiple = string | string[][];
21
+ type Ordered = string | string[][];
22
+ type Cardinality = 'multiple' | 'ordered' | 'single';
23
+
7
24
  interface OutcomeChangedDetails {
8
25
  item: string;
9
26
  outcomeIdentifier: string;
10
- value: number | string | string[];
27
+ value: string | string[];
11
28
  }
12
29
  type InteractionChangedDetails = ResponseInteraction & {
13
30
  item: string;
@@ -43,12 +60,19 @@ declare namespace qtiInteractionChanged {
43
60
  };
44
61
  }
45
62
 
63
+ interface VariableDeclaration<T> {
64
+ identifier: string;
65
+ cardinality: Cardinality;
66
+ baseType: BaseType;
67
+ value: T;
68
+ }
69
+
46
70
  type QtiRegisterVariable = CustomEvent<{
47
- variable: VariableDeclaration<number | string | string[]>;
71
+ variable: VariableDeclaration<string | string[]>;
48
72
  }>;
49
73
  declare global {
50
74
  interface GlobalEventHandlersEventMap {
51
- "qti-register-variable": QtiRegisterVariable;
75
+ 'qti-register-variable': QtiRegisterVariable;
52
76
  }
53
77
  }
54
78
 
@@ -139,6 +163,86 @@ declare namespace qtiChoiceElementSelected {
139
163
  };
140
164
  }
141
165
 
166
+ declare class QtiMapping extends LitElement {
167
+ defaultValue: number;
168
+ lowerBound: number;
169
+ upperBound: number;
170
+ get mapEntries(): {
171
+ mapKey: string;
172
+ mappedValue: number;
173
+ }[];
174
+ }
175
+
176
+ declare class ResponseVariable implements VariableDeclaration<string | string[] | null> {
177
+ identifier: string;
178
+ cardinality: Cardinality;
179
+ baseType: BaseType;
180
+ value: string | string[] | null;
181
+ candidateResponse: string | string[] | null;
182
+ mapping: QtiMapping;
183
+ correctResponse: string | string[] | null;
184
+ }
185
+
186
+ declare class OutcomeVariable implements VariableDeclaration<string | string[] | null> {
187
+ identifier: string;
188
+ cardinality: Cardinality;
189
+ baseType: BaseType;
190
+ value: string | string[] | null;
191
+ }
192
+
193
+ /**
194
+ * @summary The qti-assessment-item element contains all the other QTI 3 item structures.
195
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.dltnnj87l0yj
196
+ * @status stable
197
+ * @since 4.0
198
+ *
199
+ * @dependency qti-feedback
200
+ * @dependency qti-responseprocessing
201
+ *
202
+ * @slot - The default slot where all the other QTI 3 item structures go.
203
+ *
204
+ * @event qti-interaction-changed - Emitted when an interaction is changed.
205
+ * @event qti-outcome-changed - Emitted when an outcome has changed.
206
+ * @event qti-response-processing - Emitted when response-processing is called.
207
+ *
208
+ */
209
+ declare class QtiAssessmentItem extends LitElement {
210
+ variables: VariableDeclaration<string | string[]>[];
211
+ private feedbackElements;
212
+ private interactionElements;
213
+ disabled: boolean;
214
+ readonly: boolean;
215
+ title: string;
216
+ identifier: string;
217
+ private _numAttempts;
218
+ render(): lit_html.TemplateResult<1>;
219
+ _handleDisabledChange: (_: boolean, disabled: boolean) => void;
220
+ _handleReadonlyChange: (_: boolean, readonly: boolean) => void;
221
+ constructor();
222
+ connectedCallback(): void;
223
+ disconnectedCallback(): void;
224
+ private _registerVariable;
225
+ showCorrectResponse(): void;
226
+ processResponse(): boolean;
227
+ set responses(myResponses: ResponseInteraction[]);
228
+ resetInteractions(): void;
229
+ validateResponses(): boolean;
230
+ getVariable(identifier: string): VariableDeclaration<string | string[] | undefined>;
231
+ getResponse(identifier: string): ResponseVariable | null;
232
+ getOutcome(identifier: string): OutcomeVariable | null;
233
+ private registerFeedbackElement;
234
+ private registerInteractionElement;
235
+ private interactionResponse;
236
+ private outcomeChanged;
237
+ private showFeedback;
238
+ setOutcomeValue(identifier: string, value: string): void;
239
+ }
240
+ declare global {
241
+ interface HTMLElementTagNameMap {
242
+ 'qti-assessment-item': QtiAssessmentItem;
243
+ }
244
+ }
245
+
142
246
  /**
143
247
  * @summary The qti-item-body node contains the text, graphics, media objects and interactions that describe the item's content and information about how it is structured.
144
248
  * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.sphpo6lu6zqi
@@ -352,4 +456,4 @@ declare global {
352
456
  }
353
457
  }
354
458
 
355
- export { Choices as C, Interaction as I, OutcomeChangedDetails as O, QtiRule as Q, QtiChoice as a, InteractionChangedDetails as b, qtiInteractionChanged as c, qtiRegisterVariable as d, qtiRegisterInteraction as e, qtiRegisterChoice as f, qtiRegisterHotspot as g, qtiLooseChoice as h, qtiInteractionResponse as i, qtiChoiceElementSelected as j, QtiTextEntryInteraction as k, QtiExtendedTextInteraction as l, QtiChoiceInteraction as m, QtiResponseProcessing as n, QtiHottext as o, QtiSimpleChoice as p, qtiOutcomeChanged as q };
459
+ export { QtiSimpleChoice as A, BaseType as B, Cardinality as C, Interaction as I, Multiple as M, Ordered as O, QtiRule as Q, ResponseVariable as R, VariableDeclaration as V, Choices as a, QtiAssessmentItem as b, QtiChoice as c, directedPair as d, ResponseInteraction as e, Calculate as f, float as g, OutcomeChangedDetails as h, integer as i, InteractionChangedDetails as j, qtiInteractionChanged as k, qtiRegisterVariable as l, qtiRegisterInteraction as m, qtiRegisterChoice as n, qtiRegisterHotspot as o, qtiLooseChoice as p, qtiOutcomeChanged as q, qtiInteractionResponse as r, qtiChoiceElementSelected as s, OutcomeVariable as t, QtiTextEntryInteraction as u, QtiExtendedTextInteraction as v, QtiChoiceInteraction as w, QtiResponseProcessing as x, QtiMapping as y, QtiHottext as z };
@@ -1,17 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }require('../chunk-HOQW4KDA.cjs');var _cheerio = require('cheerio'); var u = _interopRequireWildcard(_cheerio);var g=`
2
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
4
- <xsl:template match="*">
5
- <!-- remove element prefix -->
6
- <xsl:element name="{local-name()}">
7
- <!-- process attributes -->
8
- <xsl:for-each select="@*">
9
- <!-- remove attribute prefix -->
10
- <xsl:attribute name="{local-name()}">
11
- <xsl:value-of select="."/>
12
- </xsl:attribute>
13
- </xsl:for-each>
14
- <xsl:apply-templates/>
15
- </xsl:element>
16
- </xsl:template>
17
- </xsl:stylesheet>`,f= exports.qtiTransform =c=>{let e=c,a=t=>{let s=new DOMParser().parseFromString(e,"text/xml"),r=new XSLTProcessor,l=new DOMParser().parseFromString(t,"text/xml");r.importStylesheet(l);let o=r.transformToFragment(s,document);e=new XMLSerializer().serializeToString(o)},n={mathml(){let t=u.load(e,{xmlMode:!0,xml:!0});return t("math").each((s,r)=>{r.tagName="math-ml"}).find("*").each((s,r)=>{r.tagName=`math-${r.tagName.substring(1)}`}),e=t.xml(),n},removeNamesSpaces(){return a(g),n},pciHooks(t){let s=["hook","module"],r=t.substring(0,t.lastIndexOf("/")),l=new DOMParser().parseFromString(e,"text/xml");for(let o of s)l.querySelectorAll("["+o+"]").forEach(m=>{let i=m.getAttribute(o);!i.startsWith("data:")&&!i.startsWith("http")&&(m.setAttribute("base-url",t),m.setAttribute("module",r+"/"+encodeURIComponent(i+(i.endsWith(".js")?"":".js"))))});return e=new XMLSerializer().serializeToString(l),n},assetsLocation(t,s=["src","href","data"]){let r=t.substring(0,t.lastIndexOf("/")),l=new DOMParser().parseFromString(e,"text/xml");for(let o of s)l.querySelectorAll("["+o+"]").forEach(m=>{let i=m.getAttribute(o);!i.startsWith("data:")&&!i.startsWith("http")&&m.setAttribute(o,r+"/"+encodeURIComponent(i))});return e=new XMLSerializer().serializeToString(l),n},customTypes(){let t=u.load(e,{xml:!0,xmlMode:!0});return t("*").each((s,r)=>{var o;let l=(o=t(r).attr("class"))==null?void 0:o.split(" ");l&&l.forEach(x=>{x.startsWith("type:")&&(r.name=`${r.name}-${x.slice(5)}`)})}),e=t.xml(),n},suffix(t,s){let r=u.load(e,{xml:!0,xmlMode:!0});return r("*").each((l,o)=>{t.includes(o.name)&&(o.name=`${o.name}-${s}`)}),e=r.xml(),n},fn(t){return e=t(e),n},fnCh(t){let s=u.load(e,{xml:!0,xmlMode:!0});return t(s),e=s.xml(),n},elementNameAttributes(t){return t.forEach(s=>{e=p(e,s,s+` data-element="${s}" `)}),n},print(){return console.log(e),n},xml(){return e=h(e),e}};return n},h=c=>{let e=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],a=c.split("/>"),n="";for(let t=0;t<a.length-1;t++){let s=a[t].split("<"),r=s[s.length-1].split(" ")[0];e.includes(r)?n+=a[t]+"/>":n+=a[t]+"></"+r+">"}return n+a[a.length-1]};function p(c,e,a){return c.replace(new RegExp(e,"g"),a)}exports.qtiTransform = f;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNT6UB5QTcjs = require('../chunk-NT6UB5QT.cjs');require('../chunk-HOQW4KDA.cjs');exports.qtiTransform = _chunkNT6UB5QTcjs.a;
@@ -1,17 +1 @@
1
- import"../chunk-NMCIOGD2.js";import*as u from"cheerio";var g=`
2
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
- <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
4
- <xsl:template match="*">
5
- <!-- remove element prefix -->
6
- <xsl:element name="{local-name()}">
7
- <!-- process attributes -->
8
- <xsl:for-each select="@*">
9
- <!-- remove attribute prefix -->
10
- <xsl:attribute name="{local-name()}">
11
- <xsl:value-of select="."/>
12
- </xsl:attribute>
13
- </xsl:for-each>
14
- <xsl:apply-templates/>
15
- </xsl:element>
16
- </xsl:template>
17
- </xsl:stylesheet>`,f=c=>{let e=c,a=t=>{let s=new DOMParser().parseFromString(e,"text/xml"),r=new XSLTProcessor,l=new DOMParser().parseFromString(t,"text/xml");r.importStylesheet(l);let o=r.transformToFragment(s,document);e=new XMLSerializer().serializeToString(o)},n={mathml(){let t=u.load(e,{xmlMode:!0,xml:!0});return t("math").each((s,r)=>{r.tagName="math-ml"}).find("*").each((s,r)=>{r.tagName=`math-${r.tagName.substring(1)}`}),e=t.xml(),n},removeNamesSpaces(){return a(g),n},pciHooks(t){let s=["hook","module"],r=t.substring(0,t.lastIndexOf("/")),l=new DOMParser().parseFromString(e,"text/xml");for(let o of s)l.querySelectorAll("["+o+"]").forEach(m=>{let i=m.getAttribute(o);!i.startsWith("data:")&&!i.startsWith("http")&&(m.setAttribute("base-url",t),m.setAttribute("module",r+"/"+encodeURIComponent(i+(i.endsWith(".js")?"":".js"))))});return e=new XMLSerializer().serializeToString(l),n},assetsLocation(t,s=["src","href","data"]){let r=t.substring(0,t.lastIndexOf("/")),l=new DOMParser().parseFromString(e,"text/xml");for(let o of s)l.querySelectorAll("["+o+"]").forEach(m=>{let i=m.getAttribute(o);!i.startsWith("data:")&&!i.startsWith("http")&&m.setAttribute(o,r+"/"+encodeURIComponent(i))});return e=new XMLSerializer().serializeToString(l),n},customTypes(){let t=u.load(e,{xml:!0,xmlMode:!0});return t("*").each((s,r)=>{var o;let l=(o=t(r).attr("class"))==null?void 0:o.split(" ");l&&l.forEach(x=>{x.startsWith("type:")&&(r.name=`${r.name}-${x.slice(5)}`)})}),e=t.xml(),n},suffix(t,s){let r=u.load(e,{xml:!0,xmlMode:!0});return r("*").each((l,o)=>{t.includes(o.name)&&(o.name=`${o.name}-${s}`)}),e=r.xml(),n},fn(t){return e=t(e),n},fnCh(t){let s=u.load(e,{xml:!0,xmlMode:!0});return t(s),e=s.xml(),n},elementNameAttributes(t){return t.forEach(s=>{e=p(e,s,s+` data-element="${s}" `)}),n},print(){return console.log(e),n},xml(){return e=h(e),e}};return n},h=c=>{let e=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],a=c.split("/>"),n="";for(let t=0;t<a.length-1;t++){let s=a[t].split("<"),r=s[s.length-1].split(" ")[0];e.includes(r)?n+=a[t]+"/>":n+=a[t]+"></"+r+">"}return n+a[a.length-1]};function p(c,e,a){return c.replace(new RegExp(e,"g"),a)}export{f as qtiTransform};
1
+ import{a}from"../chunk-RGNNQ7CN.js";import"../chunk-NMCIOGD2.js";export{a as qtiTransform};
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "engines": {
13
13
  "node": ">=16.0.0"
14
14
  },
15
- "version": "6.0.22",
15
+ "version": "6.0.24",
16
16
  "type": "module",
17
17
  "main": "dist/index.js",
18
18
  "exports": {
@@ -85,11 +85,11 @@
85
85
  "dev": "vite",
86
86
  "build-app": "tsc && vite build",
87
87
  "build-lib": "ts-node --esm --project tsconfig.node.json scripts/build.ts",
88
- "build-lib-watch": "nodemon --watch \"src/**\" --ext \"ts,json,css\" --ignore \"src/**/*.spec.ts\" --exec \"ts-node --esm --project tsconfig.node.json scripts/build.ts\"",
88
+ "watch-lib": "nodemon --watch \"src/**\" --ext \"ts,json,css\" --ignore \"src/**/*.spec.ts\" --exec \"ts-node --esm --project tsconfig.node.json scripts/watch.ts\"",
89
89
  "storybook": "storybook dev -p 6006",
90
90
  "deploy": "firebase deploy --only hosting:qti-components",
91
91
  "build-storybook": "storybook build",
92
- "npm": "np",
92
+ "npm publish": "np",
93
93
  "test-storybook": "test-storybook",
94
94
  "cem": "cem analyze --watch",
95
95
  "lint": "eslint src/lib/**",
@@ -145,7 +145,6 @@
145
145
  "eslint-plugin-sort-imports-es6-autofix": "^0.6.0",
146
146
  "eslint-plugin-storybook": "^0.6.12",
147
147
  "eslint-plugin-wc": "^1.5.0",
148
- "html-to-image": "^1.11.11",
149
148
  "jest-environment-jsdom": "^29.5.0",
150
149
  "nodemon": "^2.0.22",
151
150
  "np": "^8.0.4",
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHOQW4KDAcjs = require('./chunk-HOQW4KDA.cjs');function u(e,d){let o=_chunkHOQW4KDAcjs.a.call(void 0, {waitUntilFirstUpdate:!1},d);return(s,r)=>{let{update:c}=s,f=Array.isArray(e)?e:[e];s.update=function(t){f.forEach(p=>{let n=p;if(t.has(n)){let a=t.get(n),i=this[n];a!==i&&(!o.waitUntilFirstUpdate||this.hasUpdated)&&this[r](a,i)}}),c.call(this,t)}}}exports.a = u;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHOQW4KDAcjs = require('./chunk-HOQW4KDA.cjs');function b(o,l){let n,h=_chunkHOQW4KDAcjs.a.call(void 0, {},l);return(t,d)=>{let{connectedCallback:c,disconnectedCallback:u}=t;t.connectedCallback=function(){var r;c.call(this);let m=p=>{let y=Array.from(this.querySelectorAll(o));for(let s of p){let i=Array.from(s.addedNodes).map(e=>e),v=Array.from(s.addedNodes).map(e=>e);s.type==="childList"&&i.find(e=>y.includes(e))&&this[d](i,v)}};n=new MutationObserver(m),n.observe(this,{childList:!0,subtree:!0});let f=(r=this.querySelectorAll(o))!=null?r:[];this[d](Array.from(f),[])},t.disconnectedCallback=function(){u.call(this),n.disconnect()}}}exports.a = b;
@@ -1 +0,0 @@
1
- import{a}from"./chunk-NMCIOGD2.js";function b(o,l){let n,h=a({},l);return(t,d)=>{let{connectedCallback:c,disconnectedCallback:u}=t;t.connectedCallback=function(){var r;c.call(this);let m=p=>{let y=Array.from(this.querySelectorAll(o));for(let s of p){let i=Array.from(s.addedNodes).map(e=>e),v=Array.from(s.addedNodes).map(e=>e);s.type==="childList"&&i.find(e=>y.includes(e))&&this[d](i,v)}};n=new MutationObserver(m),n.observe(this,{childList:!0,subtree:!0});let f=(r=this.querySelectorAll(o))!=null?r:[];this[d](Array.from(f),[])},t.disconnectedCallback=function(){u.call(this),n.disconnect()}}}export{b as a};
@@ -1 +0,0 @@
1
- import{a as l}from"./chunk-NMCIOGD2.js";function u(e,d){let o=l({waitUntilFirstUpdate:!1},d);return(s,r)=>{let{update:c}=s,f=Array.isArray(e)?e:[e];s.update=function(t){f.forEach(p=>{let n=p;if(t.has(n)){let a=t.get(n),i=this[n];a!==i&&(!o.waitUntilFirstUpdate||this.hasUpdated)&&this[r](a,i)}}),c.call(this,t)}}}export{u as a};
@@ -1,121 +0,0 @@
1
- import * as lit_html from 'lit-html';
2
- import { LitElement } from 'lit';
3
-
4
- interface directedPair {
5
- destination: string;
6
- source: string;
7
- }
8
- interface ResponseInteraction {
9
- responseIdentifier: string;
10
- response: string | string[];
11
- }
12
- interface Calculate {
13
- calculate: () => string | string[];
14
- }
15
- type float = number;
16
- type integer = number;
17
- type BaseType = 'boolean' | 'directedPair' | 'duration' | 'float' | 'integer' | 'string' | 'identifier' | 'pair';
18
- type Multiple = string | string[][];
19
- type Ordered = string | string[][];
20
- type Cardinality = 'multiple' | 'ordered' | 'single';
21
-
22
- interface VariableDeclaration<T> {
23
- identifier: string;
24
- cardinality: Cardinality;
25
- baseType: BaseType;
26
- value: T;
27
- }
28
-
29
- declare class QtiMapping extends LitElement {
30
- defaultValue: number;
31
- lowerBound: number;
32
- upperBound: number;
33
- get mapEntries(): {
34
- mapKey: string;
35
- mappedValue: number;
36
- }[];
37
- }
38
-
39
- declare class ResponseVariable implements VariableDeclaration<string | string[]> {
40
- private _candidateResponse;
41
- private _mapping;
42
- private _correctResponse;
43
- private _cardinality;
44
- private _identifier;
45
- private _basetype;
46
- private _qtiVariable;
47
- constructor({ mapping, correctResponse, cardinality, baseType, identifier, }: {
48
- mapping: QtiMapping;
49
- correctResponse: string | string[];
50
- cardinality: Cardinality;
51
- baseType: BaseType;
52
- identifier: string;
53
- });
54
- get mapping(): QtiMapping;
55
- get correctResponse(): string | string[];
56
- get cardinality(): Cardinality;
57
- get baseType(): BaseType;
58
- get identifier(): string;
59
- get value(): string | string[];
60
- set value(val: string | string[]);
61
- }
62
-
63
- declare class OutcomeVariable implements VariableDeclaration<number | string | string[] | undefined> {
64
- identifier: string;
65
- cardinality: Cardinality;
66
- baseType: BaseType;
67
- value: number | string | string[] | undefined;
68
- }
69
-
70
- /**
71
- * @summary The qti-assessment-item element contains all the other QTI 3 item structures.
72
- * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.dltnnj87l0yj
73
- * @status stable
74
- * @since 4.0
75
- *
76
- * @dependency qti-feedback
77
- * @dependency qti-responseprocessing
78
- *
79
- * @slot - The default slot where all the other QTI 3 item structures go.
80
- *
81
- * @event qti-interaction-changed - Emitted when an interaction is changed.
82
- * @event qti-outcome-changed - Emitted when the radio group receives user input.
83
- *
84
- */
85
- declare class QtiAssessmentItem extends LitElement {
86
- variables: VariableDeclaration<(string | string[]) | number>[];
87
- private feedbackElements;
88
- private interactionElements;
89
- disabled: boolean;
90
- readonly: boolean;
91
- title: string;
92
- identifier: string;
93
- render(): lit_html.TemplateResult<1>;
94
- _handleDisabledChange: (_: boolean, disabled: boolean) => void;
95
- _handleReadonlyChange: (_: boolean, readonly: boolean) => void;
96
- constructor();
97
- connectedCallback(): void;
98
- disconnectedCallback(): void;
99
- private _registerVariable;
100
- showCorrectResponse(): void;
101
- processResponse(): boolean;
102
- set responses(myResponses: ResponseInteraction[]);
103
- resetInteractions(): void;
104
- validateResponses(): boolean;
105
- getVariable(identifier: string): VariableDeclaration<any>;
106
- getResponse(identifier: string): ResponseVariable | null;
107
- getOutcome(identifier: string): OutcomeVariable | null;
108
- private registerFeedbackElement;
109
- private registerInteractionElement;
110
- private interactionResponse;
111
- private outcomeChanged;
112
- private showFeedback;
113
- setOutcomeValue(identifier: string, value: string | number): void;
114
- }
115
- declare global {
116
- interface HTMLElementTagNameMap {
117
- 'qti-assessment-item': QtiAssessmentItem;
118
- }
119
- }
120
-
121
- export { BaseType as B, Cardinality as C, Multiple as M, Ordered as O, QtiAssessmentItem as Q, ResponseVariable as R, VariableDeclaration as V, ResponseInteraction as a, Calculate as b, OutcomeVariable as c, directedPair as d, QtiMapping as e, float as f, integer as i };
@@ -1,30 +0,0 @@
1
- import * as lit_html from 'lit-html';
2
- import * as lit from 'lit';
3
- import { LitElement } from 'lit';
4
- import { a as ResponseInteraction, Q as QtiAssessmentItem } from './qti-assessment-item-c1eb7de3.js';
5
-
6
- declare class QtiItem extends LitElement {
7
- disabled: boolean;
8
- handleDisabledChange(old: any, disabled: boolean): void;
9
- readonly: boolean;
10
- handleReadonlyChange(old: any, readonly: boolean): void;
11
- responses: ResponseInteraction[];
12
- handleResponsesChange(old: any, responses: ResponseInteraction[]): void;
13
- set qtiContext(context: {
14
- view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
15
- });
16
- private provider;
17
- get _item(): QtiAssessmentItem;
18
- private _xml;
19
- set xml(val: string);
20
- get xml(): string;
21
- static styles: lit.CSSResult;
22
- processResponse: () => boolean;
23
- showCorrectResponse: () => void;
24
- validateResponses: () => boolean;
25
- resetInteractions: () => void;
26
- connectedCallback(): void;
27
- render: () => lit_html.TemplateResult<1>;
28
- }
29
-
30
- export { QtiItem as Q };