@citolab/qti-components 6.0.23 → 6.0.25

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 (38) hide show
  1. package/dist/chunk-BVYXUE3V.js +1 -0
  2. package/dist/chunk-C4C24R3I.cjs +1 -0
  3. package/dist/chunk-OO5TITDR.js +17 -0
  4. package/dist/{chunk-EHTDKAYF.js → chunk-VBLA6PHI.cjs} +3 -3
  5. package/dist/{chunk-VI35S4EM.cjs → chunk-YFSV2M2E.js} +3 -3
  6. package/dist/chunk-Z2P5ZMVD.cjs +17 -0
  7. package/dist/custom-elements.json +612 -616
  8. package/dist/decorators/index.cjs +1 -1
  9. package/dist/decorators/index.js +1 -1
  10. package/dist/index.cjs +85 -81
  11. package/dist/index.d.cts +83 -91
  12. package/dist/index.d.ts +83 -91
  13. package/dist/index.js +80 -76
  14. package/dist/qti-components/index.cjs +34 -30
  15. package/dist/qti-components/index.d.cts +45 -49
  16. package/dist/qti-components/index.d.ts +45 -49
  17. package/dist/qti-components/index.js +63 -59
  18. package/dist/qti-item/index.cjs +1 -1
  19. package/dist/qti-item/index.d.cts +1 -2
  20. package/dist/qti-item/index.d.ts +1 -2
  21. package/dist/qti-item/index.js +1 -1
  22. package/dist/qti-item-395a9535.d.ts +19 -0
  23. package/dist/qti-item-react/index.cjs +1 -1
  24. package/dist/qti-item-react/index.d.cts +7 -15
  25. package/dist/qti-item-react/index.d.ts +7 -15
  26. package/dist/qti-item-react/index.js +1 -1
  27. package/dist/{qti-simple-choice-b4b79072.d.ts → qti-simple-choice-f19f8469.d.ts} +112 -5
  28. package/dist/qti-transform/index.cjs +1 -17
  29. package/dist/qti-transform/index.d.cts +1 -0
  30. package/dist/qti-transform/index.d.ts +1 -0
  31. package/dist/qti-transform/index.js +1 -17
  32. package/package.json +6 -7
  33. package/dist/chunk-3O4URV5U.cjs +0 -1
  34. package/dist/chunk-6RJ7J4AE.cjs +0 -1
  35. package/dist/chunk-M7QOVOG6.js +0 -1
  36. package/dist/chunk-WFLR5TH7.js +0 -1
  37. package/dist/qti-assessment-item-e8a67444.d.ts +0 -109
  38. package/dist/qti-item-77742afa.d.ts +0 -30
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkVI35S4EMcjs = require('../chunk-VI35S4EM.cjs');require('../chunk-GGEPFBR7.cjs');require('../chunk-3O4URV5U.cjs');require('../chunk-HOQW4KDA.cjs');exports.QtiItem = _chunkVI35S4EMcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkVBLA6PHIcjs = require('../chunk-VBLA6PHI.cjs');require('../chunk-GGEPFBR7.cjs');require('../chunk-Z2P5ZMVD.cjs');require('../chunk-HOQW4KDA.cjs');exports.QtiItem = _chunkVBLA6PHIcjs.a;
@@ -1,4 +1,3 @@
1
- export { Q as QtiItem } from '../qti-item-77742afa.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-e8a67444.js';
@@ -1,4 +1,3 @@
1
- export { Q as QtiItem } from '../qti-item-77742afa.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-e8a67444.js';
@@ -1 +1 @@
1
- import{a as o}from"../chunk-EHTDKAYF.js";import"../chunk-5GG2XAUT.js";import"../chunk-WFLR5TH7.js";import"../chunk-NMCIOGD2.js";export{o as QtiItem};
1
+ import{a as o}from"../chunk-YFSV2M2E.js";import"../chunk-5GG2XAUT.js";import"../chunk-OO5TITDR.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 _chunkVI35S4EMcjs = require('../chunk-VI35S4EM.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:_chunkVI35S4EMcjs.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 _chunkVBLA6PHIcjs = require('../chunk-VBLA6PHI.cjs');require('../chunk-GGEPFBR7.cjs');require('../chunk-Z2P5ZMVD.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:_chunkVBLA6PHIcjs.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-77742afa.js';
3
- import { a as ResponseInteraction } from '../qti-assessment-item-e8a67444.js';
4
- import { O as OutcomeChangedDetails, b as InteractionChangedDetails } from '../qti-simple-choice-b4b79072.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-f19f8469.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-77742afa.js';
3
- import { a as ResponseInteraction } from '../qti-assessment-item-e8a67444.js';
4
- import { O as OutcomeChangedDetails, b as InteractionChangedDetails } from '../qti-simple-choice-b4b79072.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-f19f8469.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-EHTDKAYF.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-YFSV2M2E.js";import"../chunk-5GG2XAUT.js";import"../chunk-OO5TITDR.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-e8a67444.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,49 @@ declare namespace qtiInteractionChanged {
43
60
  };
44
61
  }
45
62
 
63
+ declare class QtiMapping extends LitElement {
64
+ defaultValue: number;
65
+ lowerBound: number;
66
+ upperBound: number;
67
+ get mapEntries(): {
68
+ mapKey: string;
69
+ mappedValue: number;
70
+ }[];
71
+ }
72
+
73
+ interface VariableDeclaration<T> {
74
+ identifier: string;
75
+ cardinality: Cardinality;
76
+ baseType: BaseType;
77
+ value: T;
78
+ }
79
+ interface ResultVariable {
80
+ cardinality: Cardinality;
81
+ baseType: BaseType;
82
+ result: number | boolean | string | (number | boolean | string)[];
83
+ }
84
+ declare class OutcomeVariable implements VariableDeclaration<string | string[] | null> {
85
+ identifier: string;
86
+ cardinality: Cardinality;
87
+ baseType: BaseType;
88
+ value: string | string[] | null;
89
+ }
90
+ declare class ResponseVariable implements VariableDeclaration<string | string[] | null> {
91
+ identifier: string;
92
+ cardinality: Cardinality;
93
+ baseType: BaseType;
94
+ value: string | string[] | null;
95
+ candidateResponse: string | string[] | null;
96
+ mapping: QtiMapping;
97
+ correctResponse: string | string[] | null;
98
+ }
99
+
46
100
  type QtiRegisterVariable = CustomEvent<{
47
- variable: VariableDeclaration<number | string | string[]>;
101
+ variable: VariableDeclaration<string | string[]>;
48
102
  }>;
49
103
  declare global {
50
104
  interface GlobalEventHandlersEventMap {
51
- "qti-register-variable": QtiRegisterVariable;
105
+ 'qti-register-variable': QtiRegisterVariable;
52
106
  }
53
107
  }
54
108
 
@@ -139,6 +193,59 @@ declare namespace qtiChoiceElementSelected {
139
193
  };
140
194
  }
141
195
 
196
+ /**
197
+ * @summary The qti-assessment-item element contains all the other QTI 3 item structures.
198
+ * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.dltnnj87l0yj
199
+ * @status stable
200
+ * @since 4.0
201
+ *
202
+ * @dependency qti-feedback
203
+ * @dependency qti-responseprocessing
204
+ *
205
+ * @slot - The default slot where all the other QTI 3 item structures go.
206
+ *
207
+ * @event qti-interaction-changed - Emitted when an interaction is changed.
208
+ * @event qti-outcome-changed - Emitted when an outcome has changed.
209
+ * @event qti-response-processing - Emitted when response-processing is called.
210
+ *
211
+ */
212
+ declare class QtiAssessmentItem extends LitElement {
213
+ variables: VariableDeclaration<string | string[]>[];
214
+ private feedbackElements;
215
+ private interactionElements;
216
+ disabled: boolean;
217
+ readonly: boolean;
218
+ title: string;
219
+ identifier: string;
220
+ private _numAttempts;
221
+ render(): lit_html.TemplateResult<1>;
222
+ _handleDisabledChange: (_: boolean, disabled: boolean) => void;
223
+ _handleReadonlyChange: (_: boolean, readonly: boolean) => void;
224
+ constructor();
225
+ firstUpdated(val: any): void;
226
+ disconnectedCallback(): void;
227
+ private _registerVariable;
228
+ showCorrectResponse(): void;
229
+ processResponse(): boolean;
230
+ set responses(myResponses: ResponseInteraction[]);
231
+ resetInteractions(): void;
232
+ validateResponses(): boolean;
233
+ getVariable(identifier: string): VariableDeclaration<string | string[] | undefined>;
234
+ getResponse(identifier: string): ResponseVariable | null;
235
+ getOutcome(identifier: string): OutcomeVariable | null;
236
+ private registerFeedbackElement;
237
+ private registerInteractionElement;
238
+ private interactionResponse;
239
+ private outcomeChanged;
240
+ private showFeedback;
241
+ setOutcomeValue(identifier: string, value: string): void;
242
+ }
243
+ declare global {
244
+ interface HTMLElementTagNameMap {
245
+ 'qti-assessment-item': QtiAssessmentItem;
246
+ }
247
+ }
248
+
142
249
  /**
143
250
  * @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
251
  * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.sphpo6lu6zqi
@@ -352,4 +459,4 @@ declare global {
352
459
  }
353
460
  }
354
461
 
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 };
462
+ export { QtiHottext as A, BaseType as B, Cardinality as C, QtiSimpleChoice as D, 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, ResultVariable as t, OutcomeVariable as u, QtiTextEntryInteraction as v, QtiExtendedTextInteraction as w, QtiChoiceInteraction as x, QtiResponseProcessing as y, QtiMapping 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 _chunkZ2P5ZMVDcjs = require('../chunk-Z2P5ZMVD.cjs');require('../chunk-HOQW4KDA.cjs');exports.qtiTransform = _chunkZ2P5ZMVDcjs.a;
@@ -6,6 +6,7 @@ declare const qtiTransform: (xmlValue: string) => {
6
6
  pciHooks(uri: string): any;
7
7
  assetsLocation(uri: string, attributes?: string[]): any;
8
8
  customTypes(): any;
9
+ customDefinition(): any;
9
10
  suffix(elements: string[], suffix: string): any;
10
11
  fn(fn: (xmlString: string) => string): any;
11
12
  fnCh(fn: (xmlString: cheerio.CheerioAPI) => void): any;
@@ -6,6 +6,7 @@ declare const qtiTransform: (xmlValue: string) => {
6
6
  pciHooks(uri: string): any;
7
7
  assetsLocation(uri: string, attributes?: string[]): any;
8
8
  customTypes(): any;
9
+ customDefinition(): any;
9
10
  suffix(elements: string[], suffix: string): any;
10
11
  fn(fn: (xmlString: string) => string): any;
11
12
  fnCh(fn: (xmlString: cheerio.CheerioAPI) => void): any;
@@ -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-OO5TITDR.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.23",
15
+ "version": "6.0.25",
16
16
  "type": "module",
17
17
  "main": "dist/index.js",
18
18
  "exports": {
@@ -103,7 +103,7 @@
103
103
  },
104
104
  "dependencies": {
105
105
  "@lit-labs/context": "^0.3.3",
106
- "@lit-labs/react": "^1.2.0",
106
+ "@lit-labs/react": "^1.2.1",
107
107
  "@tailwindcss/nesting": "^0.0.0-insiders.565cd3e",
108
108
  "cheerio": "^1.0.0-rc.12",
109
109
  "haunted": "^5.0.0",
@@ -111,10 +111,10 @@
111
111
  "lit-xml": "^0.5.0"
112
112
  },
113
113
  "peerdependencies": {
114
- "@lit-labs/context": "^0.3.0",
115
- "cheerio": "^1.0.0-rc.12",
116
- "haunted": ">= 5 < 6",
117
- "lit": ">= 2 < 3"
114
+ "@lit-labs/context": "> 0.3",
115
+ "@lit-labs/react": "> 1.2",
116
+ "lit": ">= 3 < 4",
117
+ "react": "> 18"
118
118
  },
119
119
  "devDependencies": {
120
120
  "@custom-elements-manifest/analyzer": "^0.8.3",
@@ -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,109 +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[] | undefined> {
40
- identifier: string;
41
- cardinality: Cardinality;
42
- baseType: BaseType;
43
- value: string | string[] | undefined;
44
- candidateResponse: string | string[];
45
- mapping: QtiMapping;
46
- correctResponse: string | string[];
47
- }
48
-
49
- declare class OutcomeVariable implements VariableDeclaration<number | string | string[] | undefined> {
50
- identifier: string;
51
- cardinality: Cardinality;
52
- baseType: BaseType;
53
- value: number | string | string[] | undefined;
54
- }
55
-
56
- /**
57
- * @summary The qti-assessment-item element contains all the other QTI 3 item structures.
58
- * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.dltnnj87l0yj
59
- * @status stable
60
- * @since 4.0
61
- *
62
- * @dependency qti-feedback
63
- * @dependency qti-responseprocessing
64
- *
65
- * @slot - The default slot where all the other QTI 3 item structures go.
66
- *
67
- * @event qti-interaction-changed - Emitted when an interaction is changed.
68
- * @event qti-outcome-changed - Emitted when an outcome has changed.
69
- * @event qti-response-processing - Emitted when response-processing is called.
70
- *
71
- */
72
- declare class QtiAssessmentItem extends LitElement {
73
- variables: VariableDeclaration<(string | string[]) | number>[];
74
- private feedbackElements;
75
- private interactionElements;
76
- disabled: boolean;
77
- readonly: boolean;
78
- title: string;
79
- identifier: string;
80
- private _numAttempts;
81
- render(): lit_html.TemplateResult<1>;
82
- _handleDisabledChange: (_: boolean, disabled: boolean) => void;
83
- _handleReadonlyChange: (_: boolean, readonly: boolean) => void;
84
- constructor();
85
- connectedCallback(): void;
86
- disconnectedCallback(): void;
87
- private _registerVariable;
88
- showCorrectResponse(): void;
89
- processResponse(): boolean;
90
- set responses(myResponses: ResponseInteraction[]);
91
- resetInteractions(): void;
92
- validateResponses(): boolean;
93
- getVariable(identifier: string): VariableDeclaration<number | string | string[] | undefined>;
94
- getResponse(identifier: string): ResponseVariable | null;
95
- getOutcome(identifier: string): OutcomeVariable | null;
96
- private registerFeedbackElement;
97
- private registerInteractionElement;
98
- private interactionResponse;
99
- private outcomeChanged;
100
- private showFeedback;
101
- setOutcomeValue(identifier: string, value: string | number): void;
102
- }
103
- declare global {
104
- interface HTMLElementTagNameMap {
105
- 'qti-assessment-item': QtiAssessmentItem;
106
- }
107
- }
108
-
109
- 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-e8a67444.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 };