@citolab/qti-components 7.0.6-beta.3 → 7.0.6-beta.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/cdn/chunks/{chunk-MJMONWKB.js → chunk-4ILXLVT5.js} +8 -2
- package/cdn/chunks/chunk-4PEUIMDK.js +8 -0
- package/cdn/chunks/chunk-EFU4L43Q.js +8 -0
- package/cdn/chunks/chunk-H2V2RXUW.js +11 -0
- package/cdn/chunks/chunk-IQZ7AOCQ.js +8 -0
- package/cdn/chunks/chunk-J3JSSCM6.js +5 -0
- package/cdn/chunks/chunk-LARBLB7K.js +8 -0
- package/cdn/chunks/chunk-PPWEIKLT.js +1 -0
- package/cdn/chunks/{chunk-N5OHGRGG.js → chunk-PT523RSK.js} +2 -2
- package/cdn/chunks/chunk-QTK4CPHP.js +8 -0
- package/cdn/chunks/chunk-RIXTWE2H.js +8 -0
- package/cdn/chunks/chunk-ROZIP5LG.js +8 -0
- package/cdn/chunks/chunk-RPZVSBLM.js +8 -0
- package/cdn/chunks/chunk-TEYXRLTI.js +8 -0
- package/cdn/chunks/{chunk-TVDTF6P6.js → chunk-U2TE6TOV.js} +89 -89
- package/cdn/chunks/{chunk-6S4CDN3T.js → chunk-YHWMZAZD.js} +2 -2
- package/cdn/chunks/{chunk-TQBDBMWL.js → chunk-YWH4TGMA.js} +1 -1
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +1 -1
- package/cdn/qti-components/index.js +1 -1
- package/cdn/qti-item/core/index.js +1 -1
- package/cdn/qti-test/components/index.js +1 -1
- package/cdn/qti-test/components/test-component.abstract.js +1 -1
- package/cdn/qti-test/components/test-end-attempt.js +1 -0
- package/cdn/qti-test/components/test-item-link.js +1 -1
- package/cdn/qti-test/components/test-next.js +1 -1
- package/cdn/qti-test/components/test-paging-buttons-stamp.js +1 -1
- package/cdn/qti-test/components/test-prev.js +1 -1
- package/cdn/qti-test/components/test-show-correct-response.js +1 -0
- package/cdn/qti-test/components/test-view.js +1 -1
- package/cdn/qti-test/core/index.js +1 -1
- package/dist/chunks/{chunk-ZHAJ3CMP.js → chunk-6PAEJQSQ.js} +107 -140
- package/dist/chunks/chunk-6PAEJQSQ.js.map +1 -0
- package/dist/chunks/{chunk-UFYWCLXF.js → chunk-AUWATZ65.js} +1 -1
- package/dist/chunks/{chunk-UFYWCLXF.js.map → chunk-AUWATZ65.js.map} +1 -1
- package/dist/chunks/{chunk-7QMCKYDR.js → chunk-CEXAR7BF.js} +13 -4
- package/dist/chunks/chunk-CEXAR7BF.js.map +1 -0
- package/dist/chunks/{chunk-GSWZT6N2.js → chunk-DNHDFXTV.js} +14 -5
- package/dist/chunks/chunk-DNHDFXTV.js.map +1 -0
- package/dist/chunks/chunk-GQ5P3NWC.js +46 -0
- package/dist/chunks/chunk-GQ5P3NWC.js.map +1 -0
- package/dist/chunks/chunk-HOTNM5DT.js +1 -0
- package/dist/chunks/{chunk-3EU75IUF.js → chunk-MLT7V47R.js} +3 -21
- package/dist/chunks/chunk-MLT7V47R.js.map +1 -0
- package/dist/chunks/{chunk-J2SHENRN.js → chunk-NZQKGIJP.js} +9 -3
- package/dist/chunks/{chunk-J2SHENRN.js.map → chunk-NZQKGIJP.js.map} +1 -1
- package/dist/chunks/{chunk-6JXR63MH.js → chunk-RX3BRYYI.js} +14 -5
- package/dist/chunks/chunk-RX3BRYYI.js.map +1 -0
- package/dist/chunks/chunk-W4272Q5U.js +46 -0
- package/dist/chunks/chunk-W4272Q5U.js.map +1 -0
- package/dist/chunks/{chunk-A24F75DB.js → chunk-WWN5AD6V.js} +11 -2
- package/dist/chunks/chunk-WWN5AD6V.js.map +1 -0
- package/dist/chunks/{chunk-HHVRU3AJ.js → chunk-XCHS3RTZ.js} +2 -2
- package/dist/chunks/{chunk-KYAIMBP5.js → chunk-YQB6YLNW.js} +3 -3
- package/dist/chunks/chunk-YQB6YLNW.js.map +1 -0
- package/dist/chunks/{chunk-4GNVYCBN.js → chunk-ZQXZ6PK7.js} +92 -70
- package/dist/chunks/chunk-ZQXZ6PK7.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +29 -21
- package/dist/item.css +8 -2
- package/dist/qti-components/index.d.ts +2 -2
- package/dist/qti-components/index.js +1 -1
- package/dist/qti-components-jsx.d.ts +62 -46
- package/dist/qti-item/core/index.js +2 -2
- package/dist/qti-loader/index.d.ts +1 -1
- package/dist/{qti-response-declaration-DAeBp8HH.d.ts → qti-response-declaration-Di9CsqiJ.d.ts} +4 -0
- package/dist/qti-test/components/index.d.ts +4 -2
- package/dist/qti-test/components/index.js +17 -9
- package/dist/qti-test/components/test-component.abstract.d.ts +2 -4
- package/dist/qti-test/components/test-component.abstract.js +2 -2
- package/dist/qti-test/components/test-end-attempt.d.ts +26 -0
- package/dist/qti-test/components/test-end-attempt.js +13 -0
- package/dist/qti-test/components/test-end-attempt.js.map +1 -0
- package/dist/qti-test/components/test-item-link.d.ts +3 -2
- package/dist/qti-test/components/test-item-link.js +4 -4
- package/dist/qti-test/components/test-next.d.ts +3 -2
- package/dist/qti-test/components/test-next.js +4 -4
- package/dist/qti-test/components/test-paging-buttons-stamp.d.ts +2 -2
- package/dist/qti-test/components/test-paging-buttons-stamp.js +3 -3
- package/dist/qti-test/components/test-prev.d.ts +3 -2
- package/dist/qti-test/components/test-prev.js +4 -4
- package/dist/qti-test/components/test-show-correct-response.d.ts +26 -0
- package/dist/qti-test/components/test-show-correct-response.js +13 -0
- package/dist/qti-test/components/test-show-correct-response.js.map +1 -0
- package/dist/qti-test/components/test-view.d.ts +3 -2
- package/dist/qti-test/components/test-view.js +3 -3
- package/dist/qti-test/core/index.d.ts +6 -6
- package/dist/qti-test/core/index.js +3 -3
- package/dist/{test.context-CaENAJNk.d.ts → test.context-CmsDQ8k2.d.ts} +3 -5
- package/dist/vscode.html-custom-data.json +36 -17
- package/package.json +1 -1
- package/cdn/chunks/chunk-5P7CTN7Q.js +0 -11
- package/cdn/chunks/chunk-DZCKF45D.js +0 -5
- package/cdn/chunks/chunk-IMJOPCFR.js +0 -1
- package/cdn/chunks/chunk-NDHSIO2G.js +0 -8
- package/cdn/chunks/chunk-QV6I5NVQ.js +0 -8
- package/dist/chunks/chunk-3EU75IUF.js.map +0 -1
- package/dist/chunks/chunk-4GNVYCBN.js.map +0 -1
- package/dist/chunks/chunk-6JXR63MH.js.map +0 -1
- package/dist/chunks/chunk-7QMCKYDR.js.map +0 -1
- package/dist/chunks/chunk-A24F75DB.js.map +0 -1
- package/dist/chunks/chunk-GSWZT6N2.js.map +0 -1
- package/dist/chunks/chunk-KYAIMBP5.js.map +0 -1
- package/dist/chunks/chunk-UN2IFSGC.js +0 -1
- package/dist/chunks/chunk-ZHAJ3CMP.js.map +0 -1
- /package/cdn/chunks/{chunk-3GO57DNP.js → chunk-6PW2L463.js} +0 -0
- /package/dist/chunks/{chunk-UN2IFSGC.js.map → chunk-HOTNM5DT.js.map} +0 -0
- /package/dist/chunks/{chunk-HHVRU3AJ.js.map → chunk-XCHS3RTZ.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/qti-test/core/context/test.context.ts"],"sourcesContent":["import { createContext } from '@lit/context';\nimport type { QtiAssessmentTest } from '../qti-assessment-test';\nimport type { View } from '../mixins/test-view.mixin';\nimport type { VariableDeclaration } from '../../../exports/variables';\nimport type { ItemContext } from '../../../exports/item.context';\n\nexport interface TestContext {\n items: (ItemContext & { category?: string })[];\n testOutcomeVariables: VariableDeclaration<string | string[] | null>[];\n navPartId?: string | null;\n navSectionId?: string | null;\n navItemId?: string | null;\n navItemLoading?: boolean;\n navTestLoading?: boolean;\n view?: View;\n}\n\nexport const testContext = createContext<Readonly<TestContext>>(Symbol('test'));\n\nexport type TestElement =
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-test/core/context/test.context.ts"],"sourcesContent":["import { createContext } from '@lit/context';\nimport type { QtiAssessmentTest } from '../qti-assessment-test';\nimport type { View } from '../mixins/test-view.mixin';\nimport type { VariableDeclaration } from '../../../exports/variables';\nimport type { ItemContext } from '../../../exports/item.context';\n\nexport interface TestContext {\n items: (ItemContext & { category?: string })[];\n testOutcomeVariables: VariableDeclaration<string | string[] | null>[];\n navPartId?: string | null;\n navSectionId?: string | null;\n navItemId?: string | null;\n navItemLoading?: boolean;\n navTestLoading?: boolean;\n view?: View;\n}\n\nexport const testContext = createContext<Readonly<TestContext>>(Symbol('test'));\n\nexport type TestElement = QtiAssessmentTest | null;\n\nexport const testElement = createContext<Readonly<TestElement>>(Symbol('testElement'));\n"],"mappings":";AAAA,SAAS,qBAAqB;AAiBvB,IAAM,cAAc,cAAqC,OAAO,MAAM,CAAC;AAIvE,IAAM,cAAc,cAAqC,OAAO,aAAa,CAAC;","names":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TestComponent
|
|
3
|
+
} from "./chunk-MLT7V47R.js";
|
|
1
4
|
import {
|
|
2
5
|
btn,
|
|
3
6
|
dis
|
|
4
7
|
} from "./chunk-4O5F7WV7.js";
|
|
5
|
-
import {
|
|
6
|
-
TestComponent
|
|
7
|
-
} from "./chunk-3EU75IUF.js";
|
|
8
8
|
import {
|
|
9
9
|
__decorateClass
|
|
10
10
|
} from "./chunk-H2JE6IVU.js";
|
|
@@ -18,6 +18,15 @@ var TestItemLink = class extends TestComponent {
|
|
|
18
18
|
this.itemId = null;
|
|
19
19
|
this.addEventListener("click", () => this._requestItem(this.itemId));
|
|
20
20
|
}
|
|
21
|
+
_requestItem(identifier) {
|
|
22
|
+
this.dispatchEvent(
|
|
23
|
+
new CustomEvent("qti-request-test-item", {
|
|
24
|
+
composed: true,
|
|
25
|
+
bubbles: true,
|
|
26
|
+
detail: identifier
|
|
27
|
+
})
|
|
28
|
+
);
|
|
29
|
+
}
|
|
21
30
|
render() {
|
|
22
31
|
return html` <slot></slot> `;
|
|
23
32
|
}
|
|
@@ -40,4 +49,4 @@ TestItemLink = __decorateClass([
|
|
|
40
49
|
export {
|
|
41
50
|
TestItemLink
|
|
42
51
|
};
|
|
43
|
-
//# sourceMappingURL=chunk-
|
|
52
|
+
//# sourceMappingURL=chunk-CEXAR7BF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-test/components/test-item-link.ts"],"sourcesContent":["import { css, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { TestComponent } from './test-component.abstract';\nimport * as styles from './styles';\n\n@customElement('test-item-link')\nexport class TestItemLink extends TestComponent {\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n @property({ type: String, attribute: 'item-id' })\n private itemId: string = null;\n\n constructor() {\n super();\n this.addEventListener('click', () => this._requestItem(this.itemId));\n }\n\n protected _requestItem(identifier: string): void {\n this.dispatchEvent(\n new CustomEvent('qti-request-test-item', {\n composed: true,\n bubbles: true,\n detail: identifier\n })\n );\n }\n\n render() {\n return html` <slot></slot> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-item-link': TestItemLink;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,YAAY;AAC1B,SAAS,eAAe,gBAAgB;AAKjC,IAAM,eAAN,cAA2B,cAAc;AAAA,EAa9C,cAAc;AACZ,UAAM;AAHR,SAAQ,SAAiB;AAIvB,SAAK,iBAAiB,SAAS,MAAM,KAAK,aAAa,KAAK,MAAM,CAAC;AAAA,EACrE;AAAA,EAEU,aAAa,YAA0B;AAC/C,SAAK;AAAA,MACH,IAAI,YAAY,yBAAyB;AAAA,QACvC,UAAU;AAAA,QACV,SAAS;AAAA,QACT,QAAQ;AAAA,MACV,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AA/Ba,aACJ,SAAS;AAAA;AAAA,QAEH,GAAG;AAAA;AAAA;AAAA,QAGH,GAAG;AAAA;AAAA;AAKR;AAAA,EADP,SAAS,EAAE,MAAM,QAAQ,WAAW,UAAU,CAAC;AAAA,GAVrC,aAWH;AAXG,eAAN;AAAA,EADN,cAAc,gBAAgB;AAAA,GAClB;","names":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TestComponent
|
|
3
|
+
} from "./chunk-MLT7V47R.js";
|
|
1
4
|
import {
|
|
2
5
|
btn,
|
|
3
6
|
dis
|
|
4
7
|
} from "./chunk-4O5F7WV7.js";
|
|
5
|
-
import {
|
|
6
|
-
TestComponent
|
|
7
|
-
} from "./chunk-3EU75IUF.js";
|
|
8
8
|
import {
|
|
9
9
|
__decorateClass
|
|
10
10
|
} from "./chunk-H2JE6IVU.js";
|
|
@@ -22,10 +22,19 @@ var TestPrev = class extends TestComponent {
|
|
|
22
22
|
if (!this.disabled) this._requestItem(this.items[this.itemIndex - 1].identifier);
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
+
_requestItem(identifier) {
|
|
26
|
+
this.dispatchEvent(
|
|
27
|
+
new CustomEvent("qti-request-test-item", {
|
|
28
|
+
composed: true,
|
|
29
|
+
bubbles: true,
|
|
30
|
+
detail: identifier
|
|
31
|
+
})
|
|
32
|
+
);
|
|
33
|
+
}
|
|
25
34
|
willUpdate(changedProperties) {
|
|
26
35
|
super.willUpdate(changedProperties);
|
|
27
36
|
if (changedProperties.has("_testContext")) {
|
|
28
|
-
this.disabled = !this._testElement
|
|
37
|
+
this.disabled = !this._testElement || this.itemIndex === 0 || this.itemIndex === -1;
|
|
29
38
|
}
|
|
30
39
|
}
|
|
31
40
|
render() {
|
|
@@ -47,4 +56,4 @@ TestPrev = __decorateClass([
|
|
|
47
56
|
export {
|
|
48
57
|
TestPrev
|
|
49
58
|
};
|
|
50
|
-
//# sourceMappingURL=chunk-
|
|
59
|
+
//# sourceMappingURL=chunk-DNHDFXTV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-test/components/test-prev.ts"],"sourcesContent":["import { css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { TestComponent } from './test-component.abstract';\nimport * as styles from './styles';\n\n/**\n * Represents a custom element for navigating to the previous test item.\n *\n * @remarks\n * This element provides functionality for navigating to the previous test item.\n *\n * @example\n * ```html\n * <test-prev></test-prev>\n * ```\n */\n@customElement('test-prev')\nexport class TestPrev extends TestComponent {\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n constructor() {\n super();\n this._internals.role = 'button';\n this._internals.ariaLabel = 'Next item';\n\n this.addEventListener('click', e => {\n e.preventDefault();\n if (!this.disabled) this._requestItem(this.items[this.itemIndex - 1].identifier);\n });\n }\n\n protected _requestItem(identifier: string): void {\n this.dispatchEvent(\n new CustomEvent('qti-request-test-item', {\n composed: true,\n bubbles: true,\n detail: identifier\n })\n );\n }\n\n willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n super.willUpdate(changedProperties);\n if (changedProperties.has('_testContext')) {\n this.disabled = !this._testElement || this.itemIndex === 0 || this.itemIndex === -1;\n }\n }\n\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-previous': TestPrev;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,YAAY;AAC1B,SAAS,qBAAqB;AAgBvB,IAAM,WAAN,cAAuB,cAAc;AAAA,EAU1C,cAAc;AACZ,UAAM;AACN,SAAK,WAAW,OAAO;AACvB,SAAK,WAAW,YAAY;AAE5B,SAAK,iBAAiB,SAAS,OAAK;AAClC,QAAE,eAAe;AACjB,UAAI,CAAC,KAAK,SAAU,MAAK,aAAa,KAAK,MAAM,KAAK,YAAY,CAAC,EAAE,UAAU;AAAA,IACjF,CAAC;AAAA,EACH;AAAA,EAEU,aAAa,YAA0B;AAC/C,SAAK;AAAA,MACH,IAAI,YAAY,yBAAyB;AAAA,QACvC,UAAU;AAAA,QACV,SAAS;AAAA,QACT,QAAQ;AAAA,MACV,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,WAAW,mBAA2D;AACpE,UAAM,WAAW,iBAAiB;AAClC,QAAI,kBAAkB,IAAI,cAAc,GAAG;AACzC,WAAK,WAAW,CAAC,KAAK,gBAAgB,KAAK,cAAc,KAAK,KAAK,cAAc;AAAA,IACnF;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AAzCa,SACJ,SAAS;AAAA;AAAA,QAEH,GAAG;AAAA;AAAA;AAAA,QAGH,GAAG;AAAA;AAAA;AANL,WAAN;AAAA,EADN,cAAc,WAAW;AAAA,GACb;","names":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TestComponent
|
|
3
|
+
} from "./chunk-MLT7V47R.js";
|
|
4
|
+
import {
|
|
5
|
+
btn,
|
|
6
|
+
dis
|
|
7
|
+
} from "./chunk-4O5F7WV7.js";
|
|
8
|
+
import {
|
|
9
|
+
__decorateClass
|
|
10
|
+
} from "./chunk-H2JE6IVU.js";
|
|
11
|
+
|
|
12
|
+
// src/lib/qti-test/components/test-show-correct-response.ts
|
|
13
|
+
import { css, html } from "lit";
|
|
14
|
+
import { customElement } from "lit/decorators.js";
|
|
15
|
+
var TestShowCorrectResponse = class extends TestComponent {
|
|
16
|
+
_processResponse() {
|
|
17
|
+
const qtiItemEl = this._testElement.querySelector(
|
|
18
|
+
`qti-assessment-item-ref[identifier="${this._testContext.navItemId}"]`
|
|
19
|
+
);
|
|
20
|
+
const qtiAssessmentItemEl = qtiItemEl.assessmentItem;
|
|
21
|
+
qtiAssessmentItemEl.showCorrectResponse(true);
|
|
22
|
+
}
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
this.addEventListener("click", () => this._processResponse());
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
return html` <slot></slot> `;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
TestShowCorrectResponse.styles = css`
|
|
32
|
+
:host {
|
|
33
|
+
${btn};
|
|
34
|
+
}
|
|
35
|
+
:host([disabled]) {
|
|
36
|
+
${dis};
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
TestShowCorrectResponse = __decorateClass([
|
|
40
|
+
customElement("test-show-correct-response")
|
|
41
|
+
], TestShowCorrectResponse);
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
TestShowCorrectResponse
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=chunk-GQ5P3NWC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-test/components/test-show-correct-response.ts"],"sourcesContent":["import { css, html } from 'lit';\n\nimport { customElement } from 'lit/decorators.js';\nimport type { QtiAssessmentItemRef } from '../core';\nimport * as styles from './styles';\nimport { TestComponent } from './test-component.abstract';\n\n@customElement('test-show-correct-response')\nexport class TestShowCorrectResponse extends TestComponent {\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n _processResponse() {\n const qtiItemEl = this._testElement.querySelector<QtiAssessmentItemRef>(\n `qti-assessment-item-ref[identifier=\"${this._testContext.navItemId}\"]`\n );\n const qtiAssessmentItemEl = qtiItemEl.assessmentItem;\n qtiAssessmentItemEl.showCorrectResponse(true);\n }\n\n constructor() {\n super();\n this.addEventListener('click', () => this._processResponse());\n }\n\n render() {\n return html` <slot></slot> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-show-correct-response': TestShowCorrectResponse;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,YAAY;AAE1B,SAAS,qBAAqB;AAMvB,IAAM,0BAAN,cAAsC,cAAc;AAAA,EAUzD,mBAAmB;AACjB,UAAM,YAAY,KAAK,aAAa;AAAA,MAClC,uCAAuC,KAAK,aAAa,SAAS;AAAA,IACpE;AACA,UAAM,sBAAsB,UAAU;AACtC,wBAAoB,oBAAoB,IAAI;AAAA,EAC9C;AAAA,EAEA,cAAc;AACZ,UAAM;AACN,SAAK,iBAAiB,SAAS,MAAM,KAAK,iBAAiB,CAAC;AAAA,EAC9D;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AA1Ba,wBACJ,SAAS;AAAA;AAAA,QAEH,GAAG;AAAA;AAAA;AAAA,QAGH,GAAG;AAAA;AAAA;AANL,0BAAN;AAAA,EADN,cAAc,4BAA4B;AAAA,GAC9B;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-HOTNM5DT.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
testContext,
|
|
3
3
|
testElement
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AUWATZ65.js";
|
|
5
5
|
import {
|
|
6
6
|
watch
|
|
7
7
|
} from "./chunk-ELDMXTUQ.js";
|
|
@@ -61,7 +61,7 @@ var TestComponent = class extends LitElement {
|
|
|
61
61
|
this._internals = this.attachInternals();
|
|
62
62
|
}
|
|
63
63
|
_handleTestElementChange(_oldValue, newValue) {
|
|
64
|
-
if (newValue
|
|
64
|
+
if (newValue) {
|
|
65
65
|
this.disabled = false;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
@@ -73,24 +73,6 @@ var TestComponent = class extends LitElement {
|
|
|
73
73
|
this.view = this._testContext?.view;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
_switchView(view) {
|
|
77
|
-
this.dispatchEvent(
|
|
78
|
-
new CustomEvent("on-test-switch-view", {
|
|
79
|
-
composed: true,
|
|
80
|
-
bubbles: true,
|
|
81
|
-
detail: view
|
|
82
|
-
})
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
_requestItem(identifier) {
|
|
86
|
-
this.dispatchEvent(
|
|
87
|
-
new CustomEvent("qti-request-test-item", {
|
|
88
|
-
composed: true,
|
|
89
|
-
bubbles: true,
|
|
90
|
-
detail: identifier
|
|
91
|
-
})
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
76
|
};
|
|
95
77
|
__decorateClass([
|
|
96
78
|
propInternalState({
|
|
@@ -115,4 +97,4 @@ __decorateClass([
|
|
|
115
97
|
export {
|
|
116
98
|
TestComponent
|
|
117
99
|
};
|
|
118
|
-
//# sourceMappingURL=chunk-
|
|
100
|
+
//# sourceMappingURL=chunk-MLT7V47R.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-test/components/test-component.abstract.ts","../../src/lib/decorators/prop-internal-state.ts"],"sourcesContent":["import { consume } from '@lit/context';\nimport { LitElement } from 'lit';\nimport { state } from 'lit/decorators.js';\nimport { propInternalState } from '../../decorators';\nimport type { TestElement, TestContext } from '../core/context';\nimport { testContext, testElement } from '../core/context';\nimport { watch } from '../../decorators/watch';\n\nexport abstract class TestComponent extends LitElement {\n @propInternalState({\n type: Boolean,\n reflect: true,\n aria: 'ariaDisabled' // Maps to `aria-disabled` attribute\n })\n public disabled = true;\n\n @state()\n @consume({ context: testContext, subscribe: true })\n protected _testContext?: TestContext;\n\n @state()\n @consume({ context: testElement, subscribe: true })\n protected _testElement?: TestElement;\n @watch('_testElement')\n _handleTestElementChange(_oldValue: TestElement, newValue: TestElement) {\n if (newValue) {\n this.disabled = false;\n }\n }\n\n protected _internals: ElementInternals;\n\n protected items;\n protected itemIndex;\n protected view;\n\n constructor() {\n super();\n this._internals = this.attachInternals();\n }\n\n protected willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n if (changedProperties.has('_testContext')) {\n const { items = [], navItemId } = this._testContext ?? {};\n this.itemIndex = items.findIndex(item => item.identifier === navItemId);\n this.items = items;\n this.view = this._testContext?.view;\n }\n }\n}\n","import type { ReactiveElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport type { PropertyDeclaration } from 'lit';\n\n// Extended decorator options\ninterface InternalStateOptions extends PropertyDeclaration {\n aria?: string; // Corresponding ARIA attribute, e.g., 'aria-disabled'\n}\n\nexport function propInternalState(options: InternalStateOptions) {\n return (protoOrDescriptor: any, name: string) => {\n // Apply the default Lit `@property` decorator\n property(options)(protoOrDescriptor, name);\n\n // Intercept the property descriptor to enhance functionality\n const key = `__${name}`; // Internal backing field\n\n Object.defineProperty(protoOrDescriptor, name, {\n get() {\n return this[key];\n },\n set(value: any) {\n const oldValue = this[key];\n this[key] = value;\n\n // Trigger updates if value changes\n if (oldValue !== value) {\n // Update internals state\n if (this._internals?.states) {\n const stateName = name.toLowerCase();\n if (value) {\n this._internals.states.add(`--${stateName}`);\n } else {\n this._internals.states.delete(`--${stateName}`);\n }\n }\n\n // Update ARIA attributes if specified\n if (options.aria && this._internals) {\n const ariaAttribute = options.aria;\n if (value) {\n this._internals[ariaAttribute] = 'true';\n } else {\n this._internals[ariaAttribute] = null;\n }\n }\n\n // Request an update\n (this as ReactiveElement).requestUpdate(name, oldValue);\n }\n },\n configurable: true,\n enumerable: true\n });\n };\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,kBAAkB;AAC3B,SAAS,aAAa;;;ACDtB,SAAS,gBAAgB;AAQlB,SAAS,kBAAkB,SAA+B;AAC/D,SAAO,CAAC,mBAAwB,SAAiB;AAE/C,aAAS,OAAO,EAAE,mBAAmB,IAAI;AAGzC,UAAM,MAAM,KAAK,IAAI;AAErB,WAAO,eAAe,mBAAmB,MAAM;AAAA,MAC7C,MAAM;AACJ,eAAO,KAAK,GAAG;AAAA,MACjB;AAAA,MACA,IAAI,OAAY;AACd,cAAM,WAAW,KAAK,GAAG;AACzB,aAAK,GAAG,IAAI;AAGZ,YAAI,aAAa,OAAO;AAEtB,cAAI,KAAK,YAAY,QAAQ;AAC3B,kBAAM,YAAY,KAAK,YAAY;AACnC,gBAAI,OAAO;AACT,mBAAK,WAAW,OAAO,IAAI,KAAK,SAAS,EAAE;AAAA,YAC7C,OAAO;AACL,mBAAK,WAAW,OAAO,OAAO,KAAK,SAAS,EAAE;AAAA,YAChD;AAAA,UACF;AAGA,cAAI,QAAQ,QAAQ,KAAK,YAAY;AACnC,kBAAM,gBAAgB,QAAQ;AAC9B,gBAAI,OAAO;AACT,mBAAK,WAAW,aAAa,IAAI;AAAA,YACnC,OAAO;AACL,mBAAK,WAAW,aAAa,IAAI;AAAA,YACnC;AAAA,UACF;AAGA,UAAC,KAAyB,cAAc,MAAM,QAAQ;AAAA,QACxD;AAAA,MACF;AAAA,MACA,cAAc;AAAA,MACd,YAAY;AAAA,IACd,CAAC;AAAA,EACH;AACF;;;AD/CO,IAAe,gBAAf,cAAqC,WAAW;AAAA,EA4BrD,cAAc;AACZ,UAAM;AAvBR,SAAO,WAAW;AAwBhB,SAAK,aAAa,KAAK,gBAAgB;AAAA,EACzC;AAAA,EAfA,yBAAyB,WAAwB,UAAuB;AACtE,QAAI,UAAU;AACZ,WAAK,WAAW;AAAA,IAClB;AAAA,EACF;AAAA,EAaU,WAAW,mBAA2D;AAC9E,QAAI,kBAAkB,IAAI,cAAc,GAAG;AACzC,YAAM,EAAE,QAAQ,CAAC,GAAG,UAAU,IAAI,KAAK,gBAAgB,CAAC;AACxD,WAAK,YAAY,MAAM,UAAU,UAAQ,KAAK,eAAe,SAAS;AACtE,WAAK,QAAQ;AACb,WAAK,OAAO,KAAK,cAAc;AAAA,IACjC;AAAA,EACF;AACF;AAnCS;AAAA,EALN,kBAAkB;AAAA,IACjB,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM;AAAA;AAAA,EACR,CAAC;AAAA,GALmB,cAMb;AAIG;AAAA,EAFT,MAAM;AAAA,EACN,QAAQ,EAAE,SAAS,aAAa,WAAW,KAAK,CAAC;AAAA,GAT9B,cAUV;AAIA;AAAA,EAFT,MAAM;AAAA,EACN,QAAQ,EAAE,SAAS,aAAa,WAAW,KAAK,CAAC;AAAA,GAb9B,cAcV;AAEV;AAAA,EADC,MAAM,cAAc;AAAA,GAfD,cAgBpB;","names":[]}
|
|
@@ -2621,6 +2621,14 @@ qti-response-declaration {
|
|
|
2621
2621
|
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='currentColor' width='100%' height='100%' viewBox='0 0 24 24'%3E%3Cpath d='M20.285 2l-11.285 11.567-5.286-5.011-3.714 3.716 9 8.728 15-15.285z'/%3E%3C/svg%3E");
|
|
2622
2622
|
}
|
|
2623
2623
|
|
|
2624
|
+
&:state(correct-response),
|
|
2625
|
+
&[data-correct-response='true'] {
|
|
2626
|
+
&::after {
|
|
2627
|
+
content: '\\02714';
|
|
2628
|
+
color: #16a34a; /* text-green-600 */
|
|
2629
|
+
}
|
|
2630
|
+
}
|
|
2631
|
+
|
|
2624
2632
|
gap: 0.5rem;
|
|
2625
2633
|
|
|
2626
2634
|
border-radius: var(--qti-border-radius);
|
|
@@ -2632,8 +2640,6 @@ qti-response-declaration {
|
|
|
2632
2640
|
cursor: pointer
|
|
2633
2641
|
}
|
|
2634
2642
|
|
|
2635
|
-
/* } */
|
|
2636
|
-
|
|
2637
2643
|
&.qti-input-control-hidden {
|
|
2638
2644
|
qti-hottext {
|
|
2639
2645
|
/* --qti-padding-md: 0.1rem;
|
|
@@ -3526,4 +3532,4 @@ qti-response-declaration {
|
|
|
3526
3532
|
export {
|
|
3527
3533
|
item_default
|
|
3528
3534
|
};
|
|
3529
|
-
//# sourceMappingURL=chunk-
|
|
3535
|
+
//# sourceMappingURL=chunk-NZQKGIJP.js.map
|