@citolab/qti-components 7.0.6-beta.2 → 7.0.6-beta.4
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-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-4WXQYE2P.js → chunk-PT523RSK.js} +2 -2
- package/cdn/chunks/chunk-QTK4CPHP.js +8 -0
- package/cdn/chunks/{chunk-7XYBFL7U.js → chunk-SXM25YH3.js} +89 -89
- package/cdn/chunks/chunk-UJP4TGD3.js +1 -0
- package/cdn/chunks/{chunk-6S4CDN3T.js → chunk-YHWMZAZD.js} +2 -2
- package/cdn/chunks/{chunk-TQBDBMWL.js → chunk-YWH4TGMA.js} +1 -1
- package/cdn/exports/interaction.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-GSWZT6N2.js → chunk-4MQV5IRV.js} +12 -3
- package/dist/chunks/chunk-4MQV5IRV.js.map +1 -0
- package/dist/chunks/{chunk-6JXR63MH.js → chunk-5RTLOB3Q.js} +12 -3
- package/dist/chunks/chunk-5RTLOB3Q.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-DNHDFXTV.js +59 -0
- 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-K6ATVWMP.js → chunk-MEQM6M67.js} +96 -124
- package/dist/chunks/chunk-MEQM6M67.js.map +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-NHA53UTY.js +52 -0
- package/dist/chunks/chunk-NHA53UTY.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-ZPNJ2HP5.js → chunk-OIRWOI3E.js} +2 -1
- package/dist/chunks/chunk-OIRWOI3E.js.map +1 -0
- package/dist/chunks/chunk-RX3BRYYI.js +59 -0
- package/dist/chunks/chunk-RX3BRYYI.js.map +1 -0
- package/dist/chunks/chunk-VAPB5TN4.js +46 -0
- package/dist/chunks/chunk-VAPB5TN4.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-Z5THRO6Z.js +46 -0
- package/dist/chunks/chunk-Z5THRO6Z.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/exports/interaction.js +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +21 -13
- package/dist/item.css +8 -2
- package/dist/qti-components/index.d.ts +2 -2
- package/dist/qti-components/index.js +2 -2
- 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 +16 -8
- 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 +3 -3
- package/dist/qti-test/components/test-next.d.ts +3 -2
- package/dist/qti-test/components/test-next.js +3 -3
- 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 +3 -3
- 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-3V6LA7B3.js +0 -8
- 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-N5OHGRGG.js +0 -8
- package/cdn/chunks/chunk-NDHSIO2G.js +0 -8
- package/cdn/chunks/chunk-PKT2SJQD.js +0 -8
- package/cdn/chunks/chunk-QV6I5NVQ.js +0 -8
- package/cdn/chunks/chunk-R33OODNX.js +0 -1
- 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-K6ATVWMP.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-ZPNJ2HP5.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
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
QtiTest,
|
|
6
6
|
QtiTestPart,
|
|
7
7
|
TestContainer
|
|
8
|
-
} from "../../chunks/chunk-
|
|
9
|
-
import "../../chunks/chunk-
|
|
8
|
+
} from "../../chunks/chunk-ZQXZ6PK7.js";
|
|
9
|
+
import "../../chunks/chunk-NZQKGIJP.js";
|
|
10
10
|
import "../../chunks/chunk-XDMSEAYC.js";
|
|
11
11
|
import {
|
|
12
12
|
testContext,
|
|
13
13
|
testElement
|
|
14
|
-
} from "../../chunks/chunk-
|
|
14
|
+
} from "../../chunks/chunk-AUWATZ65.js";
|
|
15
15
|
import "../../chunks/chunk-ELDMXTUQ.js";
|
|
16
16
|
import "../../chunks/chunk-H2JE6IVU.js";
|
|
17
17
|
export {
|
|
@@ -2,7 +2,7 @@ import * as lit_html from 'lit-html';
|
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
3
|
import { V as VariableDeclaration } from './variables-cO3DzqJy.js';
|
|
4
4
|
import { ItemContext } from './exports/item.context.js';
|
|
5
|
-
import { Q as QtiAssessmentItem } from './qti-response-declaration-
|
|
5
|
+
import { Q as QtiAssessmentItem } from './qti-response-declaration-Di9CsqiJ.js';
|
|
6
6
|
|
|
7
7
|
declare class QtiAssessmentItemRef extends LitElement {
|
|
8
8
|
category?: string;
|
|
@@ -91,11 +91,9 @@ interface TestContext {
|
|
|
91
91
|
declare const testContext: {
|
|
92
92
|
__context__: Readonly<TestContext>;
|
|
93
93
|
};
|
|
94
|
-
type TestElement =
|
|
95
|
-
el: QtiAssessmentTest;
|
|
96
|
-
};
|
|
94
|
+
type TestElement = QtiAssessmentTest | null;
|
|
97
95
|
declare const testElement: {
|
|
98
|
-
__context__: Readonly<
|
|
96
|
+
__context__: Readonly<QtiAssessmentTest>;
|
|
99
97
|
};
|
|
100
98
|
|
|
101
99
|
export { QtiAssessmentItemRef as Q, type TestContext as T, QtiAssessmentSection as a, QtiAssessmentTest as b, QtiTestPart as c, type TestElement as d, testElement as e, testContext as t };
|
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
},
|
|
220
220
|
{
|
|
221
221
|
"name": "qti-assessment-item",
|
|
222
|
-
"description": "The qti-assessment-item element contains all the other QTI 3 item structures.\n---\n\n\n### **Events:**\n - **name**\n- **qti-interaction-changed** - Emitted when an interaction is changed.\n- **qti-outcome-changed** - Emitted when an outcome has changed.\n- **qti-response-processing** - Emitted when response-processing is called.\n\n### **Slots:**\n - _default_ - The default slot where all the other QTI 3 item structures go.",
|
|
222
|
+
"description": "The qti-assessment-item element contains all the other QTI 3 item structures.\n---\n\n\n### **Events:**\n - **name**\n- **qti-interaction-changed** - Emitted when an interaction is changed.\n- **qti-outcome-changed** - Emitted when an outcome has changed.\n- **qti-response-processing** - Emitted when response-processing is called.\n\n### **Methods:**\n - **showCorrectResponse(show: _boolean_): _void_** - Toggles the display of correct responses for interactions.\n\n### **Slots:**\n - _default_ - The default slot where all the other QTI 3 item structures go.",
|
|
223
223
|
"attributes": [
|
|
224
224
|
{ "name": "title", "values": [] },
|
|
225
225
|
{ "name": "identifier", "values": [] },
|
|
@@ -806,19 +806,19 @@
|
|
|
806
806
|
},
|
|
807
807
|
{
|
|
808
808
|
"name": "test-next",
|
|
809
|
-
"description": "Represents a custom element for navigating to the next test item.\n---\n\n\n### **Events:**\n - **
|
|
809
|
+
"description": "Represents a custom element for navigating to the next test item.\n---\n\n\n### **Events:**\n - **qti-request-test-item**",
|
|
810
810
|
"attributes": [],
|
|
811
811
|
"references": []
|
|
812
812
|
},
|
|
813
813
|
{
|
|
814
814
|
"name": "test-prev",
|
|
815
|
-
"description": "Represents a custom element for navigating to the previous test item.\n---\n\n\n### **Events:**\n - **
|
|
815
|
+
"description": "Represents a custom element for navigating to the previous test item.\n---\n\n\n### **Events:**\n - **qti-request-test-item**",
|
|
816
816
|
"attributes": [],
|
|
817
817
|
"references": []
|
|
818
818
|
},
|
|
819
819
|
{
|
|
820
820
|
"name": "test-view",
|
|
821
|
-
"description": "\n---\n\n\n### **Events:**\n - **on-test-switch-view
|
|
821
|
+
"description": "\n---\n\n\n### **Events:**\n - **on-test-switch-view**",
|
|
822
822
|
"attributes": [
|
|
823
823
|
{
|
|
824
824
|
"name": "label",
|
|
@@ -835,34 +835,53 @@
|
|
|
835
835
|
},
|
|
836
836
|
{
|
|
837
837
|
"name": "test-item-link",
|
|
838
|
-
"description": "\n---\n\n\n### **Events:**\n - **
|
|
838
|
+
"description": "\n---\n\n\n### **Events:**\n - **qti-request-test-item**",
|
|
839
839
|
"attributes": [{ "name": "item-id", "values": [] }],
|
|
840
840
|
"references": []
|
|
841
841
|
},
|
|
842
842
|
{
|
|
843
|
-
"name": "test-
|
|
844
|
-
"description": "
|
|
843
|
+
"name": "test-container",
|
|
844
|
+
"description": "`<test-container>` is a custom element designed for hosting the qti-assessment-item.\nThe `qti-assessment-test` will be placed inside the shadow DOM of this element.\nThe element loads the test from the provided URL and renders it inside the shadow DOM.\n\n```html\n<qti-test>\n <test-container class=\"m-4 bg-white\" test-url=\"./path/to/assessmenttest.xml\"></test-container>\n</qti-test>\n```\n---\n",
|
|
845
845
|
"attributes": [
|
|
846
|
-
{
|
|
847
|
-
|
|
846
|
+
{
|
|
847
|
+
"name": "test-url",
|
|
848
|
+
"description": "URL of the item to load",
|
|
849
|
+
"values": []
|
|
850
|
+
}
|
|
848
851
|
],
|
|
849
852
|
"references": []
|
|
850
853
|
},
|
|
851
854
|
{
|
|
852
855
|
"name": "qti-test",
|
|
853
|
-
"description": "`<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.\n\nThis component leverages several mixins to provide functionality for loading, navigating, processing, and displaying QTI test assessments.\n\n### Example Usage\n\nMinimal example including navigation:\n\n```html\n<qti-test>\n <test-container test-url=\"./path/to/assessment.xml\"></test-container>\n <nav class=\"flex\">\n <test-prev></test-prev>\n <test-next></test-next>\n </nav>\n</qti-test>\n```\n\nUse the following file structure\nA qti-test loads a QTI3.0 assessmenttest.xml file from a package folder.\n\n```plaintext\nRoot/\n├── index.html\n└── /assets/api/examples/\n ├── assessmenttest.xml\n └── imsmanifest.xml\n\n```\n\n### Test components\n\nUse test components inside the qti-test component for added functionality.\n### Test next\n`<test-next> | TestNext`\n\n### Test prev\n\n`<test-prev> | TestPrev`\n### Test components\n\nYou can use normal class names to style the elements.\nAnd you can use the `test-prev` and `test-next` elements to navigate through the test.\n---\n",
|
|
856
|
+
"description": "`<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.\n\nThis component leverages several mixins to provide functionality for loading, navigating, processing, and displaying QTI test assessments.\n\n### Example Usage\n\nMinimal example including navigation:\n\n```html\n<qti-test>\n <test-container test-url=\"./path/to/assessment.xml\"></test-container>\n <nav class=\"flex\">\n <test-prev></test-prev>\n <test-next></test-next>\n </nav>\n</qti-test>\n```\n\nUse the following file structure\nA qti-test loads a QTI3.0 assessmenttest.xml file from a package folder.\n\n```plaintext\nRoot/\n├── index.html\n└── /assets/api/examples/\n ├── assessmenttest.xml\n └── imsmanifest.xml\n\n```\n\n### Test components\n\nUse test components inside the qti-test component for added functionality.\n### Test next\n`<test-next> | TestNext`\n\n### Test prev\n\n`<test-prev> | TestPrev`\n### Test components\n\nYou can use normal class names to style the elements.\nAnd you can use the `test-prev` and `test-next` elements to navigate through the test.\n---\n\n\n### **Events:**\n - **qti-test-connected**",
|
|
857
|
+
"attributes": [
|
|
858
|
+
{
|
|
859
|
+
"name": "auto-score-items",
|
|
860
|
+
"description": "Items will be scored on everyinteraction when `qti-assessment-item` is not set to adaptive, and the `SCORE` outcome identifier is not set to be \"human\" | \"externalMachine\"",
|
|
861
|
+
"values": []
|
|
862
|
+
},
|
|
863
|
+
{ "name": "auto-store-restore", "values": [] }
|
|
864
|
+
],
|
|
865
|
+
"references": []
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
"name": "test-end-attempt",
|
|
869
|
+
"description": "\n---\n",
|
|
854
870
|
"attributes": [],
|
|
855
871
|
"references": []
|
|
856
872
|
},
|
|
857
873
|
{
|
|
858
|
-
"name": "test-
|
|
859
|
-
"description": "
|
|
874
|
+
"name": "test-show-correct-response",
|
|
875
|
+
"description": "\n---\n",
|
|
876
|
+
"attributes": [],
|
|
877
|
+
"references": []
|
|
878
|
+
},
|
|
879
|
+
{
|
|
880
|
+
"name": "test-paging-buttons-stamp",
|
|
881
|
+
"description": "\n---\n",
|
|
860
882
|
"attributes": [
|
|
861
|
-
{
|
|
862
|
-
|
|
863
|
-
"description": "URL of the item to load",
|
|
864
|
-
"values": []
|
|
865
|
-
}
|
|
883
|
+
{ "name": "max-displayed-items", "values": [] },
|
|
884
|
+
{ "name": "skip-on-category", "values": [] }
|
|
866
885
|
],
|
|
867
886
|
"references": []
|
|
868
887
|
},
|
package/package.json
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./chunk-IMJOPCFR.js";import{b as m,c as o}from"./chunk-L4CUWIE6.js";import{a as l}from"./chunk-5GCSZ3CH.js";import{a as i,d as n}from"./chunk-LZZB4VGC.js";import{a as s}from"./chunk-IAP2CEE7.js";var t=class extends r{constructor(){super(),this._internals.role="button",this._internals.ariaLabel="Next item",this.addEventListener("click",e=>{e.preventDefault(),this.disabled||this._requestItem(this.items[this.itemIndex+1].identifier)})}willUpdate(e){super.willUpdate(e),e.has("_testContext")&&(this.disabled=!this._testElement?.el||this.itemIndex<0||this.itemIndex>=this.items.length-1)}render(){return n`<slot></slot>`}};t.styles=i`
|
|
2
|
-
:host {
|
|
3
|
-
${m};
|
|
4
|
-
}
|
|
5
|
-
:host([disabled]) {
|
|
6
|
-
${o};
|
|
7
|
-
}
|
|
8
|
-
`,t=s([l("test-next")],t);export{t as a};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{a as s}from"./chunk-IMJOPCFR.js";import{a as l}from"./chunk-XUJ7TXHW.js";import{a as p,b as n,c as r}from"./chunk-5GCSZ3CH.js";import{d as a}from"./chunk-LZZB4VGC.js";import{a as i}from"./chunk-IAP2CEE7.js";var t=class extends s{constructor(){super(...arguments);this.label="view";this._handleViewOptionsChange=()=>{this.updateViewOptions()};this._viewOptions=t.DEFAULT_VIEW_OPTIONS}connectedCallback(){super.connectedCallback(),this.updateViewOptions()}updateViewOptions(){if(this.viewOptions){let e=this.viewOptions.split(",").map(o=>o.trim());this._viewOptions=e.filter(o=>t.DEFAULT_VIEW_OPTIONS.includes(o))}else this._viewOptions=t.DEFAULT_VIEW_OPTIONS}render(){return a`
|
|
2
|
-
<label part="label" for="viewSelect">${this.label}</label>
|
|
3
|
-
<select
|
|
4
|
-
part="select"
|
|
5
|
-
id="viewSelect"
|
|
6
|
-
.disabled=${this.disabled}
|
|
7
|
-
@change=${e=>{let o=e.target;this._switchView(o.value)}}
|
|
8
|
-
>
|
|
9
|
-
${this._viewOptions.map(e=>a`<option value="${e}" ?selected=${e===this.view}>${e}</option>`)}
|
|
10
|
-
</select>
|
|
11
|
-
`}};t.DEFAULT_VIEW_OPTIONS=["author","candidate","proctor","scorer","testConstructor","tutor"],i([n({type:String})],t.prototype,"label",2),i([n({type:String,attribute:"view-options"})],t.prototype,"viewOptions",2),i([l("viewOptions",{waitUntilFirstUpdate:!0})],t.prototype,"_handleViewOptionsChange",2),i([r()],t.prototype,"_viewOptions",2),t=i([p("test-view")],t);export{t as a};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{a as V,b as M}from"./chunk-MJMONWKB.js";import{a as I,c as w}from"./chunk-5FCXUJAG.js";import{a as g,b as S}from"./chunk-6MCYE7P5.js";import{a as L}from"./chunk-XUJ7TXHW.js";import{a as h,b as i,c as v}from"./chunk-5GCSZ3CH.js";import{d as l,i as m}from"./chunk-LZZB4VGC.js";import{a as T,b as x}from"./chunk-FRS2J3OS.js";import{a as s}from"./chunk-IAP2CEE7.js";var f=class extends m{constructor(){super(...arguments);this.testURL=null;this.testDoc=null;this.testXML=null;this.templateContent=null}async handleTestURLChange(){if(this.testURL)try{let r=await w().load(this.testURL);this.testDoc=r.htmlDoc()}catch(r){console.error("Error loading or parsing XML:",r)}}handleTestXMLChange(){if(this.testXML)try{this.testDoc=w().parse(this.testXML).htmlDoc()}catch(r){console.error("Error parsing XML:",r)}}async connectedCallback(){super.connectedCallback(),this.initializeTemplateContent(),this.applyStyles(),this.testURL&&this.handleTestURLChange(),this.testXML&&this.handleTestXMLChange()}initializeTemplateContent(){let r=this.querySelector("template");this.templateContent=r?r.content:l``}applyStyles(){let r=new CSSStyleSheet;r.replaceSync(M),this.shadowRoot.adoptedStyleSheets=[r]}render(){return l`
|
|
2
|
-
${this.templateContent}
|
|
3
|
-
<slot></slot>
|
|
4
|
-
${V(this.testDoc,l`<span>Loading...</span>`)}
|
|
5
|
-
`}};s([i({type:String,attribute:"test-url"})],f.prototype,"testURL",2),s([v()],f.prototype,"testDoc",2),s([v()],f.prototype,"testXML",2),s([L("testURL",{waitUntilFirstUpdate:!0})],f.prototype,"handleTestURLChange",1),s([L("testXML",{waitUntilFirstUpdate:!0})],f.prototype,"handleTestXMLChange",1),f=s([h("test-container")],f);var R=o=>{class c extends o{constructor(...e){super(...e),this.addEventListener("qti-assessment-test-connected",()=>{}),this.addEventListener("qti-load-item-request",({detail:t})=>{t.promise=(async()=>(await I().load(`${t.href}`,t.cancelPreviousRequest)).htmlDoc())()}),this.addEventListener("qti-interaction-changed",t=>{}),this.addEventListener("qti-outcome-changed",()=>{})}}return c};var D=o=>{class c extends o{constructor(...e){super(...e),this.addEventListener("qti-request-test-item",({detail:t})=>{if(!t)return;this._clearLoadedItems();let n=this.testElement.el.querySelector(`qti-assessment-item-ref[identifier="${t}"]`),a=this._loadItemRequest(n.href,!1),E=n.closest("qti-test-part").identifier,U=n.closest("qti-assessment-section").identifier;this._testContext={...this._testContext,navPartId:E,navSectionId:U,navItemId:t,navItemLoading:!0},a?a.then(q=>{n.xmlDoc=q,requestAnimationFrame(()=>this.dispatchEvent(new CustomEvent("qti-item-connected",{bubbles:!0,composed:!0}))),this._testContext={...this._testContext,navItemLoading:!1}}).catch(q=>console.error("Failed to load item:",q)):console.info("Load item request was not handled:",n.href)}),this.addEventListener("qti-assessment-test-connected",()=>{let t=this._testContext.navItemId;t||(t=this.testElement.el.querySelector("qti-assessment-item-ref").identifier),this.dispatchEvent(new CustomEvent("qti-request-test-item",{detail:t,bubbles:!0,composed:!0}))})}_clearLoadedItems(){let e=this.testElement.el.querySelectorAll("qti-assessment-test qti-assessment-item-ref");Array.from(e).forEach(t=>{t.xmlDoc=null})}_loadItemRequest(e,t=!0){let n=new CustomEvent("qti-load-item-request",{bubbles:!0,composed:!0,detail:{href:e,promise:null,cancelPreviousRequest:t}});return this.dispatchEvent(n),n.detail.promise}}return c};var O=o=>{class c extends o{constructor(...e){super(...e),this._testContext={...this._testContext,view:"candidate"},this.addEventListener("on-test-switch-view",t=>{this._testContext={...this._testContext,view:t.detail},this._updateElementView()}),this.addEventListener("qti-assessment-test-connected",()=>{this._updateElementView()}),this.addEventListener("qti-assessment-item-connected",t=>{this._updateElementView(),this._setCorrectResponseVisibility(t.detail)})}willUpdate(e){super.willUpdate(e),e.has("_testContext")&&this._updateElementView()}_updateElementView(){if(this.testElement&&this.testElement.el){Array.from(this.testElement.el.querySelectorAll("[view]")).forEach(n=>{n.classList.toggle("show",n.getAttribute("view")===this._testContext.view)});let t=this.testElement.el.querySelector(`qti-assessment-item[identifier="${this._testContext.navItemId}"]`);t&&t.showCorrectResponse(this._testContext.view==="scorer")}}_setCorrectResponseVisibility(e){e.showCorrectResponse(this._testContext.view==="scorer")}}return c};var C=class extends m{constructor(){super();this._testContext={items:[],testOutcomeVariables:[]};this.testElement={el:null};this._updateItemInTestContext=r=>{let{identifier:e,variables:t}=r,n=this._testContext.items.find(a=>a?.identifier===e);if(!n){console.warn(`Item IDs between assessment.xml and item.xml should match: ${e} is not found!`);return}n.variables?.length===1?this._updateItemVariablesInTestContext(e,t):r.variables=[...n.variables||[]]};this.addEventListener("qti-assessment-test-connected",r=>{let e=r.detail,t=Array.from(e.querySelectorAll("qti-assessment-item-ref")).map(n=>({href:n.href,identifier:n.identifier,category:n.category,variables:[{identifier:"completionStatus",value:"not_attempted",type:"outcome"}]}));this.testElement={el:e},this._testContext={...this._testContext,items:t}}),this.addEventListener("qti-assessment-item-connected",r=>{this._updateItemInTestContext(r.detail)}),this.addEventListener("qti-outcome-changed",r=>{let e=r.composedPath()[0];this._updateItemVariablesInTestContext(e.identifier,e.variables)})}get context(){return this._testContext}set context(r){r!=null&&(this._testContext={...r},r.items?.forEach(e=>{let t=this._testContext.items.find(n=>n.identifier===e.identifier);t?t.variables=e.variables:this._testContext.items.push(e)}))}_updateItemVariablesInTestContext(r,e){this._testContext={...this._testContext,items:this._testContext.items.map(t=>t.identifier!==r?t:{...t,variables:e.map(n=>{let a=t.variables.find(E=>E.identifier===n.identifier);return a?{...a,...n}:n})})}}connectedCallback(){super.connectedCallback(),this.setAttribute("qti-test","")}};s([v(),T({context:g})],C.prototype,"_testContext",2),s([v(),T({context:S})],C.prototype,"testElement",2);var k=o=>{class c extends o{constructor(...e){super(...e),this.addEventListener("qti-register-variable",t=>{this._testContext={...this._testContext,testOutcomeVariables:[...this._testContext.testOutcomeVariables,t.detail.variable]},t.stopPropagation()}),this.addEventListener("qti-set-outcome-value",t=>{let{outcomeIdentifier:n,value:a}=t.detail;this.updateOutcomeVariable(n,a),t.stopPropagation()})}outcomeProcessing(){let e=this.querySelector("qti-outcome-processing");return e?(e?.process(),!0):!1}updateOutcomeVariable(e,t){let n=this.getOutcome(e);if(!n){console.warn(`Can not set qti-outcome-identifier: ${e}, it is not available`);return}this._testContext={...this._testContext,testOutcomeVariables:this._testContext.testOutcomeVariables.map(a=>a.identifier!==e?a:{...a,value:n.cardinality==="single"?t:[...a.value,t]})}}getOutcome(e){return this.getVariable(e)}getVariable(e){return this._testContext.testOutcomeVariables.find(t=>t.identifier===e)||null}}return c};var y=class extends R(k(D(O(C)))){render(){return l`<slot></slot>`}};y=s([h("qti-test")],y);var P={fromAttribute(o){return o==="true"},toAttribute(o){return o?"true":"false"}},u=class extends m{constructor(){super(...arguments);this.weigths=new Map}createRenderRoot(){return this}get assessmentItem(){return this.renderRoot?.querySelector("qti-assessment-item")}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new CustomEvent("qti-assessment-item-ref-connected",{bubbles:!0,composed:!0,detail:{identifier:this.identifier,href:this.href,category:this.category}}))}render(){return l`${this.xmlDoc}`}};s([i({type:String})],u.prototype,"category",2),s([i({type:String})],u.prototype,"identifier",2),s([i({type:Boolean,converter:P})],u.prototype,"required",2),s([i({type:Boolean,converter:P})],u.prototype,"fixed",2),s([i({type:String})],u.prototype,"href",2),s([x({context:g,subscribe:!0})],u.prototype,"_testContext",2),s([i({type:Object,attribute:!1})],u.prototype,"xmlDoc",2);customElements.get("qti-assessment-item-ref")||customElements.define("qti-assessment-item-ref",u);var _={fromAttribute(o){return o==="true"},toAttribute(o){return o?"true":"false"}},p=class extends m{async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new Event("qti-assessment-section-connected",{bubbles:!0,composed:!0}))}render(){return l`<slot name="qti-rubric-block"></slot><slot></slot>`}};s([i({type:String})],p.prototype,"identifier",2),s([i({type:String})],p.prototype,"required",2),s([i({type:Boolean,converter:_})],p.prototype,"fixed",2),s([i({type:String})],p.prototype,"title",2),s([i({type:Boolean,converter:_})],p.prototype,"visible",2),s([i({type:Boolean,converter:_,attribute:"keep-together"})],p.prototype,"keepTogether",2),s([x({context:g,subscribe:!0})],p.prototype,"_testContext",2);customElements.get("qti-assessment-section")||customElements.define("qti-assessment-section",p);var b=class extends m{async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new CustomEvent("qti-assessment-test-connected",{detail:this,bubbles:!0,composed:!0}))}render(){return l` <slot></slot>`}};s([i({type:String})],b.prototype,"identifier",2),s([i({type:String})],b.prototype,"title",2),s([x({context:g,subscribe:!0})],b.prototype,"_testContext",2),b=s([h("qti-assessment-test")],b);var d=class extends m{constructor(){super(...arguments);this.identifier="";this.title="";this.class="";this.NavigationMode="nonlinear";this.submissionMode="individual"}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new Event("qti-test-part-connected",{bubbles:!0,composed:!0}))}render(){return l` <slot></slot>`}};s([i({type:String})],d.prototype,"identifier",2),s([i({type:String})],d.prototype,"title",2),s([i({type:String})],d.prototype,"class",2),s([i({type:String,attribute:"navigation-mode"})],d.prototype,"NavigationMode",2),s([i({type:String,attribute:"submission-mode"})],d.prototype,"submissionMode",2),d=s([h("qti-test-part")],d);customElements.get("qti-test-part")||customElements.define("qti-test-part",d);export{f as a,y as b,u as c,p as d,b as e,d as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as h,b as f}from"./chunk-6MCYE7P5.js";import{a as u}from"./chunk-XUJ7TXHW.js";import{b as d,c}from"./chunk-5GCSZ3CH.js";import{i as p}from"./chunk-LZZB4VGC.js";import{b as m}from"./chunk-FRS2J3OS.js";import{a as n}from"./chunk-IAP2CEE7.js";function b(a){return(l,t)=>{d(a)(l,t);let e=`__${t}`;Object.defineProperty(l,t,{get(){return this[e]},set(r){let o=this[e];if(this[e]=r,o!==r){if(this._internals?.states){let i=t.toLowerCase();r?this._internals.states.add(`--${i}`):this._internals.states.delete(`--${i}`)}if(a.aria&&this._internals){let i=a.aria;r?this._internals[i]="true":this._internals[i]=null}this.requestUpdate(t,o)}},configurable:!0,enumerable:!0})}}var s=class extends p{constructor(){super();this.disabled=!0;this._internals=this.attachInternals()}_handleTestElementChange(t,e){e.el&&(this.disabled=!1)}willUpdate(t){if(t.has("_testContext")){let{items:e=[],navItemId:r}=this._testContext??{};this.itemIndex=e.findIndex(o=>o.identifier===r),this.items=e,this.view=this._testContext?.view}}_switchView(t){this.dispatchEvent(new CustomEvent("on-test-switch-view",{composed:!0,bubbles:!0,detail:t}))}_requestItem(t){this.dispatchEvent(new CustomEvent("qti-request-test-item",{composed:!0,bubbles:!0,detail:t}))}};n([b({type:Boolean,reflect:!0,aria:"ariaDisabled"})],s.prototype,"disabled",2),n([c(),m({context:h,subscribe:!0})],s.prototype,"_testContext",2),n([c(),m({context:f,subscribe:!0})],s.prototype,"_testElement",2),n([u("_testElement")],s.prototype,"_handleTestElementChange",1);export{s as a};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{b as m,c as a}from"./chunk-L4CUWIE6.js";import{a as l}from"./chunk-IMJOPCFR.js";import{a as i,b as o}from"./chunk-5GCSZ3CH.js";import{a as s,d as r}from"./chunk-LZZB4VGC.js";import{a as e}from"./chunk-IAP2CEE7.js";var t=class extends l{constructor(){super();this.itemId=null;this.addEventListener("click",()=>this._requestItem(this.itemId))}render(){return r` <slot></slot> `}};t.styles=s`
|
|
2
|
-
:host {
|
|
3
|
-
${m};
|
|
4
|
-
}
|
|
5
|
-
:host([disabled]) {
|
|
6
|
-
${a};
|
|
7
|
-
}
|
|
8
|
-
`,e([o({type:String,attribute:"item-id"})],t.prototype,"itemId",2),t=e([i("test-item-link")],t);export{t as a};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{b as m,c as o}from"./chunk-L4CUWIE6.js";import{a as r}from"./chunk-IMJOPCFR.js";import{a as l}from"./chunk-5GCSZ3CH.js";import{a as i,d as n}from"./chunk-LZZB4VGC.js";import{a as s}from"./chunk-IAP2CEE7.js";var t=class extends r{constructor(){super(),this._internals.role="button",this._internals.ariaLabel="Next item",this.addEventListener("click",e=>{e.preventDefault(),this.disabled||this._requestItem(this.items[this.itemIndex+1].identifier)})}willUpdate(e){super.willUpdate(e),e.has("_testContext")&&(this.disabled=!this._testElement?.el||this.itemIndex<0||this.itemIndex>=this.items.length-1)}render(){return n`<slot></slot>`}};t.styles=i`
|
|
2
|
-
:host {
|
|
3
|
-
${m};
|
|
4
|
-
}
|
|
5
|
-
:host([disabled]) {
|
|
6
|
-
${o};
|
|
7
|
-
}
|
|
8
|
-
`,t=s([l("test-next")],t);export{t as a};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./chunk-IMJOPCFR.js";import{b as o,c as m}from"./chunk-L4CUWIE6.js";import{a as n}from"./chunk-5GCSZ3CH.js";import{a as i,d as l}from"./chunk-LZZB4VGC.js";import{a as s}from"./chunk-IAP2CEE7.js";var t=class extends r{constructor(){super(),this._internals.role="button",this._internals.ariaLabel="Next item",this.addEventListener("click",e=>{e.preventDefault(),this.disabled||this._requestItem(this.items[this.itemIndex-1].identifier)})}willUpdate(e){super.willUpdate(e),e.has("_testContext")&&(this.disabled=!this._testElement?.el||this.itemIndex===0||this.itemIndex===-1)}render(){return l`<slot></slot>`}};t.styles=i`
|
|
2
|
-
:host {
|
|
3
|
-
${o};
|
|
4
|
-
}
|
|
5
|
-
:host([disabled]) {
|
|
6
|
-
${m};
|
|
7
|
-
}
|
|
8
|
-
`,t=s([n("test-prev")],t);export{t as a};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{b as o,c as m}from"./chunk-L4CUWIE6.js";import{a as r}from"./chunk-IMJOPCFR.js";import{a as n}from"./chunk-5GCSZ3CH.js";import{a as i,d as l}from"./chunk-LZZB4VGC.js";import{a as s}from"./chunk-IAP2CEE7.js";var t=class extends r{constructor(){super(),this._internals.role="button",this._internals.ariaLabel="Next item",this.addEventListener("click",e=>{e.preventDefault(),this.disabled||this._requestItem(this.items[this.itemIndex-1].identifier)})}willUpdate(e){super.willUpdate(e),e.has("_testContext")&&(this.disabled=!this._testElement?.el||this.itemIndex===0||this.itemIndex===-1)}render(){return l`<slot></slot>`}};t.styles=i`
|
|
2
|
-
:host {
|
|
3
|
-
${o};
|
|
4
|
-
}
|
|
5
|
-
:host([disabled]) {
|
|
6
|
-
${m};
|
|
7
|
-
}
|
|
8
|
-
`,t=s([n("test-prev")],t);export{t as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as s,c as n}from"./chunk-5GCSZ3CH.js";import{i}from"./chunk-LZZB4VGC.js";import{a as r}from"./chunk-IAP2CEE7.js";var e=class extends i{constructor(){super();this.disabled=!1;this.readonly=!1;this._internals=this.attachInternals()}reportValidity(){return this._internals.reportValidity()}reset(){this.value=""}get correctResponse(){return this._correctResponse}set correctResponse(t){this._correctResponse=t}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("qti-register-interaction",{bubbles:!0,composed:!0,cancelable:!1,detail:{responseIdentifier:this.responseIdentifier}}))}saveResponse(t){this.dispatchEvent(new CustomEvent("qti-interaction-response",{bubbles:!0,composed:!0,cancelable:!1,detail:{responseIdentifier:this.responseIdentifier,response:Array.isArray(t)?[...t]:t}}))}};e.formAssociated=!0,r([s({type:String,attribute:"response-identifier"})],e.prototype,"responseIdentifier",2),r([s({reflect:!0,type:Boolean})],e.prototype,"disabled",2),r([s({reflect:!0,type:Boolean})],e.prototype,"readonly",2),r([n()],e.prototype,"_correctResponse",2);export{e as a};
|
|
@@ -1 +0,0 @@
|
|
|
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.el) {\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 protected _switchView(view: string) {\n this.dispatchEvent(\n new CustomEvent('on-test-switch-view', {\n composed: true,\n bubbles: true,\n detail: view\n })\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","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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AQ;AACb,WAAK,OAAO,KAAK,cAAc;AAAA,IACjC;AAAA,EACF;AAAA,EAEU,YAAY,MAAc;AAClC,SAAK;AAAA,MACH,IAAI,YAAY,uBAAuB;AAAA,QACrC,UAAU;AAAA,QACV,SAAS;AAAA,QACT,QAAQ;AAAA,MACV,CAAC;AAAA,IACH;AAAA,EACF;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;AACF;AAvDS;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":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/qti-test/core/components/test-container.ts","../../src/lib/qti-test/core/qti-test.ts","../../src/lib/qti-test/core/mixins/test-loader.mixin.ts","../../src/lib/qti-test/core/mixins/test-navigation.mixin.ts","../../src/lib/qti-test/core/mixins/test-view.mixin.ts","../../src/lib/qti-test/core/test-base.ts","../../src/lib/qti-test/core/mixins/test-processing.mixin.ts","../../src/lib/qti-test/core/qti-assessment-test/qti-assessment-item-ref.ts","../../src/lib/qti-test/core/qti-assessment-test/qti-assessment-section.ts","../../src/lib/qti-test/core/qti-assessment-test/qti-assessment-test.ts","../../src/lib/qti-test/core/qti-assessment-test/qti-test-part.ts"],"sourcesContent":["import { LitElement, html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { until } from 'lit/directives/until.js';\nimport { watch } from '../../../decorators/watch';\nimport itemCss from '../../../../item.css?inline';\nimport { qtiTransformTest } from '../../../qti-transformers';\n\n/**\n * `<test-container>` is a custom element designed for hosting the qti-assessment-item.\n * The `qti-assessment-test` will be placed inside the shadow DOM of this element.\n * The element loads the test from the provided URL and renders it inside the shadow DOM.\n *\n * ```html\n * <qti-test>\n * <test-container class=\"m-4 bg-white\" test-url=\"./path/to/assessmenttest.xml\"></test-container>\n * </qti-test>\n * ```\n */\n@customElement('test-container')\nexport class TestContainer extends LitElement {\n /** URL of the item to load */\n @property({ type: String, attribute: 'test-url' })\n testURL: string = null;\n\n /** A parsed HTML document */\n @state()\n testDoc: DocumentFragment = null;\n\n /** The raw XML string */\n @state()\n testXML: string = null;\n\n /** Template content if provided */\n private templateContent = null;\n\n @watch('testURL', { waitUntilFirstUpdate: true })\n protected async handleTestURLChange() {\n if (!this.testURL) return;\n try {\n const api = await qtiTransformTest().load(this.testURL);\n this.testDoc = api.htmlDoc();\n } catch (error) {\n console.error('Error loading or parsing XML:', error);\n }\n }\n\n @watch('testXML', { waitUntilFirstUpdate: true })\n protected handleTestXMLChange() {\n if (!this.testXML) return;\n try {\n this.testDoc = qtiTransformTest().parse(this.testXML).htmlDoc();\n } catch (error) {\n console.error('Error parsing XML:', error);\n }\n }\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n this.initializeTemplateContent();\n this.applyStyles();\n if (this.testURL) {\n this.handleTestURLChange();\n }\n if (this.testXML) {\n this.handleTestXMLChange();\n }\n }\n\n private initializeTemplateContent() {\n const template = this.querySelector('template') as HTMLTemplateElement;\n this.templateContent = template ? template.content : html``;\n }\n\n private applyStyles() {\n const sheet = new CSSStyleSheet();\n sheet.replaceSync(itemCss);\n this.shadowRoot.adoptedStyleSheets = [sheet];\n }\n\n render() {\n return html`\n ${this.templateContent}\n <slot></slot>\n ${until(this.testDoc, html`<span>Loading...</span>`)}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-container': TestContainer;\n }\n}\n","import { html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { TestLoaderMixin, TestNavigationMixin, TestViewMixin } from './mixins';\nimport { TestBase } from './test-base';\nimport { TestProcessingMixin } from './mixins/test-processing.mixin';\n\n/**\n * `<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.\n *\n * This component leverages several mixins to provide functionality for loading, navigating, processing, and displaying QTI test assessments.\n *\n * ### Example Usage\n *\n * Minimal example including navigation:\n *\n * ```html\n * <qti-test>\n * <test-container test-url=\"./path/to/assessment.xml\"></test-container>\n * <nav class=\"flex\">\n * <test-prev></test-prev>\n * <test-next></test-next>\n * </nav>\n * </qti-test>\n * ```\n *\n * Use the following file structure\n * A qti-test loads a QTI3.0 assessmenttest.xml file from a package folder.\n *\n * ```plaintext\n * Root/\n * ├── index.html\n * └── /assets/api/examples/\n * ├── assessmenttest.xml\n * └── imsmanifest.xml\n *\n * ```\n *\n * ### Test components\n *\n * Use test components inside the qti-test component for added functionality.\n * ### Test next\n * `<test-next> | TestNext`\n *\n * ### Test prev\n *\n * `<test-prev> | TestPrev`\n * ### Test components\n *\n * You can use normal class names to style the elements.\n * And you can use the `test-prev` and `test-next` elements to navigate through the test.\n *\n */\n@customElement('qti-test')\nexport class QtiTest extends TestLoaderMixin(TestProcessingMixin(TestNavigationMixin(TestViewMixin(TestBase)))) {\n /**\n * Renders the component's template.\n * Provides a default `<slot>` for content projection.\n */\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-test': QtiTest;\n }\n}\n","import type { LitElement } from 'lit';\nimport { qtiTransformItem } from '../../../qti-transformers';\n\n// const setSessionData = <T>(key: string, value?: T): void => sessionStorage.setItem(key, JSON.stringify(value));\n// const getSessionData = <T>(key: string): T | null => (sessionStorage.getItem(key) ? JSON.parse(sessionStorage.getItem(key)!) : null);\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\ndeclare class TestLoaderInterface {}\nexport const TestLoaderMixin = <T extends Constructor<LitElement>>(superClass: T) => {\n abstract class TestLoaderClass extends superClass {\n // private testURL = '';\n\n constructor(...args: any[]) {\n super(...args);\n\n // this.addEventListener('qti-load-test-request', (e: CustomEvent /* 1. Request the test */) => {\n // const { testURL } = e.detail;\n // if (!testURL) {\n // console.warn(\n // 'No test found, there should be an attribute test-url with the path to the test on the test-container'\n // );\n // } else {\n // this.testURL = testURL;\n // }\n\n // e.detail.promise = (async () => {\n // e.preventDefault(); /* indicates that the event was catched and handled */\n // const api = await qtiTransformTest().load(`${this.testURL}`); /* 6. load the item */\n // return api.htmlDoc(); /* 3. Return html version of the assessment.xml */\n // })();\n // });\n\n this.addEventListener('qti-assessment-test-connected', () => {\n // this.context = getSessionData(`testcontext-${this.testURL}`); /* 4. Set the context */\n });\n\n this.addEventListener('qti-load-item-request' /* 5. Request the item */, ({ detail }: CustomEvent) => {\n // if (!this.testURL) return;\n detail.promise = (async () => {\n const api = await qtiTransformItem().load(\n `${detail.href}`,\n detail.cancelPreviousRequest\n ); /* 6. load the item */\n return api.htmlDoc(); /* 7. Return HTML version of the item.xml */\n })();\n });\n\n this.addEventListener('qti-interaction-changed', _e => {\n /* 8. Interaction changed */\n // const scoreOutcomeIdentifier = qtiAssessmentItem.variables.find(v => v.identifier === 'SCORE') as OutcomeVariable;\n // if (scoreOutcomeIdentifier.externalScored === null && qtiAssessmentItem.adaptive === 'false') {\n // qtiAssessmentItem.processResponse(); /* 9. Process the response */\n // }\n // setSessionData(`testcontext-${this.testURL}`, this.context); /* 10. Update the context */\n });\n\n this.addEventListener('qti-outcome-changed', () => {\n // setSessionData(`testcontext-${this.testURL}`, this.context); /* 10. Update the context */\n });\n }\n }\n\n return TestLoaderClass as Constructor<TestLoaderInterface> & T;\n};\n","import type { QtiAssessmentItemRef } from '../qti-assessment-test';\nimport type { TestBase } from '../test-base';\n\ndeclare module '../context/test.context' {\n interface TestContext {\n navPartId?: string | null;\n navSectionId?: string | null;\n navItemId?: string | null;\n navItemLoading?: boolean;\n navTestLoading?: boolean;\n }\n}\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\ndeclare class TestNavigationInterface {}\nexport const TestNavigationMixin = <T extends Constructor<TestBase>>(superClass: T) => {\n abstract class TestNavigationClass extends superClass {\n constructor(...args: any[]) {\n super(...args);\n\n // load an item\n this.addEventListener('qti-request-test-item', ({ detail: navItemId }: CustomEvent<string>) => {\n if (!navItemId) return;\n this._clearLoadedItems();\n\n const itemRefEl = this.testElement.el.querySelector<QtiAssessmentItemRef>(\n `qti-assessment-item-ref[identifier=\"${navItemId}\"]`\n );\n\n const promise = this._loadItemRequest(itemRefEl.href, false);\n\n const navPartId = itemRefEl.closest('qti-test-part').identifier;\n const navSectionId = itemRefEl.closest('qti-assessment-section').identifier;\n this._testContext = { ...this._testContext, navPartId, navSectionId, navItemId, navItemLoading: true };\n\n if (promise) {\n promise\n .then(doc => {\n itemRefEl.xmlDoc = doc;\n requestAnimationFrame(() =>\n this.dispatchEvent(new CustomEvent('qti-item-connected', { bubbles: true, composed: true }))\n );\n this._testContext = { ...this._testContext, navItemLoading: false };\n })\n .catch(error => console.error('Failed to load item:', error));\n } else {\n console.info('Load item request was not handled:', itemRefEl.href);\n }\n });\n\n this.addEventListener('qti-assessment-test-connected', () => {\n let navItemId = this._testContext.navItemId;\n if (!navItemId) {\n const itemRefEl = this.testElement.el.querySelector<QtiAssessmentItemRef>('qti-assessment-item-ref');\n navItemId = itemRefEl.identifier;\n }\n this.dispatchEvent(\n new CustomEvent('qti-request-test-item', { detail: navItemId, bubbles: true, composed: true })\n );\n });\n }\n\n private _clearLoadedItems(): void {\n const itemRefEls = this.testElement.el.querySelectorAll(`qti-assessment-test qti-assessment-item-ref`);\n Array.from(itemRefEls).forEach((itemElement: QtiAssessmentItemRef) => {\n itemElement.xmlDoc = null;\n });\n }\n\n private _loadItemRequest(href: string, cancelPreviousRequest: boolean = true): Promise<DocumentFragment> {\n const event = new CustomEvent('qti-load-item-request', {\n bubbles: true,\n composed: true,\n detail: {\n href: href,\n promise: null,\n cancelPreviousRequest\n }\n });\n this.dispatchEvent(event);\n\n return event.detail.promise;\n }\n }\n\n return TestNavigationClass as Constructor<TestNavigationInterface> & T;\n};\n","import type { QtiAssessmentItem } from '../../../qti-components';\nimport type { TestBase } from '../test-base';\n\nexport type View = 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor' | '';\n\ndeclare module '../context/test.context' {\n interface TestContext {\n view?: View;\n }\n}\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\ndeclare class TestViewInterface {}\n\nexport const TestViewMixin = <T extends Constructor<TestBase>>(superClass: T) => {\n abstract class TestViewClass extends superClass {\n constructor(...args: any[]) {\n super(...args);\n this._testContext = { ...this._testContext, view: 'candidate' };\n\n this.addEventListener('on-test-switch-view', (e: CustomEvent<View>) => {\n this._testContext = { ...this._testContext, view: e.detail };\n this._updateElementView();\n });\n this.addEventListener('qti-assessment-test-connected', () => {\n this._updateElementView();\n });\n this.addEventListener('qti-assessment-item-connected', (e: CustomEvent) => {\n this._updateElementView();\n this._setCorrectResponseVisibility(e.detail);\n });\n }\n\n willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n super.willUpdate(changedProperties);\n if (changedProperties.has('_testContext')) {\n // if (previousContext && previousContext.view !== this._testContext.view) {\n this._updateElementView();\n // }\n }\n }\n\n // Method to handle view updates for elements based on the current context view\n private _updateElementView() {\n if (this.testElement && this.testElement.el) {\n const viewElements = Array.from(this.testElement.el.querySelectorAll('[view]'));\n\n viewElements.forEach((element: HTMLElement) => {\n element.classList.toggle('show', element.getAttribute('view') === this._testContext.view);\n });\n\n const assessmentItem = this.testElement.el.querySelector<QtiAssessmentItem>(\n `qti-assessment-item[identifier=\"${this._testContext.navItemId}\"]`\n );\n if (assessmentItem) {\n assessmentItem.showCorrectResponse(this._testContext.view === 'scorer');\n }\n }\n }\n\n // Event handler for connected QTI assessment items\n private _setCorrectResponseVisibility(assessmentItem: QtiAssessmentItem): void {\n assessmentItem.showCorrectResponse(this._testContext.view === 'scorer');\n }\n }\n\n return TestViewClass as Constructor<TestViewInterface> & T;\n};\n","import { provide } from '@lit/context';\nimport { LitElement } from 'lit';\nimport { state } from 'lit/decorators.js';\nimport type { TestContext, TestElement } from './context';\nimport { testContext, testElement } from './context';\nimport type { QtiAssessmentTest } from './qti-assessment-test';\nimport type { QtiAssessmentItem } from '../../qti-components/';\nimport type { VariableValue } from '../../exports/variables';\nimport type { ItemContext } from '../../exports/item.context';\n\nexport abstract class TestBase extends LitElement {\n @state()\n @provide({ context: testContext })\n protected _testContext: Readonly<TestContext> = { items: [], testOutcomeVariables: [] };\n\n @state()\n @provide({ context: testElement })\n protected testElement: TestElement = { el: null };\n\n constructor() {\n super();\n\n this.addEventListener('qti-assessment-test-connected', (e: CustomEvent<QtiAssessmentTest>) => {\n const qtiAssessmentTest = e.detail;\n\n const items = Array.from(qtiAssessmentTest.querySelectorAll('qti-assessment-item-ref')).map(\n (itemRef): ItemContext & { category: string } => ({\n href: itemRef.href,\n identifier: itemRef.identifier,\n category: itemRef.category,\n variables: [{ identifier: 'completionStatus', value: 'not_attempted', type: 'outcome' }]\n })\n );\n this.testElement = { el: qtiAssessmentTest };\n this._testContext = { ...this._testContext, items };\n });\n this.addEventListener('qti-assessment-item-connected', (e: CustomEvent<QtiAssessmentItem>) => {\n this._updateItemInTestContext(e.detail);\n });\n this.addEventListener('qti-outcome-changed', e => {\n const assessmentitem = e.composedPath()[0] as QtiAssessmentItem;\n this._updateItemVariablesInTestContext(assessmentitem.identifier, assessmentitem.variables);\n });\n\n // this.addEventListener(\n // 'qti-assessment-item-ref-connected',\n // (e: CustomEvent<{ href: string; identifier: string; category: string }> & { target: QtiAssessmentItemRef }) => {\n // this._addItemToTestContext(e);\n // }\n // );\n }\n\n get context(): TestContext {\n return this._testContext;\n }\n\n // /* restores the context by updating existing items and adding new items from the \"contextToRestore\" parameter into the \"this._context.items\" array. */\n set context(testContext: TestContext) {\n if (testContext === null || testContext === undefined) return;\n this._testContext = { ...testContext }; // Clone the context to avoid modifying the original object\n // // append the items that are not yet in the context and replace the ones that are\n testContext.items?.forEach(itemContext => {\n const existingItemContext = this._testContext.items.find(i => i.identifier === itemContext.identifier);\n if (existingItemContext) {\n existingItemContext.variables = itemContext.variables;\n } else {\n this._testContext.items.push(itemContext);\n }\n });\n }\n\n private _updateItemVariablesInTestContext(\n identifier: string,\n variables: VariableValue<string | string[] | null>[]\n ): void {\n // Update the test context with modified variables for the specified item\n this._testContext = {\n ...this._testContext, // Spread existing test context properties\n items: this._testContext.items.map(itemContext => {\n // If the item identifier doesn't match, keep it unchanged\n if (itemContext.identifier !== identifier) {\n return itemContext;\n }\n\n // Update the matching item with new variables\n return {\n ...itemContext, // Keep other properties of the item context\n variables: variables.map(variable => {\n // Find a matching variable in the current item context\n const matchingVariable = itemContext.variables.find(v => v.identifier === variable.identifier);\n\n // Merge matching variable with the new one, or use the new variable if no match\n return matchingVariable ? { ...matchingVariable, ...variable } : variable;\n })\n };\n })\n };\n }\n\n /**\n * Updates the variables of an assessment item in the test context.\n * - Matches the assessment item with the corresponding test context item.\n * - If the item is not found, logs a warning.\n * - Updates variables in the test context if exactly one variable exists.\n * - Otherwise, syncs the assessment item's variables with the test context.\n *\n * @param assessmentItem - The assessment item to update.\n */\n private _updateItemInTestContext = (assessmentItem: QtiAssessmentItem): void => {\n const { identifier, variables } = assessmentItem;\n\n // console.log(this._testContext);\n\n // Find the corresponding item in the test context by identifier\n const itemContext = this._testContext.items.find(i => i?.identifier === identifier);\n\n if (!itemContext) {\n console.warn(`Item IDs between assessment.xml and item.xml should match: ${identifier} is not found!`);\n return;\n }\n\n // Update variables in the test context or sync them to the assessment item\n if (itemContext.variables?.length === 1) {\n // The loaded qti-assessment-item itself has variables which are not in test context yet.\n this._updateItemVariablesInTestContext(identifier, variables);\n } else {\n // Sync the assessment item's variables with the test context\n assessmentItem.variables = [...(itemContext.variables || [])];\n }\n };\n\n // private _addItemToTestContext(\n // e: CustomEvent<{ href: string; identifier: string; category: string }> & { target: QtiAssessmentItemRef }\n // ): void {\n // const { href, identifier, category } = e.detail;\n\n // // Update test context items, adding a new item if the identifier is not already in the list\n // if (!this._testContext.items.some(item => item.identifier === identifier)) {\n // this._testContext.items.push({\n // href,\n // identifier,\n // category,\n // variables: [{ identifier: 'completionStatus', value: 'not_attempted', type: 'outcome' }]\n // // category: e.target.category\n // });\n // }\n // }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.setAttribute('qti-test', '');\n }\n}\n","import type { OutcomeVariable, VariableDeclaration, QtiOutcomeProcessing } from '../../../qti-components';\nimport type { TestBase } from '../test-base';\n\ntype Constructor<T = {}> = abstract new (...args: any[]) => T;\n\ndeclare class TestProcessingInterface {\n updateOutcomeVariable(identifier: string, value: string | string[] | undefined): void;\n getOutcome(identifier: string): Readonly<OutcomeVariable>;\n getVariable(identifier: string): Readonly<VariableDeclaration<string | string[] | null>>;\n outcomeProcessing(): boolean;\n}\nexport const TestProcessingMixin = <T extends Constructor<TestBase>>(superClass: T) => {\n abstract class TestProcessingElement extends superClass {\n constructor(...args: any[]) {\n super(...args);\n this.addEventListener('qti-register-variable', (e: CustomEvent<{ variable: any }>) => {\n this._testContext = {\n ...this._testContext,\n testOutcomeVariables: [...this._testContext.testOutcomeVariables, e.detail.variable]\n };\n e.stopPropagation();\n });\n // wordt aangeroepen vanuit de processingtemplate\n this.addEventListener(\n 'qti-set-outcome-value',\n (e: CustomEvent<{ outcomeIdentifier: string; value: string | string[] }>) => {\n const { outcomeIdentifier, value } = e.detail;\n this.updateOutcomeVariable(outcomeIdentifier, value);\n e.stopPropagation();\n }\n );\n }\n\n outcomeProcessing(): boolean {\n const outcomeProcessor = this.querySelector('qti-outcome-processing') as unknown as QtiOutcomeProcessing;\n if (!outcomeProcessor) return false;\n outcomeProcessor?.process();\n return true;\n }\n\n /* --------------------------- ENABLED WHEN UNIT TESTING OUTCOME PROCESSING ------------------------------------ */\n\n public updateOutcomeVariable(identifier: string, value: string | string[] | undefined) {\n const outcomeVariable = this.getOutcome(identifier);\n if (!outcomeVariable) {\n console.warn(`Can not set qti-outcome-identifier: ${identifier}, it is not available`);\n return;\n }\n this._testContext = {\n ...this._testContext,\n testOutcomeVariables: this._testContext.testOutcomeVariables.map(v => {\n if (v.identifier !== identifier) {\n return v;\n }\n return {\n ...v,\n value: outcomeVariable.cardinality === 'single' ? value : [...v.value, value as string]\n };\n })\n };\n }\n\n public getOutcome(identifier: string): Readonly<OutcomeVariable> {\n return this.getVariable(identifier) as OutcomeVariable;\n }\n public getVariable(identifier: string): Readonly<VariableDeclaration<string | string[] | null>> {\n return this._testContext.testOutcomeVariables.find(v => v.identifier === identifier) || null;\n }\n /* --------------------------- ENABLED WHEN UNIT TESTING OUTCOME PROCESSING ------------------------------------ */\n }\n\n return TestProcessingElement as Constructor<TestProcessingInterface> & T;\n};\n","import { consume } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport type { TestContext } from '../context';\nimport { testContext } from '../context';\nimport type { QtiAssessmentItem } from '../../../qti-components';\n\n// Converter function to interpret \"true\" and \"false\" as booleans\nconst stringToBooleanConverter = {\n fromAttribute(value: string): boolean {\n return value === 'true';\n },\n toAttribute(value: boolean): string {\n return value ? 'true' : 'false';\n }\n};\n\n// @customElement('qti-assessment-item-ref')\nexport class QtiAssessmentItemRef extends LitElement {\n @property({ type: String }) category?: string;\n @property({ type: String }) identifier?: string;\n @property({ type: Boolean, converter: stringToBooleanConverter }) required?: boolean;\n @property({ type: Boolean, converter: stringToBooleanConverter }) fixed?: boolean;\n @property({ type: String }) href?: string;\n\n @consume({ context: testContext, subscribe: true })\n public _testContext?: TestContext;\n\n weigths: Map<string, number> = new Map();\n\n @property({ type: Object, attribute: false })\n xmlDoc!: DocumentFragment; // the XMLDocument\n\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n get assessmentItem(): QtiAssessmentItem | null {\n return this.renderRoot?.querySelector('qti-assessment-item');\n }\n\n async connectedCallback(): Promise<void> {\n // debugger;\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(\n new CustomEvent('qti-assessment-item-ref-connected', {\n bubbles: true,\n composed: true,\n detail: { identifier: this.identifier, href: this.href, category: this.category }\n })\n );\n }\n\n render() {\n return html`${this.xmlDoc}`;\n }\n}\n\nif (!customElements.get('qti-assessment-item-ref')) {\n customElements.define('qti-assessment-item-ref', QtiAssessmentItemRef);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-item-ref': QtiAssessmentItemRef;\n }\n}\n","import { consume } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport type { TestContext } from '../context';\nimport { testContext } from '../context';\n\n// https://www.imsglobal.org/sites/default/files/spec/qti/v3/info/index.html#Root_AssessmentSection\n\nconst stringToBooleanConverter = {\n fromAttribute(value: string): boolean {\n return value === 'true';\n },\n toAttribute(value: boolean): string {\n return value ? 'true' : 'false';\n }\n};\n\nexport class QtiAssessmentSection extends LitElement {\n @property({ type: String }) identifier: string;\n @property({ type: String }) required: string;\n @property({ type: Boolean, converter: stringToBooleanConverter }) fixed: boolean;\n @property({ type: String }) title: string;\n @property({ type: Boolean, converter: stringToBooleanConverter }) visible: boolean;\n @property({ type: Boolean, converter: stringToBooleanConverter, attribute: 'keep-together' }) keepTogether: boolean;\n\n @consume({ context: testContext, subscribe: true })\n public _testContext?: TestContext;\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(\n new Event('qti-assessment-section-connected', {\n bubbles: true,\n composed: true\n })\n );\n }\n\n render() {\n return html`<slot name=\"qti-rubric-block\"></slot><slot></slot>`;\n }\n}\n\nif (!customElements.get('qti-assessment-section')) {\n customElements.define('qti-assessment-section', QtiAssessmentSection);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-section': QtiAssessmentSection;\n }\n}\n","import { consume } from '@lit/context';\nimport { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport type { TestContext } from '../context';\nimport { testContext } from '../context';\n\n@customElement('qti-assessment-test')\nexport class QtiAssessmentTest extends LitElement {\n @property({ type: String }) identifier: string;\n @property({ type: String }) title: string;\n\n @consume({ context: testContext, subscribe: true })\n public _testContext?: TestContext;\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(\n new CustomEvent('qti-assessment-test-connected', {\n detail: this,\n bubbles: true,\n composed: true\n })\n );\n }\n\n render() {\n return html` <slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-assessment-test': QtiAssessmentTest;\n }\n}\n","import { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n@customElement('qti-test-part')\nexport class QtiTestPart extends LitElement {\n @property({ type: String }) identifier: string = '';\n @property({ type: String }) title: string = '';\n @property({ type: String }) class: string = '';\n\n @property({ type: String, attribute: 'navigation-mode' })\n NavigationMode: 'linear' | 'nonlinear' = 'nonlinear';\n\n @property({ type: String, attribute: 'submission-mode' })\n submissionMode: 'individual' | 'simultaneous' = 'individual';\n\n async connectedCallback(): Promise<void> {\n super.connectedCallback();\n await this.updateComplete;\n this.dispatchEvent(\n new Event('qti-test-part-connected', {\n bubbles: true,\n composed: true\n })\n );\n }\n\n render() {\n return html` <slot></slot>`;\n }\n}\n\nif (!customElements.get('qti-test-part')) {\n customElements.define('qti-test-part', QtiTestPart);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-test-part': QtiTestPart;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY,YAAY;AACjC,SAAS,eAAe,UAAU,aAAa;AAC/C,SAAS,aAAa;AAiBf,IAAM,gBAAN,cAA4B,WAAW;AAAA,EAAvC;A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W,KAAK,CAAC;AAAA,GAJvC,kBAKJ;AALI,oBAAN;AAAA,EADNC,eAAc,qBAAqB;AAAA,GACvB;;;ACPb,SAAS,QAAAC,OAAM,cAAAC,mBAAkB;AACjC,SAAS,iBAAAC,gBAAe,YAAAC,iBAAgB;AAEjC,IAAM,cAAN,cAA0BC,YAAW;AAAA,EAArC;AAAA;AACuB,sBAAqB;AACrB,iBAAgB;AAChB,iBAAgB;AAG5C,0BAAyC;AAGzC,0BAAgD;AAAA;AAAA,EAEhD,MAAM,oBAAmC;AACvC,UAAM,kBAAkB;AACxB,UAAM,KAAK;AACX,SAAK;AAAA,MACH,IAAI,MAAM,2BAA2B;AAAA,QACnC,SAAS;AAAA,QACT,UAAU;AAAA,MACZ,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAOC;AAAA,EACT;AACF;AAxB8B;AAAA,EAA3BC,UAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GADf,YACiB;AACA;AAAA,EAA3BA,UAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAFf,YAEiB;AACA;AAAA,EAA3BA,UAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAHf,YAGiB;AAG5B;AAAA,EADCA,UAAS,EAAE,MAAM,QAAQ,WAAW,kBAAkB,CAAC;AAAA,GAL7C,YAMX;AAGA;AAAA,EADCA,UAAS,EAAE,MAAM,QAAQ,WAAW,kBAAkB,CAAC;AAAA,GAR7C,YASX;AATW,cAAN;AAAA,EADNC,eAAc,eAAe;AAAA,GACjB;AA2Bb,IAAI,CAAC,eAAe,IAAI,eAAe,GAAG;AACxC,iBAAe,OAAO,iBAAiB,WAAW;AACpD;","names":["html","customElement","LitElement","state","LitElement","testContext","state","html","customElement","html","LitElement","property","LitElement","html","property","consume","html","LitElement","property","stringToBooleanConverter","LitElement","html","property","consume","consume","html","LitElement","customElement","property","LitElement","html","property","consume","customElement","html","LitElement","customElement","property","LitElement","html","property","customElement"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/qti-test/components/test-next.ts"],"sourcesContent":["import { css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport * as styles from './styles';\nimport { TestComponent } from './test-component.abstract';\n\n/**\n * Represents a custom element for navigating to the next test item.\n *\n * @remarks\n * This element provides functionality for navigating to the next test item.\n *\n * @example\n * ```html\n * <test-next></test-next>\n * ```\n */\n@customElement('test-next')\nexport class TestNext 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 willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n super.willUpdate(changedProperties);\n if (changedProperties.has('_testContext')) {\n this.disabled = !this._testElement?.el || this.itemIndex < 0 || this.itemIndex >= this.items.length - 1;\n }\n }\n\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-next': TestNext;\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,EAEA,WAAW,mBAA2D;AACpE,UAAM,WAAW,iBAAiB;AAClC,QAAI,kBAAkB,IAAI,cAAc,GAAG;AACzC,WAAK,WAAW,CAAC,KAAK,cAAc,MAAM,KAAK,YAAY,KAAK,KAAK,aAAa,KAAK,MAAM,SAAS;AAAA,IACxG;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AA/Ba,SACJ,SAAS;AAAA;AAAA,QAEH,GAAG;AAAA;AAAA;AAAA,QAGH,GAAG;AAAA;AAAA;AANL,WAAN;AAAA,EADN,cAAc,WAAW;AAAA,GACb;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
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 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,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AArBa,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 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/qti-test/components/test-view.ts"],"sourcesContent":["import { html } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { TestComponent } from './test-component.abstract';\nimport { watch } from '../../decorators/watch';\n\n@customElement('test-view')\nexport class TestView extends TestComponent {\n static DEFAULT_VIEW_OPTIONS = ['author', 'candidate', 'proctor', 'scorer', 'testConstructor', 'tutor'];\n\n /** label accompanying the select view dropdown */\n @property({ type: String })\n label = 'view';\n\n /** The options to display in the dropdown, default: ['author', 'candidate', 'proctor', 'scorer', 'testConstructor', 'tutor'] */\n @property({ type: String, attribute: 'view-options' }) viewOptions;\n @watch('viewOptions', { waitUntilFirstUpdate: true })\n protected _handleViewOptionsChange = () => {\n this.updateViewOptions();\n };\n\n connectedCallback(): void {\n super.connectedCallback();\n this.updateViewOptions();\n }\n\n @state()\n private _viewOptions: string[] = TestView.DEFAULT_VIEW_OPTIONS;\n\n private updateViewOptions() {\n if (this.viewOptions) {\n const options = this.viewOptions.split(',').map(opt => opt.trim());\n this._viewOptions = options.filter(opt => TestView.DEFAULT_VIEW_OPTIONS.includes(opt));\n } else {\n this._viewOptions = TestView.DEFAULT_VIEW_OPTIONS;\n }\n }\n\n render() {\n return html`\n <label part=\"label\" for=\"viewSelect\">${this.label}</label>\n <select\n part=\"select\"\n id=\"viewSelect\"\n .disabled=${this.disabled}\n @change=${(e: Event) => {\n const el = e.target as HTMLSelectElement;\n this._switchView(el.value);\n }}\n >\n ${this._viewOptions.map(v => html`<option value=\"${v}\" ?selected=${v === this.view}>${v}</option>`)}\n </select>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-view': TestView;\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,YAAY;AACrB,SAAS,eAAe,UAAU,aAAa;AAKxC,IAAM,WAAN,cAAuB,cAAc;AAAA,EAArC;AAAA;AAKL,iBAAQ;AAKR,SAAU,2BAA2B,MAAM;AACzC,WAAK,kBAAkB;AAAA,IACzB;AAQA,SAAQ,eAAyB,SAAS;AAAA;AAAA,EAN1C,oBAA0B;AACxB,UAAM,kBAAkB;AACxB,SAAK,kBAAkB;AAAA,EACzB;AAAA,EAKQ,oBAAoB;AAC1B,QAAI,KAAK,aAAa;AACpB,YAAM,UAAU,KAAK,YAAY,MAAM,GAAG,EAAE,IAAI,SAAO,IAAI,KAAK,CAAC;AACjE,WAAK,eAAe,QAAQ,OAAO,SAAO,SAAS,qBAAqB,SAAS,GAAG,CAAC;AAAA,IACvF,OAAO;AACL,WAAK,eAAe,SAAS;AAAA,IAC/B;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,6CACkC,KAAK,KAAK;AAAA;AAAA;AAAA;AAAA,oBAInC,KAAK,QAAQ;AAAA,kBACf,CAAC,MAAa;AACtB,YAAM,KAAK,EAAE;AACb,WAAK,YAAY,GAAG,KAAK;AAAA,IAC3B,CAAC;AAAA;AAAA,UAEC,KAAK,aAAa,IAAI,OAAK,sBAAsB,CAAC,eAAe,MAAM,KAAK,IAAI,IAAI,CAAC,WAAW,CAAC;AAAA;AAAA;AAAA,EAGzG;AACF;AA/Ca,SACJ,uBAAuB,CAAC,UAAU,aAAa,WAAW,UAAU,mBAAmB,OAAO;AAIrG;AAAA,EADC,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,GAJf,SAKX;AAGuD;AAAA,EAAtD,SAAS,EAAE,MAAM,QAAQ,WAAW,eAAe,CAAC;AAAA,GAR1C,SAQ4C;AAE7C;AAAA,EADT,MAAM,eAAe,EAAE,sBAAsB,KAAK,CAAC;AAAA,GATzC,SAUD;AAUF;AAAA,EADP,MAAM;AAAA,GAnBI,SAoBH;AApBG,WAAN;AAAA,EADN,cAAc,WAAW;AAAA,GACb;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
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 willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n super.willUpdate(changedProperties);\n if (changedProperties.has('_testContext')) {\n this.disabled = !this._testElement?.el || 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,EAEA,WAAW,mBAA2D;AACpE,UAAM,WAAW,iBAAiB;AAClC,QAAI,kBAAkB,IAAI,cAAc,GAAG;AACzC,WAAK,WAAW,CAAC,KAAK,cAAc,MAAM,KAAK,cAAc,KAAK,KAAK,cAAc;AAAA,IACvF;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AA/Ba,SACJ,SAAS;AAAA;AAAA,QAEH,GAAG;AAAA;AAAA;AAAA,QAGH,GAAG;AAAA;AAAA;AANL,WAAN;AAAA,EADN,cAAc,WAAW;AAAA,GACb;","names":[]}
|