@citolab/qti-components 7.3.20 → 7.3.21
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-2BSPQRNR.js +6 -0
- package/cdn/chunks/chunk-2IJBTWWT.js +2 -0
- package/cdn/chunks/chunk-3BPUHYAN.js +1 -0
- package/cdn/chunks/chunk-3CVBBZDT.js +17 -0
- package/cdn/chunks/chunk-3IBGLVHA.js +1 -0
- package/cdn/chunks/chunk-4AGE7DVK.js +48 -0
- package/cdn/chunks/chunk-4DXCBZFR.js +3698 -0
- package/cdn/chunks/chunk-4FBS7ODL.js +6 -0
- package/cdn/chunks/chunk-4IWCVQQJ.js +8 -0
- package/cdn/chunks/chunk-522JFYKC.js +6 -0
- package/cdn/chunks/chunk-5L5JXKEA.js +1 -0
- package/cdn/chunks/chunk-5TEGKCEI.js +48 -0
- package/cdn/chunks/chunk-5WLHU3FH.js +8 -0
- package/cdn/chunks/chunk-6ELXCFB2.js +1 -0
- package/cdn/chunks/chunk-6Q3S6QYF.js +1471 -0
- package/cdn/chunks/chunk-6SGFGN34.js +8 -0
- package/cdn/chunks/chunk-6XVY32RS.js +1 -0
- package/cdn/chunks/chunk-6ZE2IMSJ.js +1471 -0
- package/cdn/chunks/chunk-73RDXCTO.js +1 -0
- package/cdn/chunks/chunk-73YTM4JU.js +8 -0
- package/cdn/chunks/chunk-A57EJSRU.js +1 -0
- package/cdn/chunks/chunk-AAZIKH5Z.js +3650 -0
- package/cdn/chunks/chunk-AMJIIPBQ.js +48 -0
- package/cdn/chunks/chunk-BGFVQO5N.js +8 -0
- package/cdn/chunks/chunk-BRXZ5HLX.js +8 -0
- package/cdn/chunks/chunk-BSBPPIVO.js +5 -0
- package/cdn/chunks/chunk-BURSTFDF.js +2 -0
- package/cdn/chunks/chunk-C7AO3IVZ.js +48 -0
- package/cdn/chunks/chunk-CTNAGYH7.js +1 -0
- package/cdn/chunks/chunk-DESMFZJW.js +5 -0
- package/cdn/chunks/chunk-DNBBQ7LY.js +1 -0
- package/cdn/chunks/chunk-DP5FVJRS.js +21 -0
- package/cdn/chunks/chunk-E46BCOOW.js +1 -0
- package/cdn/chunks/chunk-EGFC4XQG.js +5 -0
- package/cdn/chunks/chunk-EQ4LUVQK.js +8 -0
- package/cdn/chunks/chunk-EXVHRHST.js +8 -0
- package/cdn/chunks/chunk-FC7HXYUV.js +8 -0
- package/cdn/chunks/chunk-FEJUVLN4.js +6 -0
- package/cdn/chunks/chunk-FLQBFTRW.js +37 -0
- package/cdn/chunks/chunk-FUGKKQ6E.js +1 -0
- package/cdn/chunks/chunk-FWFPMNDO.js +5 -0
- package/cdn/chunks/chunk-FYXNIYGH.js +1 -0
- package/cdn/chunks/chunk-GFO3YUEH.js +1 -0
- package/cdn/chunks/chunk-HAE5ZHID.js +1 -0
- package/cdn/chunks/chunk-HCXHHI6V.js +18 -0
- package/cdn/chunks/chunk-HDMF4QZO.js +48 -0
- package/cdn/chunks/chunk-HKUIQBCM.js +1 -0
- package/cdn/chunks/chunk-HKWYQB5Z.js +37 -0
- package/cdn/chunks/chunk-HO6JOQX4.js +25 -0
- package/cdn/chunks/chunk-HTH5YCZO.js +8 -0
- package/cdn/chunks/chunk-IHVTWACH.js +8 -0
- package/cdn/chunks/chunk-ILEDSBLL.js +8 -0
- package/cdn/chunks/chunk-IYZLVTNL.js +5 -0
- package/cdn/chunks/chunk-J5P2GBPV.js +1 -0
- package/cdn/chunks/chunk-KASON6Y7.js +17 -0
- package/cdn/chunks/chunk-KKQK6WIG.js +1 -0
- package/cdn/chunks/chunk-LBMZYOKF.js +8 -0
- package/cdn/chunks/chunk-LC7KE332.js +1 -0
- package/cdn/chunks/chunk-LIUOA3YV.js +1 -0
- package/cdn/chunks/chunk-LO4MJ72X.js +8 -0
- package/cdn/chunks/chunk-LRGALTZX.js +1 -0
- package/cdn/chunks/chunk-LRIOWAOJ.js +8 -0
- package/cdn/chunks/chunk-LVKOQVTZ.js +17 -0
- package/cdn/chunks/chunk-M4VO4BD3.js +1471 -0
- package/cdn/chunks/chunk-M53CKFQE.js +5 -0
- package/cdn/chunks/chunk-MD33BNWM.js +1 -0
- package/cdn/chunks/chunk-MLEUGPRW.js +8 -0
- package/cdn/chunks/chunk-MM76ZODZ.js +8 -0
- package/cdn/chunks/chunk-MQVMYZ75.js +1 -0
- package/cdn/chunks/chunk-MRQ46JRY.js +8 -0
- package/cdn/chunks/chunk-MSOBQUON.js +10 -0
- package/cdn/chunks/chunk-NDMZ2RAB.js +48 -0
- package/cdn/chunks/chunk-NJP4VZB3.js +8 -0
- package/cdn/chunks/chunk-NO3TZB6T.js +5 -0
- package/cdn/chunks/chunk-NRY6IJSD.js +5 -0
- package/cdn/chunks/chunk-O4RAJ3LM.js +25 -0
- package/cdn/chunks/chunk-OEZI5WCY.js +18 -0
- package/cdn/chunks/chunk-OR67S36X.js +5 -0
- package/cdn/chunks/chunk-OSLUHYFD.js +8 -0
- package/cdn/chunks/chunk-P6L4B5GC.js +1 -0
- package/cdn/chunks/chunk-PF74FX32.js +1 -0
- package/cdn/chunks/chunk-PFCJVHJ3.js +10 -0
- package/cdn/chunks/chunk-PP62N3C4.js +8 -0
- package/cdn/chunks/chunk-PQLJWD6V.js +21 -0
- package/cdn/chunks/chunk-PTQFS3S5.js +2 -0
- package/cdn/chunks/chunk-PU7OABT3.js +1 -0
- package/cdn/chunks/chunk-Q2CKZUYX.js +1 -0
- package/cdn/chunks/chunk-QEFO63QX.js +8 -0
- package/cdn/chunks/chunk-QIZBL4QP.js +1 -0
- package/cdn/chunks/chunk-RGNFAPWY.js +2 -0
- package/cdn/chunks/chunk-RHEBGA4B.js +1 -0
- package/cdn/chunks/chunk-S5QDLZ6J.js +1 -0
- package/cdn/chunks/chunk-SBWSYKE5.js +5 -0
- package/cdn/chunks/chunk-SXRIA7VB.js +8 -0
- package/cdn/chunks/chunk-SYTQX5DA.js +1 -0
- package/cdn/chunks/chunk-TLK5RNXE.js +1 -0
- package/cdn/chunks/chunk-TR7WXOQR.js +1 -0
- package/cdn/chunks/chunk-UMDZKG6K.js +1 -0
- package/cdn/chunks/chunk-UNK5GKOK.js +5 -0
- package/cdn/chunks/chunk-V2AJKKRF.js +1470 -0
- package/cdn/chunks/chunk-VEG7LKS3.js +48 -0
- package/cdn/chunks/chunk-VQ2JX2OE.js +5 -0
- package/cdn/chunks/chunk-W73FT5JE.js +48 -0
- package/cdn/chunks/chunk-W7O6UFTQ.js +5 -0
- package/cdn/chunks/chunk-WCCTDLQ4.js +8 -0
- package/cdn/chunks/chunk-WV5B4HNF.js +1471 -0
- package/cdn/chunks/chunk-WWMMW7RJ.js +1 -0
- package/cdn/chunks/chunk-X3JAXGAZ.js +8 -0
- package/cdn/chunks/chunk-XJWUPDZ4.js +10 -0
- package/cdn/chunks/chunk-XMKJLLUL.js +1 -0
- package/cdn/chunks/chunk-XMS6AFBV.js +5 -0
- package/cdn/chunks/chunk-XSVPZFGN.js +1 -0
- package/cdn/chunks/chunk-Y2P4IF3E.js +1 -0
- package/cdn/chunks/chunk-YCBNF5QU.js +17 -0
- package/cdn/chunks/chunk-YEGYR7SL.js +5 -0
- package/cdn/chunks/chunk-YHLQ2JQ2.js +1 -0
- package/cdn/chunks/chunk-ZO5G6CHW.js +1470 -0
- package/cdn/chunks/chunk-ZPCQH3EY.js +10 -0
- package/cdn/chunks/chunk-ZUQ72RIQ.js +8 -0
- package/cdn/chunks/chunk-ZZNCHSYH.js +5 -0
- package/cdn/exports/computed-item.context.js +1 -1
- package/cdn/exports/computed.context.js +1 -1
- package/cdn/exports/config.context.js +1 -1
- package/cdn/exports/interaction.js +1 -1
- package/cdn/exports/qti-assessment-item.context.js +1 -1
- package/cdn/exports/qti-condition-expression.js +1 -1
- package/cdn/exports/qti-expression.js +1 -1
- package/cdn/exports/qti.context.js +1 -1
- package/cdn/exports/session.context.js +1 -1
- package/cdn/exports/test.context.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/components/item-container.js +1 -1
- package/cdn/qti-item/components/item-correct-response-mode.js +1 -1
- package/cdn/qti-item/components/item-show-candidate-correction.js +1 -1
- package/cdn/qti-item/components/item-show-correct-response.js +1 -1
- package/cdn/qti-item/components/print-item-variables.js +1 -1
- package/cdn/qti-item/components/styles.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/styles.js +1 -1
- package/cdn/qti-test/components/test-check-item.js +1 -1
- package/cdn/qti-test/components/test-container.js +1 -1
- package/cdn/qti-test/components/test-end-attempt.js +1 -1
- package/cdn/qti-test/components/test-item-link.js +1 -1
- package/cdn/qti-test/components/test-navigation.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-print-context.js +1 -1
- package/cdn/qti-test/components/test-print-item-variables.js +1 -1
- package/cdn/qti-test/components/test-scoring-buttons.js +1 -1
- package/cdn/qti-test/components/test-scoring-feedback.js +1 -1
- package/cdn/qti-test/components/test-section-buttons-stamp.js +1 -1
- package/cdn/qti-test/components/test-section-link.js +1 -1
- package/cdn/qti-test/components/test-show-correct-response.js +1 -1
- package/cdn/qti-test/components/test-stamp.js +1 -1
- package/cdn/qti-test/components/test-view-toggle.js +1 -1
- package/cdn/qti-test/components/test-view.js +1 -1
- package/cdn/qti-test/core/index.js +1 -1
- package/dist/chunks/chunk-3JJM4BKK.js +367 -0
- package/dist/chunks/chunk-3JJM4BKK.js.map +1 -0
- package/dist/chunks/chunk-3LX4O663.js +3688 -0
- package/dist/chunks/chunk-3LX4O663.js.map +1 -0
- package/dist/chunks/chunk-4PG2PZHY.js +8924 -0
- package/dist/chunks/chunk-4PG2PZHY.js.map +1 -0
- package/dist/chunks/chunk-55C6NAK5.js +142 -0
- package/dist/chunks/chunk-55C6NAK5.js.map +1 -0
- package/dist/chunks/chunk-5P64MALP.js +3640 -0
- package/dist/chunks/chunk-5P64MALP.js.map +1 -0
- package/dist/chunks/chunk-65YQSKWV.js +94 -0
- package/dist/chunks/chunk-65YQSKWV.js.map +1 -0
- package/dist/chunks/chunk-ARBFS6D6.js +8924 -0
- package/dist/chunks/chunk-ARBFS6D6.js.map +1 -0
- package/dist/chunks/chunk-EB3ZESWL.js +367 -0
- package/dist/chunks/chunk-EB3ZESWL.js.map +1 -0
- package/dist/chunks/chunk-ERYHQVOT.js +8 -0
- package/dist/chunks/chunk-ERYHQVOT.js.map +1 -0
- package/dist/chunks/chunk-FL72PF4D.js +19 -0
- package/dist/chunks/chunk-FL72PF4D.js.map +1 -0
- package/dist/chunks/chunk-HFAUM56X.js +208 -0
- package/dist/chunks/chunk-HFAUM56X.js.map +1 -0
- package/dist/chunks/chunk-JOASLKRQ.js +914 -0
- package/dist/chunks/chunk-JOASLKRQ.js.map +1 -0
- package/dist/chunks/chunk-K4QJBUIX.js +367 -0
- package/dist/chunks/chunk-K4QJBUIX.js.map +1 -0
- package/dist/chunks/chunk-KYN4AAHS.js +8839 -0
- package/dist/chunks/chunk-KYN4AAHS.js.map +1 -0
- package/dist/chunks/chunk-MLRMRXGZ.js +367 -0
- package/dist/chunks/chunk-MLRMRXGZ.js.map +1 -0
- package/dist/chunks/chunk-MOIHNOX3.js +94 -0
- package/dist/chunks/chunk-MOIHNOX3.js.map +1 -0
- package/dist/chunks/chunk-P2PRB5IZ.js +94 -0
- package/dist/chunks/chunk-P2PRB5IZ.js.map +1 -0
- package/dist/chunks/chunk-PF5X3SZR.js +94 -0
- package/dist/chunks/chunk-PF5X3SZR.js.map +1 -0
- package/dist/chunks/chunk-QCB6P7DH.js +146 -0
- package/dist/chunks/chunk-QCB6P7DH.js.map +1 -0
- package/dist/chunks/chunk-QU7KR7VX.js +367 -0
- package/dist/chunks/chunk-QU7KR7VX.js.map +1 -0
- package/dist/chunks/chunk-RTSIFU3A.js +8924 -0
- package/dist/chunks/chunk-RTSIFU3A.js.map +1 -0
- package/dist/chunks/chunk-SZ3DDAJ7.js +142 -0
- package/dist/chunks/chunk-SZ3DDAJ7.js.map +1 -0
- package/dist/chunks/chunk-SZTQ6IWR.js +8835 -0
- package/dist/chunks/chunk-SZTQ6IWR.js.map +1 -0
- package/dist/chunks/chunk-UUM4KYBV.js +914 -0
- package/dist/chunks/chunk-UUM4KYBV.js.map +1 -0
- package/dist/chunks/chunk-V4L4ONOK.js +914 -0
- package/dist/chunks/chunk-V4L4ONOK.js.map +1 -0
- package/dist/chunks/chunk-V7ACRMW7.js +914 -0
- package/dist/chunks/chunk-V7ACRMW7.js.map +1 -0
- package/dist/chunks/chunk-WEKBCXNI.js +8839 -0
- package/dist/chunks/chunk-WEKBCXNI.js.map +1 -0
- package/dist/chunks/chunk-WN6TJQI2.js +103 -0
- package/dist/chunks/chunk-WN6TJQI2.js.map +1 -0
- package/dist/chunks/chunk-XM2JOPVU.js +914 -0
- package/dist/chunks/chunk-XM2JOPVU.js.map +1 -0
- package/dist/chunks/chunk-ZZIDNW4D.js +914 -0
- package/dist/chunks/chunk-ZZIDNW4D.js.map +1 -0
- package/dist/exports/computed-item.context.d.ts +2 -1
- package/dist/exports/computed.context.d.ts +3 -2
- package/dist/exports/config.context.d.ts +1 -0
- package/dist/exports/config.context.js +1 -1
- package/dist/exports/interaction.d.ts +2 -1
- package/dist/exports/interaction.js +5 -2
- package/dist/exports/item.context.d.ts +2 -1
- package/dist/exports/qti-assessment-item.context.d.ts +2 -1
- package/dist/exports/qti-condition-expression.d.ts +2 -1
- package/dist/exports/qti-condition-expression.js +3 -3
- package/dist/exports/qti-expression.d.ts +2 -1
- package/dist/exports/qti-expression.js +2 -2
- package/dist/exports/qti-test.d.ts +3 -2
- package/dist/exports/session.context.d.ts +3 -2
- package/dist/exports/test.context.d.ts +2 -1
- package/dist/exports/variables.d.ts +2 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +12 -12
- package/dist/item.css +66 -6
- package/dist/qti-components/index.d.ts +16 -5
- package/dist/qti-components/index.js +6 -6
- package/dist/qti-components-jsx.d.ts +29 -18
- package/dist/qti-item/components/item-container.js +2 -2
- package/dist/qti-item/components/item-correct-response-mode.js +1 -1
- package/dist/qti-item/components/item-show-candidate-correction.d.ts +2 -1
- package/dist/qti-item/components/item-show-correct-response.d.ts +2 -1
- package/dist/qti-item/components/print-item-variables.d.ts +2 -1
- package/dist/qti-item/core/index.d.ts +1 -1
- package/dist/qti-item/core/index.js +4 -4
- package/dist/qti-loader/index.d.ts +2 -1
- package/dist/qti-response-declaration-BKOw2_Pl.d.ts +1378 -0
- package/dist/qti-response-declaration-DKr08ANy.d.ts +1397 -0
- package/dist/qti-response-declaration-Dz6D30cF.d.ts +1397 -0
- package/dist/qti-response-declaration-d_tAAEFq.d.ts +1378 -0
- package/dist/qti-test/components/index.d.ts +3 -3
- package/dist/qti-test/components/index.js +4 -4
- package/dist/qti-test/components/test-container.js +2 -2
- package/dist/qti-test/components/test-navigation.d.ts +2 -2
- package/dist/qti-test/components/test-navigation.js +2 -2
- package/dist/qti-test/components/test-next.d.ts +3 -2
- package/dist/qti-test/components/test-prev.d.ts +3 -2
- package/dist/qti-test/components/test-print-context.d.ts +3 -2
- package/dist/qti-test/components/test-print-item-variables.d.ts +3 -2
- package/dist/qti-test/components/test-scoring-buttons.d.ts +3 -2
- package/dist/qti-test/components/test-scoring-feedback.d.ts +3 -2
- package/dist/qti-test/components/test-show-correct-response.d.ts +3 -2
- package/dist/qti-test/core/index.d.ts +4 -3
- package/dist/qti-test/core/index.js +7 -7
- package/dist/qti-test-feedback-Bskvq3FE.d.ts +91 -0
- package/dist/qti-test-feedback-CZsbp6z4.d.ts +91 -0
- package/dist/qti-test-feedback-dSr4W5Ft.d.ts +91 -0
- package/dist/qti-test-feedback-jBGxkr5n.d.ts +91 -0
- package/dist/vscode.html-custom-data.json +3 -2
- package/package.json +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import{a as m}from"./chunk-HO6JOQX4.js";import{a as d,d as a,i as l}from"./chunk-FLQBFTRW.js";import{a as b}from"./chunk-P6SSTAJ2.js";import{b as c}from"./chunk-3YQMAZEO.js";import{a as i}from"./chunk-LO2NM3CE.js";var o=class extends l{render(){let s=this.computedContext?.testParts.flatMap(t=>t.sections.flatMap(p=>p.items)).find(t=>t.active);if(!s||!s.variables)return a``;let u=s.variables.filter(t=>t.type==="response"),f=s.variables.filter(t=>t.type==="outcome"),n=(t,p)=>a`
|
|
2
|
+
<h3>${p}</h3>
|
|
3
|
+
<table>
|
|
4
|
+
<thead>
|
|
5
|
+
<tr>
|
|
6
|
+
<th>Identifier</th>
|
|
7
|
+
<th>Value</th>
|
|
8
|
+
<th>Cardinality</th>
|
|
9
|
+
<th>Base Type</th>
|
|
10
|
+
<th>Correct Response / Mappings</th>
|
|
11
|
+
</tr>
|
|
12
|
+
</thead>
|
|
13
|
+
<tbody>
|
|
14
|
+
${t.map(e=>{let h=e.correctResponse?Array.isArray(e.correctResponse)?e.correctResponse.join(", "):e.correctResponse:"",x=e.mapping?.mapEntries?.map(r=>`${r.mapKey}=${r.mappedValue}pt`).join(", ")||"",y=e.areaMapping?.areaMapEntries?.map(r=>`${r.shape}(${r.coords})=${r.mappedValue}pt`).join(", ")||"";return a`
|
|
15
|
+
<tr>
|
|
16
|
+
<td>${e.identifier}</td>
|
|
17
|
+
<td>${Array.isArray(e.value)?e.value.join(", "):e.value}</td>
|
|
18
|
+
<td>${e.cardinality}</td>
|
|
19
|
+
<td>${e.baseType}</td>
|
|
20
|
+
<td>${h||x||y}</td>
|
|
21
|
+
</tr>
|
|
22
|
+
`})}
|
|
23
|
+
</tbody>
|
|
24
|
+
</table>
|
|
25
|
+
`;return a`
|
|
26
|
+
${n(u,"Response Variables")} ${n(f,"Outcome Variables")}
|
|
27
|
+
`}};o.styles=d`
|
|
28
|
+
table {
|
|
29
|
+
width: 100%;
|
|
30
|
+
border-collapse: collapse;
|
|
31
|
+
margin: 20px 0;
|
|
32
|
+
font-size: 14px;
|
|
33
|
+
text-align: left;
|
|
34
|
+
}
|
|
35
|
+
th,
|
|
36
|
+
td {
|
|
37
|
+
border: 1px solid #ddd;
|
|
38
|
+
padding: 8px;
|
|
39
|
+
}
|
|
40
|
+
th {
|
|
41
|
+
background-color: #f4f4f4;
|
|
42
|
+
font-weight: bold;
|
|
43
|
+
}
|
|
44
|
+
h3 {
|
|
45
|
+
margin-top: 20px;
|
|
46
|
+
font-size: 16px;
|
|
47
|
+
}
|
|
48
|
+
`,i([c({context:b,subscribe:!0})],o.prototype,"computedContext",2),o=i([m("test-print-item-variables")],o);export{o as a};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{b as a,c as n}from"./chunk-KASON6Y7.js";import{a as o}from"./chunk-HO6JOQX4.js";import{a as s,d as r,i as l}from"./chunk-FLQBFTRW.js";import{a as e}from"./chunk-LO2NM3CE.js";var t=class extends l{constructor(){super(),this.addEventListener("click",()=>this.dispatchEvent(new CustomEvent("test-end-attempt",{bubbles:!0})))}render(){return r` <slot></slot> `}};t.styles=s`
|
|
2
|
+
:host {
|
|
3
|
+
${a};
|
|
4
|
+
}
|
|
5
|
+
:host([disabled]) {
|
|
6
|
+
${n};
|
|
7
|
+
}
|
|
8
|
+
`,t=e([o("test-end-attempt")],t);export{t as a};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{b as h,c as u}from"./chunk-3CVBBZDT.js";import{a as m,b as s}from"./chunk-O4RAJ3LM.js";import{a as p,d as c,i as l}from"./chunk-HKWYQB5Z.js";import{a as d}from"./chunk-P6SSTAJ2.js";import{b as a}from"./chunk-3YQMAZEO.js";import{a as e}from"./chunk-LO2NM3CE.js";var t=class extends l{constructor(){super(...arguments);this.shown=!1;this.disabled=!1;this.showCorrectText="Show correct response";this.hideCorrectText="Hide correct response";this.noCorrectResponseText="No correct response specified"}willUpdate(b){let i=this.computedContext?.testParts.flatMap(r=>r.sections.flatMap(n=>n.items)).find(r=>r.active);if(this._previousActiveItem!==i&&(this.shown=!1,this._previousActiveItem=i),i){let r=!!i?.variables?.some(o=>o.correctResponse),n=!!i?.variables?.some(o=>o.mapping?.mapEntries?.length>0||o.areaMapping?.areaMapEntries?.length>0);this.disabled=!r&&!n}else this.disabled=!0}_toggleState(){this.disabled||(this.shown=!this.shown,this.dispatchEvent(new CustomEvent("test-show-correct-response",{detail:this.shown,bubbles:!0})))}_getDisplayedText(){return this.disabled?this.noCorrectResponseText:this.shown?this.hideCorrectText:this.showCorrectText}render(){return c` <div @click="${this._toggleState}">${this._getDisplayedText()}</div> `}};t.styles=p`
|
|
2
|
+
:host {
|
|
3
|
+
${h};
|
|
4
|
+
}
|
|
5
|
+
:host([disabled]) {
|
|
6
|
+
${u};
|
|
7
|
+
}
|
|
8
|
+
`,e([a({context:d,subscribe:!0})],t.prototype,"computedContext",2),e([s({type:Boolean,reflect:!0})],t.prototype,"shown",2),e([s({type:Boolean,reflect:!0})],t.prototype,"disabled",2),e([s({type:String})],t.prototype,"showCorrectText",2),e([s({type:String})],t.prototype,"hideCorrectText",2),e([s({type:String})],t.prototype,"noCorrectResponseText",2),t=e([m("test-show-correct-response")],t);export{t as a};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{g as S}from"./chunk-WV5B4HNF.js";import{a as L}from"./chunk-DP5FVJRS.js";import{a as V}from"./chunk-E6IOJ4MV.js";import{a as R,b as A}from"./chunk-CZDMOYYF.js";import{a as w,b as x}from"./chunk-QQR6POPY.js";import{a as E,b as o}from"./chunk-O4RAJ3LM.js";import{a as N,d,i as p}from"./chunk-HKWYQB5Z.js";import{a as I,b as C}from"./chunk-3YQMAZEO.js";import{a as i}from"./chunk-LO2NM3CE.js";var M=(e=>(e.ITEM_NOT_FOUND="item-not-found",e.SECTION_NOT_FOUND="section-not-found",e.LOAD_ERROR="load-error",e.NETWORK_ERROR="network-error",e.TIMEOUT_ERROR="timeout-error",e))(M||{}),D=m=>{class c extends m{constructor(...t){super(...t);this.navigate=null;this.cacheTransform=!1;this.requestTimeout=3e4;this.showLoadingIndicators=!0;this._activeRequests=[];this._navigationInProgress=!1;this._lastError=null;this._lastNavigationRequestId=null;this._targetNavigation=null;this.addEventListener("qti-request-navigation",async({detail:e})=>{if(!e?.id)return;let s=`nav_${Date.now()}_${Math.random()}`;this._lastNavigationRequestId=s;try{if(this._navigationInProgress=!0,this._lastError=null,this._dispatchStatusEvent({loading:!0,type:e.type,id:e.id}),this._cancelActiveRequests(),this._targetNavigation={type:e.type,id:e.id},e.type==="item"?await this._navigateToItem(e.id):e.type==="section"&&await this._navigateToSection(e.id),this._lastNavigationRequestId!==s){console.log("Navigation was superseded by a newer request");return}}catch(u){if(this._lastNavigationRequestId===s){let a=this._normalizeError(u,e.type,e.id);this._lastError=a,this._dispatchErrorEvent(a),console.error(`Navigation error (${a.type}):`,a.message,a.details)}}finally{this._lastNavigationRequestId===s&&(this._navigationInProgress=!1,this._dispatchStatusEvent({loading:!1,type:e.type,id:e.id}))}}),this.addEventListener("qti-assessment-test-connected",e=>{this._testElement=e.detail,this._initializeNavigation()})}_initializeNavigation(){let t;this.navigate==="section"&&(t=this._testElement.querySelector("qti-assessment-section")?.identifier),this.navigate==="item"&&(t=this.sessionContext.navItemRefId??this._testElement.querySelector("qti-assessment-item-ref")?.identifier),t&&this.dispatchEvent(new CustomEvent("qti-request-navigation",{detail:{type:this.navigate==="section"?"section":"item",id:t},bubbles:!0,composed:!0}))}navigateTo(t,e){e||(t==="section"&&(e=this._testElement?.querySelector("qti-assessment-section")?.identifier),t==="item"&&(e=this._testElement?.querySelector("qti-assessment-item-ref")?.identifier)),this.dispatchEvent(new CustomEvent("qti-request-navigation",{detail:{type:t,id:e},bubbles:!0,composed:!0}))}async _navigateToItem(t){let e=this._testElement?.querySelector(`qti-assessment-item-ref[identifier="${t}"]`);if(!e)throw{type:"item-not-found",message:`Item with identifier "${t}" not found.`,itemId:t};let s=e.closest("qti-test-part")?.identifier,u=e.closest("qti-assessment-section")?.identifier;this.sessionContext={...this.sessionContext,navPartId:s,navSectionId:u,navItemRefId:t,navItemLoading:!0};try{await this._loadItems([t])}finally{this.sessionContext={...this.sessionContext,navItemLoading:!1}}}async _navigateToSection(t){let e=this._testElement?.querySelector(`qti-assessment-section[identifier="${t}"]`);if(!e)throw{type:"section-not-found",message:`Section with identifier "${t}" not found.`,sectionId:t};let s=e.closest("qti-test-part")?.identifier;this.sessionContext={...this.sessionContext,navPartId:s,navSectionId:t,navItemRefId:null,navItemLoading:!0};try{let u=this._getSectionItemIds(t);await this._loadItems(u)}finally{this.sessionContext={...this.sessionContext,navItemLoading:!1}}}_normalizeError(t,e,s){return t&&t.type&&Object.values(M).includes(t.type)?t:t instanceof DOMException&&t.name==="AbortError"?{type:"network-error",message:"Navigation was cancelled because a new navigation was requested.",details:t}:t.name==="TimeoutError"||t.message&&t.message.includes("timeout")?{type:"timeout-error",message:"Request timed out. Please check your network connection.",details:t}:t instanceof TypeError&&t.message.includes("network")?{type:"network-error",message:"A network error occurred. Please check your connection.",details:t}:{type:"load-error",message:`Failed to load ${e}: ${s}`,details:t,itemId:e==="item"?s:void 0,sectionId:e==="section"?s:void 0}}_dispatchErrorEvent(t){this.dispatchEvent(new CustomEvent("qti-navigation-error",{detail:t,bubbles:!0,composed:!0}))}_dispatchStatusEvent(t){this.showLoadingIndicators&&this.dispatchEvent(new CustomEvent("qti-navigation-status",{detail:t,bubbles:!0,composed:!0}))}_cancelActiveRequests(){this._activeRequests.length>0&&(console.info(`Cancelling ${this._activeRequests.length} pending requests`),this._activeRequests.forEach(t=>{t&&t.readyState!==4&&t.abort()}),this._activeRequests=[])}async _loadItems(t){if(!this._testElement||t.length===0)return;let e=t.map(a=>this._testElement.querySelector(`qti-assessment-item-ref[identifier="${a}"]`)),s=e.reduce((a,v,l)=>(v||a.push(t[l]),a),[]);if(s.length>0)throw{type:"item-not-found",message:`One or more items not found: ${s.join(", ")}`,details:{missingItems:s}};this._clearLoadedItems();let u=e.map(async a=>{if(!a)return null;let v=new Promise((l,b)=>{setTimeout(()=>{b({name:"TimeoutError",message:`Request for item ${a.identifier} timed out after ${this.requestTimeout}ms`})},this.requestTimeout)});try{let{promise:l,request:b}=V(this.cacheTransform).load(a.href);b instanceof XMLHttpRequest&&this._activeRequests.push(b);let B=await Promise.race([l,v]);return{itemRef:a,doc:B.htmlDoc(),request:b}}catch(l){if(l instanceof DOMException&&l.name==="AbortError"||l&&l.name==="TimeoutError")return console.log(`Request for item ${a.identifier} was ${l.name==="TimeoutError"?"timed out":"aborted"}`),null;throw l.itemId=a.identifier,l}});try{let v=(await Promise.all(u)).filter(l=>l!==null);if(v.forEach(({itemRef:l,doc:b})=>{l&&b&&(l.xmlDoc=b)}),this._activeRequests=[],requestAnimationFrame(()=>{this.dispatchEvent(new CustomEvent("qti-test-loaded",{detail:v.map(({itemRef:l})=>({identifier:l?.identifier,element:l})),bubbles:!0,composed:!0}))}),v.length===0&&t.length>0)throw{type:"load-error",message:"All item requests failed to load",details:{itemIds:t}};return v}catch(a){throw console.error("Error loading items:",a),a}}_getSectionItemIds(t){if(!this._testElement?.querySelector(`qti-assessment-section[identifier="${t}"]`))throw{type:"section-not-found",message:`Section with identifier "${t}" not found.`,sectionId:t};return Array.from(this._testElement.querySelectorAll(`qti-assessment-section[identifier="${t}"] > qti-assessment-item-ref`)).map(s=>s.identifier)}_clearLoadedItems(){let t=this._testElement?.querySelectorAll("qti-assessment-test qti-assessment-item-ref");Array.from(t||[]).forEach(e=>{e.xmlDoc=null})}retryNavigation(){if(this._lastError){let t=this._lastError.itemId?"item":"section",e=this._lastError.itemId||this._lastError.sectionId;e&&this.dispatchEvent(new CustomEvent("qti-request-navigation",{detail:{type:t,id:e},bubbles:!0,composed:!0}))}else this._targetNavigation&&this.dispatchEvent(new CustomEvent("qti-request-navigation",{detail:this._targetNavigation,bubbles:!0,composed:!0}))}}return i([o({type:String})],c.prototype,"navigate",2),i([o({type:Boolean,attribute:"cache-transform"})],c.prototype,"cacheTransform",2),i([o({type:Number})],c.prototype,"requestTimeout",2),i([o({type:Boolean})],c.prototype,"showLoadingIndicators",2),c};var P=m=>{class c extends m{constructor(...n){super(...n),this.sessionContext={...this.sessionContext,view:"candidate"},this.addEventListener("on-test-switch-view",t=>{this.sessionContext={...this.sessionContext,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(n){super.willUpdate(n),n.has("sessionContext")&&this._updateElementView()}_updateElementView(){if(this._testElement){Array.from(this._testElement.querySelectorAll("[view]")).forEach(s=>{s.classList.toggle("show",s.getAttribute("view")===this.sessionContext.view)});let e=this._testElement.querySelector(`qti-assessment-item-ref[identifier="${this.sessionContext.navItemRefId}"]`)?.assessmentItem;e&&e.showCorrectResponse(this.sessionContext.view==="scorer")}}_setCorrectResponseVisibility(n){n.showCorrectResponse(this.sessionContext.view==="scorer")}}return c};var q=class extends p{constructor(){super();this.testContext=w;this.sessionContext=R;this._updateItemInTestContext=r=>{let n=r._context,t=n.identifier,e=n.variables,s=this.testContext.items.find(u=>u?.identifier===t);if(!s){console.warn(`Item IDs between assessment.xml and item.xml should match: ${t} is not found!`);return}s.variables?.length===1?this._updateItemVariablesInTestContext(t,e):r.variables=[...s.variables||[]]};this.addEventListener("qti-assessment-test-connected",r=>{if(this.testContext=w,this.sessionContext=R,this.testContext&&this.testContext.items.length>0)return;this._testElement=r.detail;let n=Array.from(this._testElement.querySelectorAll("qti-assessment-item-ref")).map(t=>({href:t.href,identifier:t.identifier,category:t.category,variables:[{identifier:"completionStatus",value:"not_attempted",type:"outcome"}]}));this.testContext={...this.testContext,items:n}}),this.addEventListener("qti-assessment-item-connected",r=>{let n=r.detail,t=n.closest("qti-assessment-item-ref")?.identifier;t&&(n.assessmentItemRefId=t),this._updateItemInTestContext(r.detail)}),this.addEventListener("qti-item-context-updated",r=>{this._updateItemVariablesInTestContext(r.detail.itemContext.identifier,r.detail.itemContext.variables)})}updateItemVariables(r,n){let t=this.testContext.items.find(s=>s.identifier===r);t&&(t.variables=t.variables.map(s=>{let u=n.find(a=>a.identifier===s.identifier);return u?{...s,...u}:s}));let e=this._testElement.querySelector(`qti-assessment-item-ref[identifier="${r}"]`);e&&e.assessmentItem&&e.assessmentItem&&(e.assessmentItem.variables=n)}_updateItemVariablesInTestContext(r,n){this.testContext={...this.testContext,items:this.testContext.items.map(t=>t.identifier!==r?t:{...t,variables:n.map(e=>{let s=t.variables.find(u=>u.identifier===e.identifier);return s?{...s,...e}:e})})},this.dispatchEvent(new CustomEvent("qti-test-context-updated",{detail:this.testContext,bubbles:!1,composed:!1}))}};i([o({attribute:!1,type:Object}),I({context:x})],q.prototype,"testContext",2),i([o({attribute:!1,type:Object}),I({context:A})],q.prototype,"sessionContext",2);var $=m=>{class c extends m{constructor(...n){super(...n),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:e,value:s}=t.detail;this.updateOutcomeVariable(e,s),t.stopPropagation()})}outcomeProcessing(){let n=this.querySelector("qti-outcome-processing");return n?(n?.process(),!0):!1}updateOutcomeVariable(n,t){let e=this.getOutcome(n);if(!e){console.warn(`Can not set qti-outcome-identifier: ${n}, it is not available`);return}this.testContext={...this.testContext,testOutcomeVariables:this.testContext.testOutcomeVariables?.map(s=>s.identifier!==n?s:{...s,value:e.cardinality==="single"?t:[...s.value,t]})}}getOutcome(n){return this.getVariable(n)}getVariable(n){return this.testContext.testOutcomeVariables?.find(t=>t.identifier===n)||null}}return c};var T=class extends D(P($(q))){async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new CustomEvent("qti-test-connected",{detail:this}))}render(){return d`<slot></slot>`}};T=i([E("qti-test")],T);var k={fromAttribute(m){return m==="true"},toAttribute(m){return m?"true":"false"}},f=class extends p{constructor(){super(...arguments);this.weigths=new Map}createRenderRoot(){return this}get assessmentItem(){return this.renderRoot?.querySelector("qti-assessment-item")}async connectedCallback(){super.connectedCallback();let r=this.getRootNode().host.closest("qti-test").querySelector("template[item-ref]");r&&(this.myTemplate=L(r)),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 this.myTemplate?this.myTemplate({xmlDoc:this.xmlDoc}):this.xmlDoc}};i([o({type:String})],f.prototype,"category",2),i([o({type:String})],f.prototype,"identifier",2),i([o({type:Boolean,converter:k})],f.prototype,"required",2),i([o({type:Boolean,converter:k})],f.prototype,"fixed",2),i([o({type:String})],f.prototype,"href",2),i([o({type:Object,attribute:!1})],f.prototype,"xmlDoc",2);customElements.get("qti-assessment-item-ref")||customElements.define("qti-assessment-item-ref",f);var O={fromAttribute(m){return m==="true"},toAttribute(m){return m?"true":"false"}},h=class extends p{constructor(){super(...arguments);this._title=""}get title(){return this._title}set title(r){this._title=r,this.removeAttribute("title"),this.setAttribute("data-title",r)}async connectedCallback(){this._title=this.getAttribute("title")||"",super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new Event("qti-assessment-section-connected",{bubbles:!0,composed:!0}))}render(){return d`<slot name="qti-rubric-block"></slot><slot></slot>`}};i([o({type:String})],h.prototype,"identifier",2),i([o({type:String})],h.prototype,"required",2),i([o({type:Boolean,converter:O})],h.prototype,"fixed",2),i([o({type:Boolean,converter:O})],h.prototype,"visible",2),i([o({type:Boolean,converter:O,attribute:"keep-together"})],h.prototype,"keepTogether",2),i([C({context:x,subscribe:!0})],h.prototype,"_testContext",2);customElements.get("qti-assessment-section")||customElements.define("qti-assessment-section",h);var y=class extends p{constructor(){super(...arguments);this._title=""}get title(){return this._title}set title(r){this._title=r,this.removeAttribute("title"),this.setAttribute("data-title",r)}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new CustomEvent("qti-assessment-test-connected",{detail:this,bubbles:!0,composed:!0}))}render(){return d` <slot></slot>`}};i([o({type:String})],y.prototype,"identifier",2),i([o({type:String})],y.prototype,"title",1),i([C({context:x,subscribe:!0})],y.prototype,"_testContext",2),y=i([E("qti-assessment-test")],y);var g=class extends p{constructor(){super(...arguments);this.identifier="";this.class="";this.navigationMode="nonlinear";this.submissionMode="individual";this._title=""}get title(){return this._title}set title(r){this._title=r,this.removeAttribute("title"),this.setAttribute("data-title",r)}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new Event("qti-test-part-connected",{bubbles:!0,composed:!0}))}render(){return d` <slot></slot>`}};i([o({type:String})],g.prototype,"identifier",2),i([o({type:String})],g.prototype,"class",2),i([o({type:String,attribute:"navigation-mode"})],g.prototype,"navigationMode",2),i([o({type:String,attribute:"submission-mode"})],g.prototype,"submissionMode",2),g=i([E("qti-test-part")],g);customElements.get("qti-test-part")||customElements.define("qti-test-part",g);var _=class extends S{render(){return d``}};_.styles=N`
|
|
2
|
+
:host {
|
|
3
|
+
color: gray;
|
|
4
|
+
}
|
|
5
|
+
`,_=i([E("qti-test-feedback")],_);export{T as a,f as b,h as c,y as d,g as e,_ as f};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as x}from"./chunk-PQLJWD6V.js";import{a as v,b as f,c as p}from"./chunk-HO6JOQX4.js";import{d as r,g as c,i as d}from"./chunk-FLQBFTRW.js";import{a as h}from"./chunk-P6SSTAJ2.js";import{b as u}from"./chunk-3YQMAZEO.js";import{a as o}from"./chunk-LO2NM3CE.js";var e=class extends d{constructor(){super(...arguments);this.debug=!1;this.stampContext={view:"candidate",activeItem:{},activeSection:{items:[]},activeTestpart:{items:[],sections:[]},test:{}}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback();let m=this.querySelector("template");if(!m){this.myTemplate=null;return}this.myTemplate=x(m)}willUpdate(m){if(!this.computedContext)return;let i=this.computedContext.testParts.find(t=>t.active),n=i?.sections.find(t=>t.active),l=n?.items.find(t=>t.active),{variables:P,...C}=l||{};if(!i||!n||!l)return;let y={...i,items:i.sections.flatMap(t=>t.items.map(({variables:a,...s})=>s)),sections:i.sections.map(t=>({...t,items:t.items.map(({variables:a,...s})=>s)}))},T={...n,items:n.items.map(({variables:t,...a})=>a)},{testParts:k,...b}=this.computedContext;this.stampContext={view:this.computedContext.view,activeItem:C,activeSection:T,activeTestpart:y,test:b}}render(){return r` ${this.debug?r`<small><pre>${JSON.stringify(this.stampContext,null,2)}</pre></small>`:c}
|
|
2
|
+
${this.myTemplate?this.myTemplate(this.stampContext):c}`}};o([f({type:Boolean,reflect:!0})],e.prototype,"debug",2),o([p(),u({context:h,subscribe:!0})],e.prototype,"computedContext",2),o([p()],e.prototype,"stampContext",2),e=o([v("test-stamp")],e);export{e as a};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import{a as l}from"./chunk-HO6JOQX4.js";import{a as d,d as a,i as c}from"./chunk-FLQBFTRW.js";import{a as m}from"./chunk-TCHROQU3.js";import{b as i}from"./chunk-3YQMAZEO.js";import{a as p}from"./chunk-LO2NM3CE.js";var r=class extends c{render(){let s=this.computedContext;if(!s||!s.variables)return a``;let b=s.variables.filter(o=>o.type==="response"),u=s.variables.filter(o=>o.type==="outcome"),n=(o,h)=>a`
|
|
2
|
+
<h3>${h}</h3>
|
|
3
|
+
<table>
|
|
4
|
+
<thead>
|
|
5
|
+
<tr>
|
|
6
|
+
<th>Identifier</th>
|
|
7
|
+
<th>Value</th>
|
|
8
|
+
<th>Cardinality</th>
|
|
9
|
+
<th>Base Type</th>
|
|
10
|
+
<th>Correct Response / Mappings</th>
|
|
11
|
+
</tr>
|
|
12
|
+
</thead>
|
|
13
|
+
<tbody>
|
|
14
|
+
${o.map(e=>{let f=e.correctResponse?Array.isArray(e.correctResponse)?e.correctResponse.join(", "):e.correctResponse:"",x=e.mapping?.mapEntries?.map(t=>`${t.mapKey}=${t.mappedValue}pt`).join(", ")||"",y=e.areaMapping?.areaMapEntries?.map(t=>`${t.shape}(${t.coords})=${t.mappedValue}pt`).join(", ")||"";return a`
|
|
15
|
+
<tr>
|
|
16
|
+
<td>${e.identifier}</td>
|
|
17
|
+
<td>${Array.isArray(e.value)?e.value.join(", "):e.value}</td>
|
|
18
|
+
<td>${e.cardinality}</td>
|
|
19
|
+
<td>${e.baseType}</td>
|
|
20
|
+
<td>${f||x||y}</td>
|
|
21
|
+
</tr>
|
|
22
|
+
`})}
|
|
23
|
+
</tbody>
|
|
24
|
+
</table>
|
|
25
|
+
`;return a`
|
|
26
|
+
${n(b,"Response Variables")} ${n(u,"Outcome Variables")}
|
|
27
|
+
`}};r.styles=d`
|
|
28
|
+
table {
|
|
29
|
+
width: 100%;
|
|
30
|
+
border-collapse: collapse;
|
|
31
|
+
margin: 20px 0;
|
|
32
|
+
font-size: 14px;
|
|
33
|
+
text-align: left;
|
|
34
|
+
}
|
|
35
|
+
th,
|
|
36
|
+
td {
|
|
37
|
+
border: 1px solid #ddd;
|
|
38
|
+
padding: 8px;
|
|
39
|
+
}
|
|
40
|
+
th {
|
|
41
|
+
background-color: #f4f4f4;
|
|
42
|
+
font-weight: bold;
|
|
43
|
+
}
|
|
44
|
+
h3 {
|
|
45
|
+
margin-top: 20px;
|
|
46
|
+
font-size: 16px;
|
|
47
|
+
}
|
|
48
|
+
`,p([i({context:m,subscribe:!0})],r.prototype,"computedContext",2),r=p([l("print-item-variables")],r);export{r as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as p}from"./chunk-P6SSTAJ2.js";import{a as d,b as c}from"./chunk-HO6JOQX4.js";import{d as a,i as m}from"./chunk-FLQBFTRW.js";import{b as s}from"./chunk-3YQMAZEO.js";import{a as n}from"./chunk-LO2NM3CE.js";var o=class extends m{constructor(){super(...arguments);this.view=null}render(){let r=this.computedContext?.testParts.flatMap(t=>t.sections.flatMap(f=>f.items)).find(t=>t.active);if(!r||!r.variables)return a``;if(r.category==="dep-informational")return a`<div>${this.dataset.informational}</div>`;let u=r?.variables.find(t=>t.identifier==="completionStatus")?.value,l=r?.variables.find(t=>t.identifier=="SCORE"),e=parseFloat(l?.value),i=r.externalScored;return a`<div>${u!=="completed"?this.dataset.textNoResponse:!i&&e!==void 0&&!Number.isNaN(e)?e>0?this.dataset.textCorrect:this.dataset.textIncorrect:i==="externalMachine"?Number.isNaN(e)||e===void 0?this.dataset.scoreUnknown:`We hebben je antwoord ${e===0?"geen punten":e==1?"\xE9\xE9n punt":`${e} punten`} gegeven. Je kunt je score zelf aanpassen als je denkt dat dat niet klopt.`:i==="human"?Number.isNaN(e)?"":"Deze score heb je zelf toegekend.":this.dataset.inProgress}</div>`}};n([s({context:p,subscribe:!0})],o.prototype,"computedContext",2),n([c({type:String,attribute:"view"})],o.prototype,"view",2),o=n([d("test-scoring-feedback")],o);export{o as a};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as L}from"./chunk-DP5FVJRS.js";import{a as R,b as A}from"./chunk-CZDMOYYF.js";import{g as S}from"./chunk-6ZE2IMSJ.js";import{a as V}from"./chunk-E6IOJ4MV.js";import{a as w,b as x}from"./chunk-QQR6POPY.js";import{a as E,b as o}from"./chunk-O4RAJ3LM.js";import{a as N,d,i as p}from"./chunk-HKWYQB5Z.js";import{a as I,b as C}from"./chunk-3YQMAZEO.js";import{a as i}from"./chunk-LO2NM3CE.js";var M=(e=>(e.ITEM_NOT_FOUND="item-not-found",e.SECTION_NOT_FOUND="section-not-found",e.LOAD_ERROR="load-error",e.NETWORK_ERROR="network-error",e.TIMEOUT_ERROR="timeout-error",e))(M||{}),D=m=>{class c extends m{constructor(...t){super(...t);this.navigate=null;this.cacheTransform=!1;this.requestTimeout=3e4;this.showLoadingIndicators=!0;this._activeRequests=[];this._navigationInProgress=!1;this._lastError=null;this._lastNavigationRequestId=null;this._targetNavigation=null;this.addEventListener("qti-request-navigation",async({detail:e})=>{if(!e?.id)return;let s=`nav_${Date.now()}_${Math.random()}`;this._lastNavigationRequestId=s;try{if(this._navigationInProgress=!0,this._lastError=null,this._dispatchStatusEvent({loading:!0,type:e.type,id:e.id}),this._cancelActiveRequests(),this._targetNavigation={type:e.type,id:e.id},e.type==="item"?await this._navigateToItem(e.id):e.type==="section"&&await this._navigateToSection(e.id),this._lastNavigationRequestId!==s){console.log("Navigation was superseded by a newer request");return}}catch(u){if(this._lastNavigationRequestId===s){let a=this._normalizeError(u,e.type,e.id);this._lastError=a,this._dispatchErrorEvent(a),console.error(`Navigation error (${a.type}):`,a.message,a.details)}}finally{this._lastNavigationRequestId===s&&(this._navigationInProgress=!1,this._dispatchStatusEvent({loading:!1,type:e.type,id:e.id}))}}),this.addEventListener("qti-assessment-test-connected",e=>{this._testElement=e.detail,this._initializeNavigation()})}_initializeNavigation(){let t;this.navigate==="section"&&(t=this._testElement.querySelector("qti-assessment-section")?.identifier),this.navigate==="item"&&(t=this.sessionContext.navItemRefId??this._testElement.querySelector("qti-assessment-item-ref")?.identifier),t&&this.dispatchEvent(new CustomEvent("qti-request-navigation",{detail:{type:this.navigate==="section"?"section":"item",id:t},bubbles:!0,composed:!0}))}navigateTo(t,e){e||(t==="section"&&(e=this._testElement?.querySelector("qti-assessment-section")?.identifier),t==="item"&&(e=this._testElement?.querySelector("qti-assessment-item-ref")?.identifier)),this.dispatchEvent(new CustomEvent("qti-request-navigation",{detail:{type:t,id:e},bubbles:!0,composed:!0}))}async _navigateToItem(t){let e=this._testElement?.querySelector(`qti-assessment-item-ref[identifier="${t}"]`);if(!e)throw{type:"item-not-found",message:`Item with identifier "${t}" not found.`,itemId:t};let s=e.closest("qti-test-part")?.identifier,u=e.closest("qti-assessment-section")?.identifier;this.sessionContext={...this.sessionContext,navPartId:s,navSectionId:u,navItemRefId:t,navItemLoading:!0};try{await this._loadItems([t])}finally{this.sessionContext={...this.sessionContext,navItemLoading:!1}}}async _navigateToSection(t){let e=this._testElement?.querySelector(`qti-assessment-section[identifier="${t}"]`);if(!e)throw{type:"section-not-found",message:`Section with identifier "${t}" not found.`,sectionId:t};let s=e.closest("qti-test-part")?.identifier;this.sessionContext={...this.sessionContext,navPartId:s,navSectionId:t,navItemRefId:null,navItemLoading:!0};try{let u=this._getSectionItemIds(t);await this._loadItems(u)}finally{this.sessionContext={...this.sessionContext,navItemLoading:!1}}}_normalizeError(t,e,s){return t&&t.type&&Object.values(M).includes(t.type)?t:t instanceof DOMException&&t.name==="AbortError"?{type:"network-error",message:"Navigation was cancelled because a new navigation was requested.",details:t}:t.name==="TimeoutError"||t.message&&t.message.includes("timeout")?{type:"timeout-error",message:"Request timed out. Please check your network connection.",details:t}:t instanceof TypeError&&t.message.includes("network")?{type:"network-error",message:"A network error occurred. Please check your connection.",details:t}:{type:"load-error",message:`Failed to load ${e}: ${s}`,details:t,itemId:e==="item"?s:void 0,sectionId:e==="section"?s:void 0}}_dispatchErrorEvent(t){this.dispatchEvent(new CustomEvent("qti-navigation-error",{detail:t,bubbles:!0,composed:!0}))}_dispatchStatusEvent(t){this.showLoadingIndicators&&this.dispatchEvent(new CustomEvent("qti-navigation-status",{detail:t,bubbles:!0,composed:!0}))}_cancelActiveRequests(){this._activeRequests.length>0&&(console.info(`Cancelling ${this._activeRequests.length} pending requests`),this._activeRequests.forEach(t=>{t&&t.readyState!==4&&t.abort()}),this._activeRequests=[])}async _loadItems(t){if(!this._testElement||t.length===0)return;let e=t.map(a=>this._testElement.querySelector(`qti-assessment-item-ref[identifier="${a}"]`)),s=e.reduce((a,v,l)=>(v||a.push(t[l]),a),[]);if(s.length>0)throw{type:"item-not-found",message:`One or more items not found: ${s.join(", ")}`,details:{missingItems:s}};this._clearLoadedItems();let u=e.map(async a=>{if(!a)return null;let v=new Promise((l,b)=>{setTimeout(()=>{b({name:"TimeoutError",message:`Request for item ${a.identifier} timed out after ${this.requestTimeout}ms`})},this.requestTimeout)});try{let{promise:l,request:b}=V(this.cacheTransform).load(a.href);b instanceof XMLHttpRequest&&this._activeRequests.push(b);let B=await Promise.race([l,v]);return{itemRef:a,doc:B.htmlDoc(),request:b}}catch(l){if(l instanceof DOMException&&l.name==="AbortError"||l&&l.name==="TimeoutError")return console.log(`Request for item ${a.identifier} was ${l.name==="TimeoutError"?"timed out":"aborted"}`),null;throw l.itemId=a.identifier,l}});try{let v=(await Promise.all(u)).filter(l=>l!==null);if(v.forEach(({itemRef:l,doc:b})=>{l&&b&&(l.xmlDoc=b)}),this._activeRequests=[],requestAnimationFrame(()=>{this.dispatchEvent(new CustomEvent("qti-test-loaded",{detail:v.map(({itemRef:l})=>({identifier:l?.identifier,element:l})),bubbles:!0,composed:!0}))}),v.length===0&&t.length>0)throw{type:"load-error",message:"All item requests failed to load",details:{itemIds:t}};return v}catch(a){throw console.error("Error loading items:",a),a}}_getSectionItemIds(t){if(!this._testElement?.querySelector(`qti-assessment-section[identifier="${t}"]`))throw{type:"section-not-found",message:`Section with identifier "${t}" not found.`,sectionId:t};return Array.from(this._testElement.querySelectorAll(`qti-assessment-section[identifier="${t}"] > qti-assessment-item-ref`)).map(s=>s.identifier)}_clearLoadedItems(){let t=this._testElement?.querySelectorAll("qti-assessment-test qti-assessment-item-ref");Array.from(t||[]).forEach(e=>{e.xmlDoc=null})}retryNavigation(){if(this._lastError){let t=this._lastError.itemId?"item":"section",e=this._lastError.itemId||this._lastError.sectionId;e&&this.dispatchEvent(new CustomEvent("qti-request-navigation",{detail:{type:t,id:e},bubbles:!0,composed:!0}))}else this._targetNavigation&&this.dispatchEvent(new CustomEvent("qti-request-navigation",{detail:this._targetNavigation,bubbles:!0,composed:!0}))}}return i([o({type:String})],c.prototype,"navigate",2),i([o({type:Boolean,attribute:"cache-transform"})],c.prototype,"cacheTransform",2),i([o({type:Number})],c.prototype,"requestTimeout",2),i([o({type:Boolean})],c.prototype,"showLoadingIndicators",2),c};var P=m=>{class c extends m{constructor(...n){super(...n),this.sessionContext={...this.sessionContext,view:"candidate"},this.addEventListener("on-test-switch-view",t=>{this.sessionContext={...this.sessionContext,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(n){super.willUpdate(n),n.has("sessionContext")&&this._updateElementView()}_updateElementView(){if(this._testElement){Array.from(this._testElement.querySelectorAll("[view]")).forEach(s=>{s.classList.toggle("show",s.getAttribute("view")===this.sessionContext.view)});let e=this._testElement.querySelector(`qti-assessment-item-ref[identifier="${this.sessionContext.navItemRefId}"]`)?.assessmentItem;e&&e.showCorrectResponse(this.sessionContext.view==="scorer")}}_setCorrectResponseVisibility(n){n.showCorrectResponse(this.sessionContext.view==="scorer")}}return c};var q=class extends p{constructor(){super();this.testContext=w;this.sessionContext=R;this._updateItemInTestContext=r=>{let n=r._context,t=n.identifier,e=n.variables,s=this.testContext.items.find(u=>u?.identifier===t);if(!s){console.warn(`Item IDs between assessment.xml and item.xml should match: ${t} is not found!`);return}s.variables?.length===1?this._updateItemVariablesInTestContext(t,e):r.variables=[...s.variables||[]]};this.addEventListener("qti-assessment-test-connected",r=>{if(this.testContext=w,this.sessionContext=R,this.testContext&&this.testContext.items.length>0)return;this._testElement=r.detail;let n=Array.from(this._testElement.querySelectorAll("qti-assessment-item-ref")).map(t=>({href:t.href,identifier:t.identifier,category:t.category,variables:[{identifier:"completionStatus",value:"not_attempted",type:"outcome"}]}));this.testContext={...this.testContext,items:n}}),this.addEventListener("qti-assessment-item-connected",r=>{let n=r.detail,t=n.closest("qti-assessment-item-ref")?.identifier;t&&(n.assessmentItemRefId=t),this._updateItemInTestContext(r.detail)}),this.addEventListener("qti-item-context-updated",r=>{this._updateItemVariablesInTestContext(r.detail.itemContext.identifier,r.detail.itemContext.variables)})}updateItemVariables(r,n){let t=this.testContext.items.find(s=>s.identifier===r);t&&(t.variables=t.variables.map(s=>{let u=n.find(a=>a.identifier===s.identifier);return u?{...s,...u}:s}));let e=this._testElement.querySelector(`qti-assessment-item-ref[identifier="${r}"]`);e&&e.assessmentItem&&e.assessmentItem&&(e.assessmentItem.variables=n)}_updateItemVariablesInTestContext(r,n){this.testContext={...this.testContext,items:this.testContext.items.map(t=>t.identifier!==r?t:{...t,variables:n.map(e=>{let s=t.variables.find(u=>u.identifier===e.identifier);return s?{...s,...e}:e})})},this.dispatchEvent(new CustomEvent("qti-test-context-updated",{detail:this.testContext,bubbles:!1,composed:!1}))}};i([o({attribute:!1,type:Object}),I({context:x})],q.prototype,"testContext",2),i([o({attribute:!1,type:Object}),I({context:A})],q.prototype,"sessionContext",2);var $=m=>{class c extends m{constructor(...n){super(...n),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:e,value:s}=t.detail;this.updateOutcomeVariable(e,s),t.stopPropagation()})}outcomeProcessing(){let n=this.querySelector("qti-outcome-processing");return n?(n?.process(),!0):!1}updateOutcomeVariable(n,t){let e=this.getOutcome(n);if(!e){console.warn(`Can not set qti-outcome-identifier: ${n}, it is not available`);return}this.testContext={...this.testContext,testOutcomeVariables:this.testContext.testOutcomeVariables?.map(s=>s.identifier!==n?s:{...s,value:e.cardinality==="single"?t:[...s.value,t]})}}getOutcome(n){return this.getVariable(n)}getVariable(n){return this.testContext.testOutcomeVariables?.find(t=>t.identifier===n)||null}}return c};var T=class extends D(P($(q))){async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new CustomEvent("qti-test-connected",{detail:this}))}render(){return d`<slot></slot>`}};T=i([E("qti-test")],T);var k={fromAttribute(m){return m==="true"},toAttribute(m){return m?"true":"false"}},f=class extends p{constructor(){super(...arguments);this.weigths=new Map}createRenderRoot(){return this}get assessmentItem(){return this.renderRoot?.querySelector("qti-assessment-item")}async connectedCallback(){super.connectedCallback();let r=this.getRootNode().host.closest("qti-test").querySelector("template[item-ref]");r&&(this.myTemplate=L(r)),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 this.myTemplate?this.myTemplate({xmlDoc:this.xmlDoc}):this.xmlDoc}};i([o({type:String})],f.prototype,"category",2),i([o({type:String})],f.prototype,"identifier",2),i([o({type:Boolean,converter:k})],f.prototype,"required",2),i([o({type:Boolean,converter:k})],f.prototype,"fixed",2),i([o({type:String})],f.prototype,"href",2),i([o({type:Object,attribute:!1})],f.prototype,"xmlDoc",2);customElements.get("qti-assessment-item-ref")||customElements.define("qti-assessment-item-ref",f);var O={fromAttribute(m){return m==="true"},toAttribute(m){return m?"true":"false"}},h=class extends p{constructor(){super(...arguments);this._title=""}get title(){return this._title}set title(r){this._title=r,this.removeAttribute("title"),this.setAttribute("data-title",r)}async connectedCallback(){this._title=this.getAttribute("title")||"",super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new Event("qti-assessment-section-connected",{bubbles:!0,composed:!0}))}render(){return d`<slot name="qti-rubric-block"></slot><slot></slot>`}};i([o({type:String})],h.prototype,"identifier",2),i([o({type:String})],h.prototype,"required",2),i([o({type:Boolean,converter:O})],h.prototype,"fixed",2),i([o({type:Boolean,converter:O})],h.prototype,"visible",2),i([o({type:Boolean,converter:O,attribute:"keep-together"})],h.prototype,"keepTogether",2),i([C({context:x,subscribe:!0})],h.prototype,"_testContext",2);customElements.get("qti-assessment-section")||customElements.define("qti-assessment-section",h);var y=class extends p{constructor(){super(...arguments);this._title=""}get title(){return this._title}set title(r){this._title=r,this.removeAttribute("title"),this.setAttribute("data-title",r)}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new CustomEvent("qti-assessment-test-connected",{detail:this,bubbles:!0,composed:!0}))}render(){return d` <slot></slot>`}};i([o({type:String})],y.prototype,"identifier",2),i([o({type:String})],y.prototype,"title",1),i([C({context:x,subscribe:!0})],y.prototype,"_testContext",2),y=i([E("qti-assessment-test")],y);var g=class extends p{constructor(){super(...arguments);this.identifier="";this.class="";this.navigationMode="nonlinear";this.submissionMode="individual";this._title=""}get title(){return this._title}set title(r){this._title=r,this.removeAttribute("title"),this.setAttribute("data-title",r)}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new Event("qti-test-part-connected",{bubbles:!0,composed:!0}))}render(){return d` <slot></slot>`}};i([o({type:String})],g.prototype,"identifier",2),i([o({type:String})],g.prototype,"class",2),i([o({type:String,attribute:"navigation-mode"})],g.prototype,"navigationMode",2),i([o({type:String,attribute:"submission-mode"})],g.prototype,"submissionMode",2),g=i([E("qti-test-part")],g);customElements.get("qti-test-part")||customElements.define("qti-test-part",g);var _=class extends S{render(){return d``}};_.styles=N`
|
|
2
|
+
:host {
|
|
3
|
+
color: gray;
|
|
4
|
+
}
|
|
5
|
+
`,_=i([E("qti-test-feedback")],_);export{T as a,f as b,h as c,y as d,g as e,_ as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s}from"./chunk-DP5FVJRS.js";import{a as l}from"./chunk-P6SSTAJ2.js";import{a as p}from"./chunk-O4RAJ3LM.js";import{d as m,i as a}from"./chunk-HKWYQB5Z.js";import{b as n}from"./chunk-3YQMAZEO.js";import{a as r}from"./chunk-LO2NM3CE.js";var t=class extends a{createRenderRoot(){return this}constructor(){super(),this._internals=this.attachInternals(),this._internals.ariaLabel="pagination"}connectedCallback(){super.connectedCallback();let e=this.querySelector("template");this.myTemplate=s(e)}render(){if(!this.computedContext)return m``;let e=this.computedContext.testParts.flatMap(o=>o.sections);return m` ${e.map(o=>this.myTemplate({item:o}))} `}};r([n({context:l,subscribe:!0})],t.prototype,"computedContext",2),t=r([p("test-section-buttons-stamp")],t);export{t as a};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{f as $,g as U,h as E}from"./chunk-HKWYQB5Z.js";var w=["this"],W=["+","-","!"],F=["=","+","-","*","/","%","^","==","!=",">","<",">=","<=","||","&&","??","&","===","!==","|","|>"],C={"!":0,":":0,",":0,")":0,"]":0,"}":0,"|>":1,"?":2,"??":3,"||":4,"&&":5,"|":6,"^":7,"&":8,"!=":9,"==":9,"!==":9,"===":9,">=":10,">":10,"<=":10,"<":10,"+":11,"-":11,"%":12,"/":12,"*":12,"(":13,"[":13,".":13,"{":13},A=13;var Q=["==","!=","<=",">=","||","&&","??","|>"],J=["===","!=="],n;(function(e){e[e.STRING=1]="STRING",e[e.IDENTIFIER=2]="IDENTIFIER",e[e.DOT=3]="DOT",e[e.COMMA=4]="COMMA",e[e.COLON=5]="COLON",e[e.INTEGER=6]="INTEGER",e[e.DECIMAL=7]="DECIMAL",e[e.OPERATOR=8]="OPERATOR",e[e.GROUPER=9]="GROUPER",e[e.KEYWORD=10]="KEYWORD",e[e.ARROW=11]="ARROW"})(n||(n={}));var v=(e,t,r=0)=>({kind:e,value:t,precedence:r}),Z=e=>e===9||e===10||e===13||e===32,H=e=>e===95||e===36||(e&=-33,65<=e&&e<=90),K=e=>H(e)||x(e),tt=e=>w.indexOf(e)!==-1,et=e=>e===34||e===39,x=e=>48<=e&&e<=57,rt=e=>e===43||e===45||e===42||e===47||e===33||e===38||e===37||e===60||e===61||e===62||e===63||e===94||e===124,st=e=>e===40||e===41||e===91||e===93||e===123||e===125,it=e=>e.replace(/\\(.)/g,(t,r)=>{switch(r){case"n":return`
|
|
2
|
+
`;case"r":return"\r";case"t":return" ";case"b":return"\b";case"f":return"\f";default:return r}}),N=class{#i;#a=-1;#s=0;#e;constructor(t){this.#i=t,this.#t()}nextToken(){for(;Z(this.#e);)this.#t(!0);if(et(this.#e))return this.#u();if(H(this.#e))return this.#l();if(x(this.#e))return this.#c();if(this.#e===46)return this.#o();if(this.#e===44)return this.#p();if(this.#e===58)return this.#h();if(rt(this.#e))return this.#d();if(st(this.#e))return this.#m();if(this.#t(),this.#e!==void 0)throw new Error(`Expected end of input, got ${this.#e}`)}#t(t){this.#a++,this.#a<this.#i.length?(this.#e=this.#i.charCodeAt(this.#a),t===!0&&(this.#s=this.#a)):this.#e=void 0}#r(t=0){let r=this.#i.substring(this.#s,this.#a+t);return t===0&&this.#n(),r}#n(){this.#s=this.#a}#u(){let t="unterminated string",r=this.#e;for(this.#t(!0);this.#e!==r;){if(this.#e===void 0)throw new Error(t);if(this.#e===92&&(this.#t(),this.#e===void 0))throw new Error(t);this.#t()}let s=v(n.STRING,it(this.#r()));return this.#t(),s}#l(){do this.#t();while(K(this.#e));let t=this.#r(),r=tt(t)?n.KEYWORD:n.IDENTIFIER;return v(r,t)}#c(){do this.#t();while(x(this.#e));return this.#e===46?this.#o():v(n.INTEGER,this.#r())}#o(){return this.#t(),x(this.#e)?this.#f():(this.#n(),v(n.DOT,".",A))}#p(){return this.#t(!0),v(n.COMMA,",")}#h(){return this.#t(!0),v(n.COLON,":")}#f(){do this.#t();while(x(this.#e));return v(n.DECIMAL,this.#r())}#d(){this.#t();let t=this.#r(2);if(J.indexOf(t)!==-1)this.#t(),this.#t();else{if(t=this.#r(1),t==="=>")return this.#t(),v(n.ARROW,t);Q.indexOf(t)!==-1&&this.#t()}return t=this.#r(),v(n.OPERATOR,t,C[t])}#m(){let t=String.fromCharCode(this.#e),r=v(n.GROUPER,t,C[t]);return this.#t(!0),r}};var k=(e,t)=>new y(e,t).parse(),y=class{#i;#a;#s;#e;#t;constructor(t,r){this.#a=new N(t),this.#s=r}parse(){return this.#r(),this.#n()}#r(t,r){if(!this._matches(t,r))throw new Error(`Expected kind ${t} (${r}), was ${this.#e?.kind} (${this.#e?.value})`);let s=this.#a.nextToken();this.#e=s,this.#i=s?.kind,this.#t=s?.value}_matches(t,r){return!(t&&this.#i!==t||r&&this.#t!==r)}#n(){if(!this.#e)return this.#s.empty();let t=this.#o();return t===void 0?void 0:this.#u(t,0)}#u(t,r){if(t===void 0)throw new Error("Expected left to be defined.");for(;this.#e;)if(this._matches(n.GROUPER,"(")){let s=this.#E();t=this.#s.invoke(t,void 0,s)}else if(this._matches(n.GROUPER,"[")){let s=this.#g();t=this.#s.index(t,s)}else if(this._matches(n.DOT)){this.#r();let s=this.#o();t=this.#l(t,s)}else{if(this._matches(n.KEYWORD))break;if(this._matches(n.OPERATOR)&&this.#e.precedence>=r)t=this.#t==="?"?this.#p(t):this.#c(t,this.#e);else break}return t}#l(t,r){if(r===void 0)throw new Error("expected identifier");if(r.type==="ID")return this.#s.getter(t,r.value);if(r.type==="Invoke"&&r.receiver.type==="ID"){let s=r.receiver;return this.#s.invoke(t,s.value,r.arguments)}else throw new Error(`expected identifier: ${r}`)}#c(t,r){if(F.indexOf(r.value)===-1)throw new Error(`unknown operator: ${r.value}`);this.#r();let s=this.#o();for(;(this.#i===n.OPERATOR||this.#i===n.DOT||this.#i===n.GROUPER)&&this.#e.precedence>r.precedence;)s=this.#u(s,this.#e.precedence);return this.#s.binary(t,r.value,s)}#o(){if(this._matches(n.OPERATOR)){let t=this.#t;if(this.#r(),t==="+"||t==="-"){if(this._matches(n.INTEGER))return this.#R(t);if(this._matches(n.DECIMAL))return this.#O(t)}if(W.indexOf(t)===-1)throw new Error(`unexpected token: ${t}`);let r=this.#u(this.#h(),A);return this.#s.unary(t,r)}return this.#h()}#p(t){this.#r(n.OPERATOR,"?");let r=this.#n();this.#r(n.COLON);let s=this.#n();return this.#s.ternary(t,r,s)}#h(){switch(this.#i){case n.KEYWORD:let t=this.#t;if(t==="this")return this.#r(),this.#s.id(t);throw w.indexOf(t)!==-1?new Error(`unexpected keyword: ${t}`):new Error(`unrecognized keyword: ${t}`);case n.IDENTIFIER:return this.#m();case n.STRING:return this.#y();case n.INTEGER:return this.#R();case n.DECIMAL:return this.#O();case n.GROUPER:return this.#t==="("?this.#x():this.#t==="{"?this.#d():this.#t==="["?this.#f():void 0;case n.COLON:throw new Error('unexpected token ":"');default:return}}#f(){let t=[];do{if(this.#r(),this._matches(n.GROUPER,"]"))break;t.push(this.#n())}while(this._matches(n.COMMA));return this.#r(n.GROUPER,"]"),this.#s.list(t)}#d(){let t={};do{if(this.#r(),this._matches(n.GROUPER,"}"))break;let r=this.#t;(this._matches(n.STRING)||this._matches(n.IDENTIFIER))&&this.#r(),this.#r(n.COLON),t[r]=this.#n()}while(this._matches(n.COMMA));return this.#r(n.GROUPER,"}"),this.#s.map(t)}#m(){let t=this.#t;if(t==="true")return this.#r(),this.#s.literal(!0);if(t==="false")return this.#r(),this.#s.literal(!1);if(t==="null")return this.#r(),this.#s.literal(null);if(t==="undefined")return this.#r(),this.#s.literal(void 0);let r=this.#v(),s=this.#E();return s?this.#s.invoke(r,void 0,s):r}#v(){if(!this._matches(n.IDENTIFIER))throw new Error(`expected identifier: ${this.#t}`);let t=this.#t;return this.#r(),this.#s.id(t)}#E(){if(!this._matches(n.GROUPER,"("))return;let t=[];do{if(this.#r(),this._matches(n.GROUPER,")"))break;let r=this.#n();t.push(r)}while(this._matches(n.COMMA));return this.#r(n.GROUPER,")"),t}#g(){this.#r();let t=this.#n();return this.#r(n.GROUPER,"]"),t}#x(){let t=this.#E();if(this._matches(n.ARROW)){this.#r();let r=this.#n(),s=t?.map(i=>i.value)??[];return this.#s.arrowFunction(s,r)}else return this.#s.paren(t[0])}#y(){let t=this.#s.literal(this.#t);return this.#r(),t}#R(t=""){let r=this.#s.literal(parseInt(`${t}${this.#t}`,10));return this.#r(),r}#O(t=""){let r=this.#s.literal(parseFloat(`${t}${this.#t}`));return this.#r(),r}};var{hasOwn:B,fromEntries:nt}=Object,at={"+":(e,t)=>e+t,"-":(e,t)=>e-t,"*":(e,t)=>e*t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,"||":(e,t)=>e||t,"&&":(e,t)=>e&&t,"??":(e,t)=>e??t,"|":(e,t)=>t(e),"|>":(e,t)=>t(e)},ot={"+":e=>e,"-":e=>-e,"!":e=>!e},_=class{empty(){return{type:"Empty",evaluate(t){return t},getIds(t){return t}}}literal(t){return{type:"Literal",value:t,evaluate(r){return this.value},getIds(r){return r}}}id(t){return{type:"ID",value:t,evaluate(r){return this.value==="this"?r:r?.[this.value]},getIds(r){return r.push(this.value),r}}}unary(t,r){let s=ot[t];return{type:"Unary",operator:t,child:r,evaluate(i){return s(this.child.evaluate(i))},getIds(i){return this.child.getIds(i)}}}binary(t,r,s){let i=at[r];return{type:"Binary",operator:r,left:t,right:s,evaluate(o){if(this.operator==="="){if(this.left.type!=="ID"&&this.left.type!=="Getter"&&this.left.type!=="Index")throw new Error(`Invalid assignment target: ${this.left}`);let a=this.right.evaluate(o),l,u;return this.left.type==="Getter"?(l=this.left.receiver.evaluate(o),u=this.left.name):this.left.type==="Index"?(l=this.left.receiver.evaluate(o),u=this.left.argument.evaluate(o)):this.left.type==="ID"&&(l=o,u=this.left.value),l===void 0?void 0:l[u]=a}return i(this.left.evaluate(o),this.right.evaluate(o))},getIds(o){return this.left.getIds(o),this.right.getIds(o),o}}}getter(t,r){return{type:"Getter",receiver:t,name:r,evaluate(s){return this.receiver.evaluate(s)?.[this.name]},getIds(s){return this.receiver.getIds(s),s}}}invoke(t,r,s){if(r!=null&&typeof r!="string")throw new Error("method not a string");return{type:"Invoke",receiver:t,method:r,arguments:s,evaluate(i){let o=this.receiver.evaluate(i),a=this.method?o:i?.this??i,l=this.method?o?.[r]:o,c=(this.arguments??[]).map(h=>h?.evaluate(i));return l?.apply?.(a,c)},getIds(i){return this.receiver.getIds(i),this.arguments?.forEach(o=>o?.getIds(i)),i}}}paren(t){return t}index(t,r){return{type:"Index",receiver:t,argument:r,evaluate(s){return this.receiver.evaluate(s)?.[this.argument.evaluate(s)]},getIds(s){return this.receiver.getIds(s),s}}}ternary(t,r,s){return{type:"Ternary",condition:t,trueExpr:r,falseExpr:s,evaluate(i){return this.condition.evaluate(i)?this.trueExpr.evaluate(i):this.falseExpr.evaluate(i)},getIds(i){return this.condition.getIds(i),this.trueExpr.getIds(i),this.falseExpr.getIds(i),i}}}map(t){return{type:"Map",entries:t,evaluate(r){let s={};if(t&&this.entries)for(let i in t){let o=this.entries[i];o&&(s[i]=o.evaluate(r))}return s},getIds(r){if(t&&this.entries)for(let s in t){let i=this.entries[s];i&&i.getIds(r)}return r}}}list(t){return{type:"List",items:t,evaluate(r){return this.items?.map(s=>s?.evaluate(r))},getIds(r){return this.items?.forEach(s=>s?.getIds(r)),r}}}arrowFunction(t,r){return{type:"ArrowFunction",params:t,body:r,evaluate(s){let i=this.params,o=this.body;return function(...a){let l=nt(i.map((c,h)=>[c,a[h]])),u=new Proxy(s??{},{set(c,h,d){return B(l,h)&&(l[h]=d),c[h]=d},get(c,h){return B(l,h)?l[h]:c[h]}});return o.evaluate(u)}},getIds(s){return this.body.getIds(s).filter(i=>!this.params.includes(i))}}}};var D=null,Y={boundAttributeSuffix:E.M,marker:E.P,markerMatch:E.A,HTML_RESULT:E.C,getTemplateHtml:E.L,overrideDirectiveResolve:(e,t)=>class extends e{_$AS(r,s){return t(this,s)}},patchDirectiveResolve:(e,t)=>{if(e.prototype._$AS.name!==t.name){D??=e.prototype._$AS.name;for(let r=e.prototype;r!==Object.prototype;r=Object.getPrototypeOf(r))if(r.hasOwnProperty(D))return void(r[D]=t);throw Error("Internal error: It is possible that both dev mode and production mode Lit was mixed together during SSR. Please comment on the issue: https://github.com/lit/lit/issues/4527")}},setDirectiveClass(e,t){e._$litDirective$=t},getAttributePartCommittedValue:(e,t,r)=>{let s=$;return e.j=i=>s=i,e._$AI(t,e,r),s},connectedDisconnectable:e=>({...e,_$AU:!0}),resolveDirective:E.V,AttributePart:E.H,PropertyPart:E.B,BooleanAttributePart:E.N,EventPart:E.U,ElementPart:E.F,TemplateInstance:E.R,isIterable:E.D,ChildPart:E.I};var{AttributePart:ut,PropertyPart:ht,BooleanAttributePart:lt,EventPart:ct}=Y,M=new _,S=new Map,z=e=>e.replace(/-(-|\w)/g,(t,r)=>r.toUpperCase()),P=(e,t)=>{let r=S.get(e);if(r===void 0){if(S.has(e))return;if(e=e.trim(),e.startsWith("{{")&&e.endsWith("}}")){let s=e.substring(2,e.length-2).trim();r=new y(s,M).parse(),S.set(e,r)}}return r?.evaluate(t)},pt=(e,t,r,s)=>{let i=e.getAttribute("if");if(i!==null&&P(i,t))return b(e,t,r,s)},V=/(?<!\\){{(.*?)(?:(?<!\\)}})/g,j=e=>/(?:\\{{)|(?:\\}})/g.test(e),I=e=>e.replaceAll(/\\{{/g,"{{").replace(/\\}}/g,"}}"),ft=(e,t,r,s)=>{let i=e.getAttribute("repeat");if(i!==null){let o=P(i,t);if(!o[Symbol.iterator])return U;let a=T(e),l=-1,u=[];for(let c of o){l++;let h=Object.create(t);h.item=c,h.index=l,h.this=t.this??t;let d=[];for(let m of a.parts){let f=m.update(h,r,s);m.type===1?d.push(...f):d.push(f)}let p={_$litType$:a,values:d};u.push(p)}return u}},q={if:pt,repeat:ft},St=(e,t=q,r={},s)=>{let o=T(e).renderers;if(s){let l=T(s).renderers,u=o.super;u!==void 0?r={...o,...r,super:(c,h,d)=>(d={...l,...d,super:(p,m,f)=>b(s,p,m,f)},u(c,h,d))}:(r={...l,...o,...r},e=s)}else r={...o,...r};return a=>b(e,a,t,r)};var b=(e,t,r=q,s={})=>{let i=T(e),o=[];for(let l of i.parts){let u=l.update(t,r,s);l.type===1?o.push(...u):o.push(u)}return{_$litType$:i,values:o}},X=new Map,T=e=>{let t=X.get(e);return t===void 0&&X.set(e,t=dt(e)),t},dt=e=>{let t={h:void 0,el:e.cloneNode(!0),parts:[],renderers:{}},r=document.createTreeWalker(t.el.content,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT),s=r.currentNode,i=-1,o=[];for(;(s=r.nextNode())!==null;)if(s.nodeType===Node.COMMENT_NODE)i++;else if(s.nodeType===Node.ELEMENT_NODE){i++;let a=s;if(a.tagName==="TEMPLATE"){let u=a.getAttribute("type"),c=a.getAttribute("name"),h=a.getAttribute("call");if(h!==null||u!==null||c!==null){a.parentNode.insertBefore(document.createComment(""),a),o.push(a);let d;if(h!==null){let p=h.trim(),m=p.startsWith("{{")&&p.endsWith("}}");d=(f,O,R)=>{let g=a.getAttribute("data"),G=g===null?void 0:P(g,f);return(m?P(p,f):R[h])?.(G,O,R)}}else u!==null?d=(p,m,f)=>{let O=m[u];return O?.(a,p,m,f)}:(c==="super"?t.renderers.super=(p,m,f)=>{let O=f.super,R=T(a);return f={...f,...R.renderers},O(p,m,f)}:t.renderers[c]=(p,m,f)=>b(a,p,m,f),d=(p,m,f)=>{let O=f[c];return O?.(p,m,f)});t.parts.push({type:2,index:i,update:d});continue}}let l=a.getAttributeNames();for(let u of l){let c=a.getAttribute(u),h=c.split(V);if(h.length===1){j(c)&&a.setAttribute(u,I(c));continue}a.removeAttribute(u);let d=u,p=ut,m=u[0];m==="."?(d=z(u.substring(1)),p=ht):m==="?"?(d=u.substring(1),p=lt):m==="@"&&(d=z(u.substring(1)),p=ct);let f=[I(h[0])],O=[];for(let R=1;R<h.length;R+=2){let g=h[R];O.push(k(g,M)),f.push(I(h[R+1]))}t.parts.push({type:1,index:i,name:d,strings:f,ctor:p,update:(R,g,G)=>O.map(L=>L.evaluate(R))})}}else if(s.nodeType===Node.TEXT_NODE){let a=s,l=a.textContent,u=l.split(V);u.length>1?a.textContent=I(u[0]):j(l)&&(a.textContent=I(l));for(let c=1;c<u.length;c+=2){let h=u[c],d=k(h,M);t.parts.push({type:2,index:++i,update:(m,f)=>d.evaluate(m)});let p=new Text(u[c+1].replace("\\{{","{{"));a.parentNode.insertBefore(p,a.nextSibling),a.parentNode.insertBefore(document.createComment(""),a.nextSibling),a=p,r.currentNode=p}}for(let a of o)a.remove();return t};export{St as a};
|
|
3
|
+
/*! Bundled license information:
|
|
4
|
+
|
|
5
|
+
@heximal/expressions/lib/constants.js:
|
|
6
|
+
@heximal/expressions/lib/tokenizer.js:
|
|
7
|
+
@heximal/expressions/lib/parser.js:
|
|
8
|
+
@heximal/expressions/lib/ast_factory.js:
|
|
9
|
+
@heximal/expressions/lib/eval.js:
|
|
10
|
+
(*
|
|
11
|
+
* @license
|
|
12
|
+
* Portions Copyright (c) 2013, the Dart project authors.
|
|
13
|
+
*)
|
|
14
|
+
|
|
15
|
+
lit-html/node/private-ssr-support.js:
|
|
16
|
+
(**
|
|
17
|
+
* @license
|
|
18
|
+
* Copyright 2019 Google LLC
|
|
19
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
20
|
+
*)
|
|
21
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as A}from"./chunk-XJ2CFTZP.js";import{b as T}from"./chunk-CZDMOYYF.js";import{b as g}from"./chunk-QQR6POPY.js";import{a as R}from"./chunk-P6SSTAJ2.js";import{a as S,b as q,c as f}from"./chunk-HO6JOQX4.js";import{d as b,i as y}from"./chunk-FLQBFTRW.js";import{a as _}from"./chunk-7ME56ODO.js";import{a as h,b as I}from"./chunk-3YQMAZEO.js";import{a as d}from"./chunk-LO2NM3CE.js";var c=class extends y{constructor(){super();this.identifier=void 0;this.initContext=[];this.qtiContext={QTI_CONTEXT:{testIdentifier:"",candidateIdentifier:"",environmentIdentifier:"default"}};this.configContext={};this.autoScoreItems=!1;this.addEventListener("qti-assessment-test-connected",this._handleTestConnected.bind(this)),this.addEventListener("qti-assessment-item-connected",this._handleItemConnected.bind(this)),this.addEventListener("qti-interaction-changed",this._handleInteractionChanged.bind(this)),this.addEventListener("test-end-attempt",this._handleTestEndAttempt.bind(this)),this.addEventListener("test-show-correct-response",this._handleTestShowCorrectResponse.bind(this)),this.addEventListener("test-show-candidate-correction",this._handleTestShowCandidateCorrection.bind(this)),this.addEventListener("test-update-outcome-variable",this._handleTestUpdateOutcomeVariable.bind(this))}_handleTestEndAttempt(o){let s=this._testElement.querySelector(`qti-assessment-item-ref[identifier="${this._sessionContext.navItemRefId}"]`).assessmentItem,t=this.configContext?.reportValidityAfterScoring===!0;s.processResponse(!0,t)}_handleTestShowCorrectResponse(o){let s=this._testElement.querySelector(`qti-assessment-item-ref[identifier="${this._sessionContext.navItemRefId}"]`).assessmentItem;s&&s.showCorrectResponse(o.detail)}_handleTestShowCandidateCorrection(o){this._testElement.querySelector(`qti-assessment-item-ref[identifier="${this._sessionContext.navItemRefId}"]`).assessmentItem.showCandidateCorrection(o.detail)}_handleTestUpdateOutcomeVariable(o){this._testElement.querySelector(`qti-assessment-item-ref[identifier="${o.detail.assessmentItemRefId}"]`).assessmentItem.setOutcomeVariable(o.detail.outcomeVariableId,o.detail.value)}_handleInteractionChanged(o){if(this.autoScoreItems){let e=o.composedPath()[0].closest("qti-assessment-item"),s=e.variables.find(t=>t.identifier==="SCORE");if(s&&s.externalScored===null&&e.adaptive==="false"){let t=this.configContext?.reportValidityAfterScoring===!0;e.processResponse(!0,t)}}}render(){return b`<slot></slot>`}_handleTestConnected(o){if(this._testElement=o.detail,!this.qtiContext.QTI_CONTEXT?.testIdentifier){let t=this.qtiContext.QTI_CONTEXT||{testIdentifier:"",candidateIdentifier:"not set",environmentIdentifier:"default"};this.qtiContext={QTI_CONTEXT:{...t,testIdentifier:this._testElement.identifier,environmentIdentifier:t.environmentIdentifier||"default"}}}this._testElement.querySelectorAll('qti-context-declaration[identifier="QTI_CONTEXT"]').forEach(t=>{let i=this._extractDefaultValues(t);Object.keys(i).length>0&&(this.qtiContext={QTI_CONTEXT:{...i,...this.qtiContext.QTI_CONTEXT}})});let s=Array.from(this._testElement?.querySelectorAll("qti-test-part")||[]);this.computedContext={identifier:this._testElement.identifier,title:this._testElement.title,view:this._sessionContext?.view,testParts:s.map(t=>{let i=[...t.querySelectorAll("qti-assessment-section")];return{active:!1,identifier:t.identifier,navigationMode:t.navigationMode,submissionMode:t.submissionMode,sections:i.map(r=>{let m=[...r.querySelectorAll("qti-assessment-item-ref")];return{active:!1,identifier:r.identifier,title:r.title,items:m.map(n=>({...this.initContext?.find(l=>l.identifier===n.identifier),active:!1,identifier:n.identifier,categories:n.category?n.category?.split(" "):[],href:n.href,variables:[]}))}})}})}}_extractDefaultValues(o){let e={},s=o.querySelector("qti-default-value");return s&&s.querySelectorAll("qti-value[field-identifier]").forEach(i=>{let r=i.getAttribute("field-identifier"),m=i.getAttribute("base-type")||"string",n=i.textContent?.trim()||"";if(r){let l=n;switch(m){case"integer":l=parseInt(n,10);break;case"float":case"duration":l=parseFloat(n);break;case"boolean":l=n.toLowerCase()==="true";break;case"string":default:l=n;break}e[r]=l}}),e}_handleItemConnected(o){let e=o.detail;this.computedContext={...this.computedContext,testParts:this.computedContext.testParts.map(s=>({...s,sections:s.sections.map(t=>({...t,items:t.items.map(i=>{if(i.identifier!==e.parentElement.getAttribute("identifier"))return i;let m=e.querySelector("qti-outcome-declaration[identifier='SCORE']")?.getAttribute("externalScored"),n=e.querySelectorAll("qti-response-declaration"),l=Array.from(n).some(p=>p.querySelector("qti-correct-response")),C=Array.from(n).some(p=>{let v=p.querySelector("qti-mapping"),u=p.querySelector("qti-area-mapping");return v?.querySelector("qti-map-entry")||u?.querySelector("qti-area-map-entry")}),x=l||C,E=!!e.querySelector("qti-response-processing");return{...i,assessmentItemIdentifier:e.getAttribute("identifier"),label:e.getAttribute("label"),title:e.title,externalScored:m,adaptive:e.adaptive=="true"||!1,timeDependent:e.timeDependent=="true"||!1,variables:e.variables,hasCorrectResponse:x,hasResponseProcessing:E}})}))}))}}willUpdate(o){if(!this.computedContext)return;let e=1;this.computedContext={...this.computedContext,view:this._sessionContext?.view,testParts:this.computedContext.testParts.map(s=>({...s,active:this._sessionContext?.navPartId===s.identifier||!1,sections:s.sections.map(t=>({...t,active:this._sessionContext?.navSectionId===t.identifier||!1,completed:t.items.every(i=>this._testContext.items.find(r=>r.identifier===i.identifier)?.variables.find(r=>r.identifier==="completionStatus").value==="completed"),items:t.items.map(i=>{let r=this._testContext?.items.find(a=>a.identifier===i.identifier),m={...i,...r,...this.initContext?.find(a=>a.identifier===i.identifier)},n=m.variables?.find(a=>a.identifier=="SCORE")?.value,l=n==null?null:parseFloat(n?.toString()),C=m.variables?.find(a=>a.identifier==="completionStatus")?.value,x=m.variables?.find(a=>a.identifier==="RESPONSE")?.value||"",E=m.variables?.find(a=>a.identifier==="numAttempts")?.value||0,p=this._sessionContext?.navItemRefId===m.identifier||!1,v=i.categories.includes(this.configContext?.infoItemCategory)?null:e++,u=i.variables?.find(a=>a.identifier=="MAXSCORE")?.value,Q=u==null?null:parseFloat(u?.toString());return{...m,completionStatus:C,numAttempts:E,score:l,response:x,index:v,active:p,maxScore:Q}})}))}))},this.dispatchEvent(new CustomEvent("qti-computed-context-updated",{detail:this.computedContext,bubbles:!0}))}};d([q({type:String})],c.prototype,"identifier",2),d([f()],c.prototype,"initContext",2),d([f(),h({context:A})],c.prototype,"qtiContext",2),d([f(),h({context:_})],c.prototype,"configContext",2),d([f(),I({context:g,subscribe:!0})],c.prototype,"_testContext",2),d([f(),I({context:T,subscribe:!0})],c.prototype,"_sessionContext",2),d([f(),h({context:R})],c.prototype,"computedContext",2),d([q({type:Boolean,attribute:"auto-score-items"})],c.prototype,"autoScoreItems",2),c=d([S("test-navigation")],c);export{c as a};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{g as S}from"./chunk-ZO5G6CHW.js";import{a as L}from"./chunk-PQLJWD6V.js";import{a as V}from"./chunk-E6IOJ4MV.js";import{a as R,b as A}from"./chunk-CZDMOYYF.js";import{a as w,b as x}from"./chunk-QQR6POPY.js";import{a as E,b as o}from"./chunk-HO6JOQX4.js";import{a as N,d,i as p}from"./chunk-FLQBFTRW.js";import{a as I,b as C}from"./chunk-3YQMAZEO.js";import{a as i}from"./chunk-LO2NM3CE.js";var M=(e=>(e.ITEM_NOT_FOUND="item-not-found",e.SECTION_NOT_FOUND="section-not-found",e.LOAD_ERROR="load-error",e.NETWORK_ERROR="network-error",e.TIMEOUT_ERROR="timeout-error",e))(M||{}),D=m=>{class c extends m{constructor(...t){super(...t);this.navigate=null;this.cacheTransform=!1;this.requestTimeout=3e4;this.showLoadingIndicators=!0;this._activeRequests=[];this._navigationInProgress=!1;this._lastError=null;this._lastNavigationRequestId=null;this._targetNavigation=null;this.addEventListener("qti-request-navigation",async({detail:e})=>{if(!e?.id)return;let s=`nav_${Date.now()}_${Math.random()}`;this._lastNavigationRequestId=s;try{if(this._navigationInProgress=!0,this._lastError=null,this._dispatchStatusEvent({loading:!0,type:e.type,id:e.id}),this._cancelActiveRequests(),this._targetNavigation={type:e.type,id:e.id},e.type==="item"?await this._navigateToItem(e.id):e.type==="section"&&await this._navigateToSection(e.id),this._lastNavigationRequestId!==s){console.log("Navigation was superseded by a newer request");return}}catch(u){if(this._lastNavigationRequestId===s){let a=this._normalizeError(u,e.type,e.id);this._lastError=a,this._dispatchErrorEvent(a),console.error(`Navigation error (${a.type}):`,a.message,a.details)}}finally{this._lastNavigationRequestId===s&&(this._navigationInProgress=!1,this._dispatchStatusEvent({loading:!1,type:e.type,id:e.id}))}}),this.addEventListener("qti-assessment-test-connected",e=>{this._testElement=e.detail,this._initializeNavigation()})}_initializeNavigation(){let t;this.navigate==="section"&&(t=this._testElement.querySelector("qti-assessment-section")?.identifier),this.navigate==="item"&&(t=this.sessionContext.navItemRefId??this._testElement.querySelector("qti-assessment-item-ref")?.identifier),t&&this.dispatchEvent(new CustomEvent("qti-request-navigation",{detail:{type:this.navigate==="section"?"section":"item",id:t},bubbles:!0,composed:!0}))}navigateTo(t,e){e||(t==="section"&&(e=this._testElement?.querySelector("qti-assessment-section")?.identifier),t==="item"&&(e=this._testElement?.querySelector("qti-assessment-item-ref")?.identifier)),this.dispatchEvent(new CustomEvent("qti-request-navigation",{detail:{type:t,id:e},bubbles:!0,composed:!0}))}async _navigateToItem(t){let e=this._testElement?.querySelector(`qti-assessment-item-ref[identifier="${t}"]`);if(!e)throw{type:"item-not-found",message:`Item with identifier "${t}" not found.`,itemId:t};let s=e.closest("qti-test-part")?.identifier,u=e.closest("qti-assessment-section")?.identifier;this.sessionContext={...this.sessionContext,navPartId:s,navSectionId:u,navItemRefId:t,navItemLoading:!0};try{await this._loadItems([t])}finally{this.sessionContext={...this.sessionContext,navItemLoading:!1}}}async _navigateToSection(t){let e=this._testElement?.querySelector(`qti-assessment-section[identifier="${t}"]`);if(!e)throw{type:"section-not-found",message:`Section with identifier "${t}" not found.`,sectionId:t};let s=e.closest("qti-test-part")?.identifier;this.sessionContext={...this.sessionContext,navPartId:s,navSectionId:t,navItemRefId:null,navItemLoading:!0};try{let u=this._getSectionItemIds(t);await this._loadItems(u)}finally{this.sessionContext={...this.sessionContext,navItemLoading:!1}}}_normalizeError(t,e,s){return t&&t.type&&Object.values(M).includes(t.type)?t:t instanceof DOMException&&t.name==="AbortError"?{type:"network-error",message:"Navigation was cancelled because a new navigation was requested.",details:t}:t.name==="TimeoutError"||t.message&&t.message.includes("timeout")?{type:"timeout-error",message:"Request timed out. Please check your network connection.",details:t}:t instanceof TypeError&&t.message.includes("network")?{type:"network-error",message:"A network error occurred. Please check your connection.",details:t}:{type:"load-error",message:`Failed to load ${e}: ${s}`,details:t,itemId:e==="item"?s:void 0,sectionId:e==="section"?s:void 0}}_dispatchErrorEvent(t){this.dispatchEvent(new CustomEvent("qti-navigation-error",{detail:t,bubbles:!0,composed:!0}))}_dispatchStatusEvent(t){this.showLoadingIndicators&&this.dispatchEvent(new CustomEvent("qti-navigation-status",{detail:t,bubbles:!0,composed:!0}))}_cancelActiveRequests(){this._activeRequests.length>0&&(console.info(`Cancelling ${this._activeRequests.length} pending requests`),this._activeRequests.forEach(t=>{t&&t.readyState!==4&&t.abort()}),this._activeRequests=[])}async _loadItems(t){if(!this._testElement||t.length===0)return;let e=t.map(a=>this._testElement.querySelector(`qti-assessment-item-ref[identifier="${a}"]`)),s=e.reduce((a,v,l)=>(v||a.push(t[l]),a),[]);if(s.length>0)throw{type:"item-not-found",message:`One or more items not found: ${s.join(", ")}`,details:{missingItems:s}};this._clearLoadedItems();let u=e.map(async a=>{if(!a)return null;let v=new Promise((l,b)=>{setTimeout(()=>{b({name:"TimeoutError",message:`Request for item ${a.identifier} timed out after ${this.requestTimeout}ms`})},this.requestTimeout)});try{let{promise:l,request:b}=V(this.cacheTransform).load(a.href);b instanceof XMLHttpRequest&&this._activeRequests.push(b);let B=await Promise.race([l,v]);return{itemRef:a,doc:B.htmlDoc(),request:b}}catch(l){if(l instanceof DOMException&&l.name==="AbortError"||l&&l.name==="TimeoutError")return console.log(`Request for item ${a.identifier} was ${l.name==="TimeoutError"?"timed out":"aborted"}`),null;throw l.itemId=a.identifier,l}});try{let v=(await Promise.all(u)).filter(l=>l!==null);if(v.forEach(({itemRef:l,doc:b})=>{l&&b&&(l.xmlDoc=b)}),this._activeRequests=[],requestAnimationFrame(()=>{this.dispatchEvent(new CustomEvent("qti-test-loaded",{detail:v.map(({itemRef:l})=>({identifier:l?.identifier,element:l})),bubbles:!0,composed:!0}))}),v.length===0&&t.length>0)throw{type:"load-error",message:"All item requests failed to load",details:{itemIds:t}};return v}catch(a){throw console.error("Error loading items:",a),a}}_getSectionItemIds(t){if(!this._testElement?.querySelector(`qti-assessment-section[identifier="${t}"]`))throw{type:"section-not-found",message:`Section with identifier "${t}" not found.`,sectionId:t};return Array.from(this._testElement.querySelectorAll(`qti-assessment-section[identifier="${t}"] > qti-assessment-item-ref`)).map(s=>s.identifier)}_clearLoadedItems(){let t=this._testElement?.querySelectorAll("qti-assessment-test qti-assessment-item-ref");Array.from(t||[]).forEach(e=>{e.xmlDoc=null})}retryNavigation(){if(this._lastError){let t=this._lastError.itemId?"item":"section",e=this._lastError.itemId||this._lastError.sectionId;e&&this.dispatchEvent(new CustomEvent("qti-request-navigation",{detail:{type:t,id:e},bubbles:!0,composed:!0}))}else this._targetNavigation&&this.dispatchEvent(new CustomEvent("qti-request-navigation",{detail:this._targetNavigation,bubbles:!0,composed:!0}))}}return i([o({type:String})],c.prototype,"navigate",2),i([o({type:Boolean,attribute:"cache-transform"})],c.prototype,"cacheTransform",2),i([o({type:Number})],c.prototype,"requestTimeout",2),i([o({type:Boolean})],c.prototype,"showLoadingIndicators",2),c};var P=m=>{class c extends m{constructor(...n){super(...n),this.sessionContext={...this.sessionContext,view:"candidate"},this.addEventListener("on-test-switch-view",t=>{this.sessionContext={...this.sessionContext,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(n){super.willUpdate(n),n.has("sessionContext")&&this._updateElementView()}_updateElementView(){if(this._testElement){Array.from(this._testElement.querySelectorAll("[view]")).forEach(s=>{s.classList.toggle("show",s.getAttribute("view")===this.sessionContext.view)});let e=this._testElement.querySelector(`qti-assessment-item-ref[identifier="${this.sessionContext.navItemRefId}"]`)?.assessmentItem;e&&e.showCorrectResponse(this.sessionContext.view==="scorer")}}_setCorrectResponseVisibility(n){n.showCorrectResponse(this.sessionContext.view==="scorer")}}return c};var q=class extends p{constructor(){super();this.testContext=w;this.sessionContext=R;this._updateItemInTestContext=r=>{let n=r._context,t=n.identifier,e=n.variables,s=this.testContext.items.find(u=>u?.identifier===t);if(!s){console.warn(`Item IDs between assessment.xml and item.xml should match: ${t} is not found!`);return}s.variables?.length===1?this._updateItemVariablesInTestContext(t,e):r.variables=[...s.variables||[]]};this.addEventListener("qti-assessment-test-connected",r=>{if(this.testContext=w,this.sessionContext=R,this.testContext&&this.testContext.items.length>0)return;this._testElement=r.detail;let n=Array.from(this._testElement.querySelectorAll("qti-assessment-item-ref")).map(t=>({href:t.href,identifier:t.identifier,category:t.category,variables:[{identifier:"completionStatus",value:"not_attempted",type:"outcome"}]}));this.testContext={...this.testContext,items:n}}),this.addEventListener("qti-assessment-item-connected",r=>{let n=r.detail,t=n.closest("qti-assessment-item-ref")?.identifier;t&&(n.assessmentItemRefId=t),this._updateItemInTestContext(r.detail)}),this.addEventListener("qti-item-context-updated",r=>{this._updateItemVariablesInTestContext(r.detail.itemContext.identifier,r.detail.itemContext.variables)})}updateItemVariables(r,n){let t=this.testContext.items.find(s=>s.identifier===r);t&&(t.variables=t.variables.map(s=>{let u=n.find(a=>a.identifier===s.identifier);return u?{...s,...u}:s}));let e=this._testElement.querySelector(`qti-assessment-item-ref[identifier="${r}"]`);e&&e.assessmentItem&&e.assessmentItem&&(e.assessmentItem.variables=n)}_updateItemVariablesInTestContext(r,n){this.testContext={...this.testContext,items:this.testContext.items.map(t=>t.identifier!==r?t:{...t,variables:n.map(e=>{let s=t.variables.find(u=>u.identifier===e.identifier);return s?{...s,...e}:e})})},this.dispatchEvent(new CustomEvent("qti-test-context-updated",{detail:this.testContext,bubbles:!1,composed:!1}))}};i([o({attribute:!1,type:Object}),I({context:x})],q.prototype,"testContext",2),i([o({attribute:!1,type:Object}),I({context:A})],q.prototype,"sessionContext",2);var $=m=>{class c extends m{constructor(...n){super(...n),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:e,value:s}=t.detail;this.updateOutcomeVariable(e,s),t.stopPropagation()})}outcomeProcessing(){let n=this.querySelector("qti-outcome-processing");return n?(n?.process(),!0):!1}updateOutcomeVariable(n,t){let e=this.getOutcome(n);if(!e){console.warn(`Can not set qti-outcome-identifier: ${n}, it is not available`);return}this.testContext={...this.testContext,testOutcomeVariables:this.testContext.testOutcomeVariables?.map(s=>s.identifier!==n?s:{...s,value:e.cardinality==="single"?t:[...s.value,t]})}}getOutcome(n){return this.getVariable(n)}getVariable(n){return this.testContext.testOutcomeVariables?.find(t=>t.identifier===n)||null}}return c};var T=class extends D(P($(q))){async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new CustomEvent("qti-test-connected",{detail:this}))}render(){return d`<slot></slot>`}};T=i([E("qti-test")],T);var k={fromAttribute(m){return m==="true"},toAttribute(m){return m?"true":"false"}},f=class extends p{constructor(){super(...arguments);this.weigths=new Map}createRenderRoot(){return this}get assessmentItem(){return this.renderRoot?.querySelector("qti-assessment-item")}async connectedCallback(){super.connectedCallback();let r=this.getRootNode().host.closest("qti-test").querySelector("template[item-ref]");r&&(this.myTemplate=L(r)),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 this.myTemplate?this.myTemplate({xmlDoc:this.xmlDoc}):this.xmlDoc}};i([o({type:String})],f.prototype,"category",2),i([o({type:String})],f.prototype,"identifier",2),i([o({type:Boolean,converter:k})],f.prototype,"required",2),i([o({type:Boolean,converter:k})],f.prototype,"fixed",2),i([o({type:String})],f.prototype,"href",2),i([o({type:Object,attribute:!1})],f.prototype,"xmlDoc",2);customElements.get("qti-assessment-item-ref")||customElements.define("qti-assessment-item-ref",f);var O={fromAttribute(m){return m==="true"},toAttribute(m){return m?"true":"false"}},h=class extends p{constructor(){super(...arguments);this._title=""}get title(){return this._title}set title(r){this._title=r,this.removeAttribute("title"),this.setAttribute("data-title",r)}async connectedCallback(){this._title=this.getAttribute("title")||"",super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new Event("qti-assessment-section-connected",{bubbles:!0,composed:!0}))}render(){return d`<slot name="qti-rubric-block"></slot><slot></slot>`}};i([o({type:String})],h.prototype,"identifier",2),i([o({type:String})],h.prototype,"required",2),i([o({type:Boolean,converter:O})],h.prototype,"fixed",2),i([o({type:Boolean,converter:O})],h.prototype,"visible",2),i([o({type:Boolean,converter:O,attribute:"keep-together"})],h.prototype,"keepTogether",2),i([C({context:x,subscribe:!0})],h.prototype,"_testContext",2);customElements.get("qti-assessment-section")||customElements.define("qti-assessment-section",h);var y=class extends p{constructor(){super(...arguments);this._title=""}get title(){return this._title}set title(r){this._title=r,this.removeAttribute("title"),this.setAttribute("data-title",r)}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new CustomEvent("qti-assessment-test-connected",{detail:this,bubbles:!0,composed:!0}))}render(){return d` <slot></slot>`}};i([o({type:String})],y.prototype,"identifier",2),i([o({type:String})],y.prototype,"title",1),i([C({context:x,subscribe:!0})],y.prototype,"_testContext",2),y=i([E("qti-assessment-test")],y);var g=class extends p{constructor(){super(...arguments);this.identifier="";this.class="";this.navigationMode="nonlinear";this.submissionMode="individual";this._title=""}get title(){return this._title}set title(r){this._title=r,this.removeAttribute("title"),this.setAttribute("data-title",r)}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.dispatchEvent(new Event("qti-test-part-connected",{bubbles:!0,composed:!0}))}render(){return d` <slot></slot>`}};i([o({type:String})],g.prototype,"identifier",2),i([o({type:String})],g.prototype,"class",2),i([o({type:String,attribute:"navigation-mode"})],g.prototype,"navigationMode",2),i([o({type:String,attribute:"submission-mode"})],g.prototype,"submissionMode",2),g=i([E("qti-test-part")],g);customElements.get("qti-test-part")||customElements.define("qti-test-part",g);var _=class extends S{render(){return d``}};_.styles=N`
|
|
2
|
+
:host {
|
|
3
|
+
color: gray;
|
|
4
|
+
}
|
|
5
|
+
`,_=i([E("qti-test-feedback")],_);export{T as a,f as b,h as c,y as d,g as e,_ as f};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{b as u,c as h}from"./chunk-3CVBBZDT.js";import{a as p}from"./chunk-XUJ7TXHW.js";import{a,b as l}from"./chunk-O4RAJ3LM.js";import{a as m,d as r,i as d}from"./chunk-HKWYQB5Z.js";import{a as c}from"./chunk-P6SSTAJ2.js";import{b as n}from"./chunk-3YQMAZEO.js";import{a as s}from"./chunk-LO2NM3CE.js";var t=class extends d{constructor(){super();this._internalDisabled=!0;this.addEventListener("click",e=>{e.preventDefault(),this._internalDisabled||this._requestItem(this.sectionItems[this.itemIndex-1].identifier)})}_handleTestElementChange(e,o){o&&(this._internalDisabled=!1)}willUpdate(e){if(!this.computedContext)return;let o=this.computedContext?.testParts.find(i=>i.active);o&&(this.sectionItems=o.sections.flatMap(i=>i.items),this.itemIndex=this.sectionItems.findIndex(i=>i.active),this.checkDisabled())}checkDisabled(){this._internalDisabled=!this.computedContext||this.itemIndex===0||this.itemIndex===-1}_requestItem(e){this.dispatchEvent(new CustomEvent("qti-request-navigation",{composed:!0,bubbles:!0,detail:{type:"item",id:e}}))}render(){return r`<slot></slot>`}};t.styles=m`
|
|
2
|
+
:host {
|
|
3
|
+
${u};
|
|
4
|
+
}
|
|
5
|
+
:host([disabled]) {
|
|
6
|
+
${h};
|
|
7
|
+
}
|
|
8
|
+
`,s([l({type:Boolean,reflect:!0,attribute:"disabled"})],t.prototype,"_internalDisabled",2),s([n({context:c,subscribe:!0})],t.prototype,"computedContext",2),s([p("computedContext")],t.prototype,"_handleTestElementChange",1),t=s([a("test-prev")],t);export{t as a};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{b as h,c as u}from"./chunk-KASON6Y7.js";import{a as m,b as s}from"./chunk-HO6JOQX4.js";import{a as p,d as c,i as l}from"./chunk-FLQBFTRW.js";import{a as d}from"./chunk-P6SSTAJ2.js";import{b as a}from"./chunk-3YQMAZEO.js";import{a as e}from"./chunk-LO2NM3CE.js";var t=class extends l{constructor(){super(...arguments);this.shown=!1;this.disabled=!1;this.showCorrectText="Show correct response";this.hideCorrectText="Hide correct response";this.noCorrectResponseText="No correct response specified"}willUpdate(b){let i=this.computedContext?.testParts.flatMap(r=>r.sections.flatMap(n=>n.items)).find(r=>r.active);if(this._previousActiveItem!==i&&(this.shown=!1,this._previousActiveItem=i),i){let r=!!i?.variables?.some(o=>o.correctResponse),n=!!i?.variables?.some(o=>o.mapping?.mapEntries?.length>0||o.areaMapping?.areaMapEntries?.length>0);this.disabled=!r&&!n}else this.disabled=!0}_toggleState(){this.disabled||(this.shown=!this.shown,this.dispatchEvent(new CustomEvent("test-show-correct-response",{detail:this.shown,bubbles:!0})))}_getDisplayedText(){return this.disabled?this.noCorrectResponseText:this.shown?this.hideCorrectText:this.showCorrectText}render(){return c` <div @click="${this._toggleState}">${this._getDisplayedText()}</div> `}};t.styles=p`
|
|
2
|
+
:host {
|
|
3
|
+
${h};
|
|
4
|
+
}
|
|
5
|
+
:host([disabled]) {
|
|
6
|
+
${u};
|
|
7
|
+
}
|
|
8
|
+
`,e([a({context:d,subscribe:!0})],t.prototype,"computedContext",2),e([s({type:Boolean,reflect:!0})],t.prototype,"shown",2),e([s({type:Boolean,reflect:!0})],t.prototype,"disabled",2),e([s({type:String})],t.prototype,"showCorrectText",2),e([s({type:String})],t.prototype,"hideCorrectText",2),e([s({type:String})],t.prototype,"noCorrectResponseText",2),t=e([m("test-show-correct-response")],t);export{t as a};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{b as u,c as h}from"./chunk-KASON6Y7.js";import{a as c}from"./chunk-XUJ7TXHW.js";import{a as l,b as d}from"./chunk-HO6JOQX4.js";import{a as r,d as a,i as m}from"./chunk-FLQBFTRW.js";import{a as p}from"./chunk-P6SSTAJ2.js";import{b as o}from"./chunk-3YQMAZEO.js";import{a as s}from"./chunk-LO2NM3CE.js";var t=class extends m{constructor(){super();this._internalDisabled=!0;this._internals=this.attachInternals(),this._internals.role="button",this._internals.ariaLabel="Next item",this.addEventListener("click",e=>{e.preventDefault(),this._internalDisabled||this._requestItem(this.sectionItems[this.itemIndex+1].identifier)})}_handleTestElementChange(e,n){n&&(this._internalDisabled=!1)}connectedCallback(){super.connectedCallback(),this.checkDisabled()}willUpdate(e){if(!this.computedContext)return;let n=this.computedContext?.testParts.find(i=>i.active);n&&(this.sectionItems=n.sections.flatMap(i=>i.items),this.itemIndex=this.sectionItems.findIndex(i=>i.active),this.checkDisabled())}checkDisabled(){this._internalDisabled=!this.computedContext||this.itemIndex<0||this.itemIndex>=this.sectionItems?.length-1}_requestItem(e){this.dispatchEvent(new CustomEvent("qti-request-navigation",{composed:!0,bubbles:!0,detail:{type:"item",id:e}}))}render(){return a`<slot></slot>`}};t.styles=r`
|
|
2
|
+
:host {
|
|
3
|
+
${u};
|
|
4
|
+
}
|
|
5
|
+
:host([disabled]) {
|
|
6
|
+
${h};
|
|
7
|
+
}
|
|
8
|
+
`,s([d({type:Boolean,reflect:!0,attribute:"disabled"})],t.prototype,"_internalDisabled",2),s([o({context:p,subscribe:!0})],t.prototype,"computedContext",2),s([c("computedContext")],t.prototype,"_handleTestElementChange",1),t=s([l("test-next")],t);export{t as a};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{a as u}from"./chunk-QQCGUVEV.js";import{a as d}from"./chunk-XJ2CFTZP.js";import{c as n}from"./chunk-HO6JOQX4.js";import{a as o,d as p,i as c}from"./chunk-FLQBFTRW.js";import{b as l}from"./chunk-3YQMAZEO.js";import{a as s}from"./chunk-LO2NM3CE.js";var a=class extends c{constructor(){super(...arguments);this.getVariables=()=>Array.from(this.children).map(t=>{switch(console.debug("getVariables",t.tagName.toLowerCase()),t.tagName.toLowerCase()){case"qti-base-value":return{baseType:t.getAttribute("base-type"),value:t.textContent.trim(),cardinality:"single"};case"qti-variable":{let i=t.getAttribute("identifier")||"";return i==="QTI_CONTEXT"?this.qtiContext?.QTI_CONTEXT?{identifier:"QTI_CONTEXT",baseType:"record",value:this.qtiContext.QTI_CONTEXT,cardinality:"record",type:"context"}:(console.warn("QTI_CONTEXT not available"),{identifier:"QTI_CONTEXT",baseType:"record",value:this.qtiContext.QTI_CONTEXT,cardinality:"record",type:"context"}):this.context.variables.find(r=>r.identifier===i)||null}case"qti-multiple":{let e=t.getResult();return console.debug("values",e),e?.length>0?{identifier:"",baseType:e[0].baseType,value:e.map(r=>r.value),cardinality:"multiple",type:"response"}:null}case"qti-ordered":{let e=t.getResult();return e?.length>0?{identifier:"",baseType:e[0].baseType,value:e.map(r=>r.value),cardinality:"ordered",type:"response"}:null}case"qti-correct":{let i=t.getAttribute("identifier")||"",e=this.context.variables.find(r=>r.identifier===i)||null;return{baseType:e.baseType,value:e.correctResponse,cardinality:e.cardinality}}default:{try{return{baseType:"integer",value:t.getResult()?.toString()||null,cardinality:"single"}}catch{console.warn("default not sufficient")}return null}}}).filter(t=>t!==null)}static{this.styles=o`
|
|
2
|
+
slot {
|
|
3
|
+
display: none;
|
|
4
|
+
}
|
|
5
|
+
`}render(){return p`<pre>${JSON.stringify(this.result,null,2)}</pre>
|
|
6
|
+
<slot></slot>`}calculate(){return this.result=this.getResult(),this.result}getResult(){throw new Error("Not implemented")}};s([n()],a.prototype,"result",2),s([l({context:u,subscribe:!0}),n()],a.prototype,"context",2),s([l({context:d,subscribe:!0}),n()],a.prototype,"qtiContext",2);export{a};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var O=globalThis,q=O.ShadowRoot&&(O.ShadyCSS===void 0||O.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ot=Symbol(),bt=new WeakMap,U=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==ot)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(q&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=bt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&bt.set(e,t))}return t}toString(){return this.cssText}},St=r=>new U(typeof r=="string"?r:r+"",void 0,ot),Ft=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,i,n)=>s+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[n+1],r[0]);return new U(e,r,ot)},wt=(r,t)=>{if(q)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),i=O.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},ht=q||O.CSSStyleSheet===void 0?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return St(e)})(r):r;var Pt=class{get shadowRoot(){return this.__host.__shadowRoot}constructor(t){this.ariaAtomic="",this.ariaAutoComplete="",this.ariaBrailleLabel="",this.ariaBrailleRoleDescription="",this.ariaBusy="",this.ariaChecked="",this.ariaColCount="",this.ariaColIndex="",this.ariaColSpan="",this.ariaCurrent="",this.ariaDescription="",this.ariaDisabled="",this.ariaExpanded="",this.ariaHasPopup="",this.ariaHidden="",this.ariaInvalid="",this.ariaKeyShortcuts="",this.ariaLabel="",this.ariaLevel="",this.ariaLive="",this.ariaModal="",this.ariaMultiLine="",this.ariaMultiSelectable="",this.ariaOrientation="",this.ariaPlaceholder="",this.ariaPosInSet="",this.ariaPressed="",this.ariaReadOnly="",this.ariaRequired="",this.ariaRoleDescription="",this.ariaRowCount="",this.ariaRowIndex="",this.ariaRowSpan="",this.ariaSelected="",this.ariaSetSize="",this.ariaSort="",this.ariaValueMax="",this.ariaValueMin="",this.ariaValueNow="",this.ariaValueText="",this.role="",this.form=null,this.labels=[],this.states=new Set,this.validationMessage="",this.validity={},this.willValidate=!0,this.__host=t}checkValidity(){return console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true."),!0}reportValidity(){return!0}setFormValue(){}setValidity(){}};var E=function(r,t,e,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?r!==t||!i:!t.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(r,e):i?i.value=e:t.set(r,e),e},m=function(r,t,e,s){if(e==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!s:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?s:e==="a"?s.call(r):s?s.value:t.get(r)},M,K,Z,I,lt,B,J,S,D,b,X,Tt,Ct=r=>typeof r=="boolean"?r:r?.capture??!1;var qt=class{constructor(){this.__eventListeners=new Map,this.__captureEventListeners=new Map}addEventListener(t,e,s){if(e==null)return;let i=Ct(s)?this.__captureEventListeners:this.__eventListeners,n=i.get(t);if(n===void 0)n=new Map,i.set(t,n);else if(n.has(e))return;let a=typeof s=="object"&&s?s:{};a.signal?.addEventListener("abort",()=>this.removeEventListener(t,e,s)),n.set(e,a??{})}removeEventListener(t,e,s){if(e==null)return;let i=Ct(s)?this.__captureEventListeners:this.__eventListeners,n=i.get(t);n!==void 0&&(n.delete(e),n.size||i.delete(t))}dispatchEvent(t){let e=[this],s=this.__eventTargetParent;if(t.composed)for(;s;)e.push(s),s=s.__eventTargetParent;else for(;s&&s!==this.__host;)e.push(s),s=s.__eventTargetParent;let i=!1,n=!1,a=0,d=null,o=null,c=null,p=t.stopPropagation,l=t.stopImmediatePropagation;Object.defineProperties(t,{target:{get(){return d??o},...h},srcElement:{get(){return t.target},...h},currentTarget:{get(){return c},...h},eventPhase:{get(){return a},...h},composedPath:{value:()=>e,...h},stopPropagation:{value:()=>{i=!0,p.call(t)},...h},stopImmediatePropagation:{value:()=>{n=!0,l.call(t)},...h}});let g=(u,v,H)=>{typeof u=="function"?u(t):typeof u?.handleEvent=="function"&&u.handleEvent(t),v.once&&H.delete(u)},f=()=>(c=null,a=0,!t.defaultPrevented),y=e.slice().reverse();d=!this.__host||!t.composed?this:null;let yt=u=>{for(o=this;o.__host&&u.includes(o.__host);)o=o.__host};for(let u of y){!d&&(!o||o===u.__host)&&yt(y.slice(y.indexOf(u))),c=u,a=u===t.target?2:1;let v=u.__captureEventListeners.get(t.type);if(v){for(let[H,at]of v)if(g(H,at,v),n)return f()}if(i)return f()}let nt=t.bubbles?e:[this];o=null;for(let u of nt){!d&&(!o||u===o.__host)&&yt(nt.slice(0,nt.indexOf(u)+1)),c=u,a=u===t.target?2:3;let v=u.__eventListeners.get(t.type);if(v){for(let[H,at]of v)if(g(H,at,v),n)return f()}if(i)return f()}return f()}},ct=qt;var h={__proto__:null};h.enumerable=!0;Object.freeze(h);var dt=(b=class{constructor(t,e={}){if(M.set(this,!1),K.set(this,!1),Z.set(this,!1),I.set(this,!1),lt.set(this,Date.now()),B.set(this,!1),J.set(this,void 0),S.set(this,void 0),D.set(this,void 0),this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,arguments.length===0)throw new Error("The type argument must be specified");if(typeof e!="object"||!e)throw new Error('The "options" argument must be an object');let{bubbles:s,cancelable:i,composed:n}=e;E(this,M,!!i,"f"),E(this,K,!!s,"f"),E(this,Z,!!n,"f"),E(this,J,`${t}`,"f"),E(this,S,null,"f"),E(this,D,!1,"f")}initEvent(t,e,s){throw new Error("Method not implemented.")}stopImmediatePropagation(){this.stopPropagation()}preventDefault(){E(this,I,!0,"f")}get target(){return m(this,S,"f")}get currentTarget(){return m(this,S,"f")}get srcElement(){return m(this,S,"f")}get type(){return m(this,J,"f")}get cancelable(){return m(this,M,"f")}get defaultPrevented(){return m(this,M,"f")&&m(this,I,"f")}get timeStamp(){return m(this,lt,"f")}composedPath(){return m(this,D,"f")?[m(this,S,"f")]:[]}get returnValue(){return!m(this,M,"f")||!m(this,I,"f")}get bubbles(){return m(this,K,"f")}get composed(){return m(this,Z,"f")}get eventPhase(){return m(this,D,"f")?b.AT_TARGET:b.NONE}get cancelBubble(){return m(this,B,"f")}set cancelBubble(t){t&&E(this,B,!0,"f")}stopPropagation(){E(this,B,!0,"f")}get isTrusted(){return!1}},M=new WeakMap,K=new WeakMap,Z=new WeakMap,I=new WeakMap,lt=new WeakMap,B=new WeakMap,J=new WeakMap,S=new WeakMap,D=new WeakMap,b.NONE=0,b.CAPTURING_PHASE=1,b.AT_TARGET=2,b.BUBBLING_PHASE=3,b);Object.defineProperties(dt.prototype,{initEvent:h,stopImmediatePropagation:h,preventDefault:h,target:h,currentTarget:h,srcElement:h,type:h,cancelable:h,defaultPrevented:h,timeStamp:h,composedPath:h,returnValue:h,bubbles:h,composed:h,eventPhase:h,cancelBubble:h,stopPropagation:h,isTrusted:h});var Rt=(Tt=class extends dt{constructor(t,e={}){super(t,e),X.set(this,void 0),E(this,X,e?.detail??null,"f")}initCustomEvent(t,e,s,i){throw new Error("Method not implemented.")}get detail(){return m(this,X,"f")}},X=new WeakMap,Tt);Object.defineProperties(Rt.prototype,{detail:h});var ut=dt,pt=Rt;globalThis.Event??=ut;globalThis.CustomEvent??=pt;var xt=new WeakMap,k=r=>{let t=xt.get(r);return t===void 0&&xt.set(r,t=new Map),t},Kt=class extends ct{constructor(){super(...arguments),this.__shadowRootMode=null,this.__shadowRoot=null,this.__internals=null}get attributes(){return Array.from(k(this)).map(([t,e])=>({name:t,value:e}))}get shadowRoot(){return this.__shadowRootMode==="closed"?null:this.__shadowRoot}get localName(){return this.constructor.__localName}get tagName(){return this.localName?.toUpperCase()}setAttribute(t,e){k(this).set(t,String(e))}removeAttribute(t){k(this).delete(t)}toggleAttribute(t,e){if(this.hasAttribute(t)){if(e===void 0||!e)return this.removeAttribute(t),!1}else return e===void 0||e?(this.setAttribute(t,""),!0):!1;return!0}hasAttribute(t){return k(this).has(t)}attachShadow(t){let e={host:this};return this.__shadowRootMode=t.mode,t&&t.mode==="open"&&(this.__shadowRoot=e),e}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");let t=new Pt(this);return this.__internals=t,t}getAttribute(t){return k(this).get(t)??null}};var Zt=class extends Kt{},_t=Zt;globalThis.litServerRoot??=Object.defineProperty(new _t,"localName",{get(){return"lit-server-root"}});var Jt=class{constructor(){this.__definitions=new Map}define(t,e){if(this.__definitions.has(t))if(process.env.NODE_ENV==="development")console.warn(`'CustomElementRegistry' already has "${t}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.
|
|
2
|
+
Make sure to test your application with a production build as repeat registrations will throw in production.`);else throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);e.__localName=t,this.__definitions.set(t,{ctor:e,observedAttributes:e.observedAttributes??[]})}get(t){return this.__definitions.get(t)?.ctor}},Xt=Jt;var Mt=new Xt;var{is:Yt,defineProperty:Qt,getOwnPropertyDescriptor:te,getOwnPropertyNames:ee,getOwnPropertySymbols:se,getPrototypeOf:ie}=Object,V=globalThis;V.customElements??=Mt;var Nt=V.trustedTypes,re=Nt?Nt.emptyScript:"",ne=V.reactiveElementPolyfillSupport,W=(r,t)=>r,mt={toAttribute(r,t){switch(t){case Boolean:r=r?re:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},Ht=(r,t)=>!Yt(r,t),Lt={attribute:!0,type:String,converter:mt,reflect:!1,useDefault:!1,hasChanged:Ht};Symbol.metadata??=Symbol("metadata"),V.litPropertyMetadata??=new WeakMap;var $=class extends(globalThis.HTMLElement??_t){static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Lt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Qt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:n}=te(this.prototype,t)??{get(){return this[e]},set(a){this[e]=a}};return{get:i,set(a){let d=i?.call(this);n?.call(this,a),this.requestUpdate(t,d,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Lt}static _$Ei(){if(this.hasOwnProperty(W("elementProperties")))return;let t=ie(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(W("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(W("properties"))){let e=this.properties,s=[...ee(e),...se(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(ht(i))}else t!==void 0&&e.push(ht(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return wt(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){let s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:mt).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let n=s.getPropertyOptions(i),a=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:mt;this._$Em=i,this[i]=a.fromAttribute(e,n.type)??this._$Ej?.get(i)??null,this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){let i=this.constructor,n=this[t];if(s??=i.getPropertyOptions(t),!((s.hasChanged??Ht)(n,e)||s.useDefault&&s.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:i,wrapped:n},a){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,a??e??this[t]),n!==!0||a!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),i===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,n]of this._$Ep)this[i]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,n]of s){let{wrapped:a}=n,d=this[i];a!==!0||this._$AL.has(i)||d===void 0||this.C(i,void 0,n,d)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[W("elementProperties")]=new Map,$[W("finalized")]=new Map,ne?.({ReactiveElement:$}),(V.reactiveElementVersions??=[]).push("2.1.0");var rt=globalThis,Y=rt.trustedTypes,Ot=Y?Y.createPolicy("lit-html",{createHTML:r=>r}):void 0,gt="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,Et="?"+A,ae=`<${Et}>`,T=rt.document===void 0?{createTreeWalker:()=>({})}:document,G=()=>T.createComment(""),z=r=>r===null||typeof r!="object"&&typeof r!="function",vt=Array.isArray,Wt=r=>vt(r)||typeof r?.[Symbol.iterator]=="function",ft=`[
|
|
3
|
+
\f\r]`,j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ut=/-->/g,It=/>/g,w=RegExp(`>|${ft}(?:([^\\s"'>=/]+)(${ft}*=${ft}*(?:[^
|
|
4
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Bt=/'/g,Dt=/"/g,Vt=/^(?:script|style|textarea|title)$/i,$t=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),Me=$t(1),Ne=$t(2),Le=$t(3),C=Symbol.for("lit-noChange"),_=Symbol.for("lit-nothing"),kt=new WeakMap,P=T.createTreeWalker(T,129);function jt(r,t){if(!vt(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ot!==void 0?Ot.createHTML(t):t}var Gt=(r,t)=>{let e=r.length-1,s=[],i,n=t===2?"<svg>":t===3?"<math>":"",a=j;for(let d=0;d<e;d++){let o=r[d],c,p,l=-1,g=0;for(;g<o.length&&(a.lastIndex=g,p=a.exec(o),p!==null);)g=a.lastIndex,a===j?p[1]==="!--"?a=Ut:p[1]!==void 0?a=It:p[2]!==void 0?(Vt.test(p[2])&&(i=RegExp("</"+p[2],"g")),a=w):p[3]!==void 0&&(a=w):a===w?p[0]===">"?(a=i??j,l=-1):p[1]===void 0?l=-2:(l=a.lastIndex-p[2].length,c=p[1],a=p[3]===void 0?w:p[3]==='"'?Dt:Bt):a===Dt||a===Bt?a=w:a===Ut||a===It?a=j:(a=w,i=void 0);let f=a===w&&r[d+1].startsWith("/>")?" ":"";n+=a===j?o+ae:l>=0?(s.push(c),o.slice(0,l)+gt+o.slice(l)+A+f):o+A+(l===-2?d:f)}return[jt(r,n+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},F=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,a=0,d=t.length-1,o=this.parts,[c,p]=Gt(t,e);if(this.el=r.createElement(c,s),P.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=P.nextNode())!==null&&o.length<d;){if(i.nodeType===1){if(i.hasAttributes())for(let l of i.getAttributeNames())if(l.endsWith(gt)){let g=p[a++],f=i.getAttribute(l).split(A),y=/([.?@])?(.*)/.exec(g);o.push({type:1,index:n,name:y[2],strings:f,ctor:y[1]==="."?tt:y[1]==="?"?et:y[1]==="@"?st:x}),i.removeAttribute(l)}else l.startsWith(A)&&(o.push({type:6,index:n}),i.removeAttribute(l));if(Vt.test(i.tagName)){let l=i.textContent.split(A),g=l.length-1;if(g>0){i.textContent=Y?Y.emptyScript:"";for(let f=0;f<g;f++)i.append(l[f],G()),P.nextNode(),o.push({type:2,index:++n});i.append(l[g],G())}}}else if(i.nodeType===8)if(i.data===Et)o.push({type:2,index:n});else{let l=-1;for(;(l=i.data.indexOf(A,l+1))!==-1;)o.push({type:7,index:n}),l+=A.length-1}n++}}static createElement(t,e){let s=T.createElement("template");return s.innerHTML=t,s}};function R(r,t,e=r,s){if(t===C)return t;let i=s!==void 0?e._$Co?.[s]:e._$Cl,n=z(t)?void 0:t._$litDirective$;return i?.constructor!==n&&(i?._$AO?.(!1),n===void 0?i=void 0:(i=new n(r),i._$AT(r,e,s)),s!==void 0?(e._$Co??=[])[s]=i:e._$Cl=i),i!==void 0&&(t=R(r,i._$AS(r,t.values),i,s)),t}var Q=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??T).importNode(e,!0);P.currentNode=i;let n=P.nextNode(),a=0,d=0,o=s[0];for(;o!==void 0;){if(a===o.index){let c;o.type===2?c=new N(n,n.nextSibling,this,t):o.type===1?c=new o.ctor(n,o.name,o.strings,this,t):o.type===6&&(c=new it(n,this,t)),this._$AV.push(c),o=s[++d]}a!==o?.index&&(n=P.nextNode(),a++)}return P.currentNode=T,i}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},N=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=_,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=R(this,t,e),z(t)?t===_||t==null||t===""?(this._$AH!==_&&this._$AR(),this._$AH=_):t!==this._$AH&&t!==C&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Wt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==_&&z(this._$AH)?this._$AA.nextSibling.data=t:this.T(T.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=F.createElement(jt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{let n=new Q(i,this),a=n.u(this.options);n.p(e),this.T(a),this._$AH=n}}_$AC(t){let e=kt.get(t.strings);return e===void 0&&kt.set(t.strings,e=new F(t)),e}k(t){vt(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,i=0;for(let n of t)i===e.length?e.push(s=new r(this.O(G()),this.O(G()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},x=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=_,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=_}_$AI(t,e=this,s,i){let n=this.strings,a=!1;if(n===void 0)t=R(this,t,e,0),a=!z(t)||t!==this._$AH&&t!==C,a&&(this._$AH=t);else{let d=t,o,c;for(t=n[0],o=0;o<n.length-1;o++)c=R(this,d[s+o],e,o),c===C&&(c=this._$AH[o]),a||=!z(c)||c!==this._$AH[o],c===_?t=_:t!==_&&(t+=(c??"")+n[o+1]),this._$AH[o]=c}a&&!i&&this.j(t)}j(t){t===_?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},tt=class extends x{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===_?void 0:t}},et=class extends x{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==_)}},st=class extends x{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=R(this,t,e,0)??_)===C)return;let s=this._$AH,i=t===_&&s!==_||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==_&&(s===_||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},it=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){R(this,t)}},He={M:gt,P:A,A:Et,C:1,L:Gt,R:Q,D:Wt,V:R,I:N,H:x,N:et,U:st,B:tt,F:it},oe=rt.litHtmlPolyfillSupport;oe?.(F,N),(rt.litHtmlVersions??=[]).push("3.3.0");var zt=(r,t,e)=>{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let n=e?.renderBefore??null;s._$litPart$=i=new N(t.insertBefore(G(),n),n,void 0,e??{})}return i._$AI(r),i};var At=globalThis,L=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=zt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return C}};L._$litElement$=!0,L.finalized=!0,At.litElementHydrateSupport?.({LitElement:L});var he=At.litElementPolyfillSupport;he?.({LitElement:L});(At.litElementVersions??=[]).push("4.2.0");export{Ft as a,mt as b,Ht as c,Me as d,Ne as e,C as f,_ as g,He as h,L as i};
|
|
5
|
+
/*! Bundled license information:
|
|
6
|
+
|
|
7
|
+
@lit/reactive-element/node/css-tag.js:
|
|
8
|
+
@lit-labs/ssr-dom-shim/index.js:
|
|
9
|
+
(**
|
|
10
|
+
* @license
|
|
11
|
+
* Copyright 2019 Google LLC
|
|
12
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
+
*)
|
|
14
|
+
|
|
15
|
+
@lit-labs/ssr-dom-shim/lib/element-internals.js:
|
|
16
|
+
@lit-labs/ssr-dom-shim/lib/events.js:
|
|
17
|
+
(**
|
|
18
|
+
* @license
|
|
19
|
+
* Copyright 2023 Google LLC
|
|
20
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
21
|
+
*)
|
|
22
|
+
|
|
23
|
+
lit-html/node/lit-html.js:
|
|
24
|
+
lit-element/lit-element.js:
|
|
25
|
+
(**
|
|
26
|
+
* @license
|
|
27
|
+
* Copyright 2017 Google LLC
|
|
28
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
29
|
+
*)
|
|
30
|
+
|
|
31
|
+
lit-html/node/is-server.js:
|
|
32
|
+
(**
|
|
33
|
+
* @license
|
|
34
|
+
* Copyright 2022 Google LLC
|
|
35
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
36
|
+
*)
|
|
37
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as p,c}from"./chunk-HO6JOQX4.js";import{d as m,i as r}from"./chunk-FLQBFTRW.js";import{a as l}from"./chunk-P6SSTAJ2.js";import{b as o}from"./chunk-3YQMAZEO.js";import{a as e}from"./chunk-LO2NM3CE.js";var t=class extends r{render(){return m` <small><pre>${JSON.stringify(this.computedContext,null,2)}</pre></small> `}};e([c(),o({context:l,subscribe:!0})],t.prototype,"computedContext",2),t=e([p("test-print-context")],t);export{t as a};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as p,b as c}from"./chunk-4DXCBZFR.js";import{a as o}from"./chunk-XUJ7TXHW.js";import{a as s,b as m,c as a}from"./chunk-O4RAJ3LM.js";import{d as r,i as n}from"./chunk-HKWYQB5Z.js";import{a as l}from"./chunk-E6IOJ4MV.js";import{a as i}from"./chunk-LO2NM3CE.js";var e=class extends n{constructor(){super(...arguments);this.itemURL=null;this.itemDoc=null;this.itemXML=null;this.templateContent=null}async handleItemURLChange(){if(this.itemURL)try{let{promise:t}=await l().load(this.itemURL);this.itemDoc=(await t).htmlDoc()}catch(t){console.error("Error loading or parsing XML:",t)}}handleItemXMLChange(){if(this.itemXML)try{this.itemDoc=l().parse(this.itemXML).htmlDoc()}catch(t){console.error("Error parsing XML:",t)}}async connectedCallback(){super.connectedCallback(),this.initializeTemplateContent(),this.applyStyles(),this.itemURL&&this.handleItemURLChange(),this.itemXML&&this.handleItemXMLChange()}initializeTemplateContent(){let t=this.querySelector("template");this.templateContent=t?t.content:r``}applyStyles(){let t=new CSSStyleSheet;t.replaceSync(c),this.shadowRoot.adoptedStyleSheets=[t]}render(){return r`
|
|
2
|
+
${this.templateContent}
|
|
3
|
+
<slot></slot>
|
|
4
|
+
${p(this.itemDoc,r`<span>Loading...</span>`)}
|
|
5
|
+
`}};i([m({type:String,attribute:"item-url"})],e.prototype,"itemURL",2),i([a()],e.prototype,"itemDoc",2),i([a()],e.prototype,"itemXML",2),i([o("itemURL",{waitUntilFirstUpdate:!0})],e.prototype,"handleItemURLChange",1),i([o("itemXML",{waitUntilFirstUpdate:!0})],e.prototype,"handleItemXMLChange",1),e=i([s("item-container")],e);export{e as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as d,b as c}from"./chunk-O4RAJ3LM.js";import{d as a,i as m}from"./chunk-HKWYQB5Z.js";import{a as p}from"./chunk-P6SSTAJ2.js";import{b as s}from"./chunk-3YQMAZEO.js";import{a as n}from"./chunk-LO2NM3CE.js";var o=class extends m{constructor(){super(...arguments);this.view=null}render(){let r=this.computedContext?.testParts.flatMap(t=>t.sections.flatMap(f=>f.items)).find(t=>t.active);if(!r||!r.variables)return a``;if(r.category==="dep-informational")return a`<div>${this.dataset.informational}</div>`;let u=r?.variables.find(t=>t.identifier==="completionStatus")?.value,l=r?.variables.find(t=>t.identifier=="SCORE"),e=parseFloat(l?.value),i=r.externalScored;return a`<div>${u!=="completed"?this.dataset.textNoResponse:!i&&e!==void 0&&!Number.isNaN(e)?e>0?this.dataset.textCorrect:this.dataset.textIncorrect:i==="externalMachine"?Number.isNaN(e)||e===void 0?this.dataset.scoreUnknown:`We hebben je antwoord ${e===0?"geen punten":e==1?"\xE9\xE9n punt":`${e} punten`} gegeven. Je kunt je score zelf aanpassen als je denkt dat dat niet klopt.`:i==="human"?Number.isNaN(e)?"":"Deze score heb je zelf toegekend.":this.dataset.inProgress}</div>`}};n([s({context:p,subscribe:!0})],o.prototype,"computedContext",2),n([c({type:String,attribute:"view"})],o.prototype,"view",2),o=n([d("test-scoring-feedback")],o);export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as d,b as c}from"./chunk-HO6JOQX4.js";import{d as a,i as m}from"./chunk-FLQBFTRW.js";import{a as p}from"./chunk-P6SSTAJ2.js";import{b as s}from"./chunk-3YQMAZEO.js";import{a as n}from"./chunk-LO2NM3CE.js";var o=class extends m{constructor(){super(...arguments);this.view=null}render(){let r=this.computedContext?.testParts.flatMap(t=>t.sections.flatMap(f=>f.items)).find(t=>t.active);if(!r||!r.variables)return a``;if(r.category==="dep-informational")return a`<div>${this.dataset.informational}</div>`;let u=r?.variables.find(t=>t.identifier==="completionStatus")?.value,l=r?.variables.find(t=>t.identifier=="SCORE"),e=parseFloat(l?.value),i=r.externalScored;return a`<div>${u!=="completed"?this.dataset.textNoResponse:!i&&e!==void 0&&!Number.isNaN(e)?e>0?this.dataset.textCorrect:this.dataset.textIncorrect:i==="externalMachine"?Number.isNaN(e)||e===void 0?this.dataset.scoreUnknown:`We hebben je antwoord ${e===0?"geen punten":e==1?"\xE9\xE9n punt":`${e} punten`} gegeven. Je kunt je score zelf aanpassen als je denkt dat dat niet klopt.`:i==="human"?Number.isNaN(e)?"":"Deze score heb je zelf toegekend.":this.dataset.inProgress}</div>`}};n([s({context:p,subscribe:!0})],o.prototype,"computedContext",2),n([c({type:String,attribute:"view"})],o.prototype,"view",2),o=n([d("test-scoring-feedback")],o);export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./chunk-4FBS7ODL.js";var t=class extends e{calculate(){return this.result=this.getResult(),this.result}getResult(){throw new Error("Not implemented")}};export{t as a};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import{h as l}from"./chunk-HKWYQB5Z.js";var d={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},T=e=>(...t)=>({_$litDirective$:e,values:t}),A=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,s){this._$Ct=t,this._$AM=i,this._$Ci=s}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}};var{I:m}=l,N=e=>e===null||typeof e!="object"&&typeof e!="function";var p=e=>e.strings===void 0,h=()=>document.createComment(""),g=(e,t,i)=>{let s=e._$AA.parentNode,$=t===void 0?e._$AB:t._$AA;if(i===void 0){let r=s.insertBefore(h(),$),n=s.insertBefore(h(),$);i=new m(r,n,e,e.options)}else{let r=i._$AB.nextSibling,n=i._$AM,c=n!==e;if(c){let o;i._$AQ?.(e),i._$AM=e,i._$AP!==void 0&&(o=e._$AU)!==n._$AU&&i._$AP(o)}if(r!==$||c){let o=i._$AA;for(;o!==r;){let f=o.nextSibling;s.insertBefore(o,$),o=f}}}return i},R=(e,t,i=e)=>(e._$AI(t,i),e),C={},x=(e,t=C)=>e._$AH=t,H=e=>e._$AH,B=e=>{e._$AR(),e._$AA.remove()};var _=(e,t)=>{let i=e._$AN;if(i===void 0)return!1;for(let s of i)s._$AO?.(t,!1),_(s,t);return!0},a=e=>{let t,i;do{if((t=e._$AM)===void 0)break;i=t._$AN,i.delete(e),e=t}while(i?.size===0)},v=e=>{for(let t;t=e._$AM;e=t){let i=t._$AN;if(i===void 0)t._$AN=i=new Set;else if(i.has(e))break;i.add(e),P(t)}};function y(e){this._$AN!==void 0?(a(this),this._$AM=e,v(this)):this._$AM=e}function M(e,t=!1,i=0){let s=this._$AH,$=this._$AN;if($!==void 0&&$.size!==0)if(t)if(Array.isArray(s))for(let r=i;r<s.length;r++)_(s[r],!1),a(s[r]);else s!=null&&(_(s,!1),a(s));else _(this,e)}var P=e=>{e.type==d.CHILD&&(e._$AP??=M,e._$AQ??=y)},u=class extends A{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,i,s){super._$AT(t,i,s),v(this),this.isConnected=t._$AU}_$AO(t,i=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),i&&(_(this,t),a(this))}setValue(t){if(p(this._$Ct))this._$Ct._$AI(t,this);else{let i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}};export{d as a,T as b,A as c,N as d,g as e,R as f,x as g,H as h,B as i,u as j};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
lit-html/node/directive.js:
|
|
5
|
+
lit-html/node/async-directive.js:
|
|
6
|
+
(**
|
|
7
|
+
* @license
|
|
8
|
+
* Copyright 2017 Google LLC
|
|
9
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
10
|
+
*)
|
|
11
|
+
|
|
12
|
+
lit-html/node/directive-helpers.js:
|
|
13
|
+
(**
|
|
14
|
+
* @license
|
|
15
|
+
* Copyright 2020 Google LLC
|
|
16
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
+
*)
|
|
18
|
+
*/
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import{a as m}from"./chunk-TCHROQU3.js";import{a as l}from"./chunk-O4RAJ3LM.js";import{a as d,d as a,i as c}from"./chunk-HKWYQB5Z.js";import{b as i}from"./chunk-3YQMAZEO.js";import{a as p}from"./chunk-LO2NM3CE.js";var r=class extends c{render(){let s=this.computedContext;if(!s||!s.variables)return a``;let b=s.variables.filter(o=>o.type==="response"),u=s.variables.filter(o=>o.type==="outcome"),n=(o,h)=>a`
|
|
2
|
+
<h3>${h}</h3>
|
|
3
|
+
<table>
|
|
4
|
+
<thead>
|
|
5
|
+
<tr>
|
|
6
|
+
<th>Identifier</th>
|
|
7
|
+
<th>Value</th>
|
|
8
|
+
<th>Cardinality</th>
|
|
9
|
+
<th>Base Type</th>
|
|
10
|
+
<th>Correct Response / Mappings</th>
|
|
11
|
+
</tr>
|
|
12
|
+
</thead>
|
|
13
|
+
<tbody>
|
|
14
|
+
${o.map(e=>{let f=e.correctResponse?Array.isArray(e.correctResponse)?e.correctResponse.join(", "):e.correctResponse:"",x=e.mapping?.mapEntries?.map(t=>`${t.mapKey}=${t.mappedValue}pt`).join(", ")||"",y=e.areaMapping?.areaMapEntries?.map(t=>`${t.shape}(${t.coords})=${t.mappedValue}pt`).join(", ")||"";return a`
|
|
15
|
+
<tr>
|
|
16
|
+
<td>${e.identifier}</td>
|
|
17
|
+
<td>${Array.isArray(e.value)?e.value.join(", "):e.value}</td>
|
|
18
|
+
<td>${e.cardinality}</td>
|
|
19
|
+
<td>${e.baseType}</td>
|
|
20
|
+
<td>${f||x||y}</td>
|
|
21
|
+
</tr>
|
|
22
|
+
`})}
|
|
23
|
+
</tbody>
|
|
24
|
+
</table>
|
|
25
|
+
`;return a`
|
|
26
|
+
${n(b,"Response Variables")} ${n(u,"Outcome Variables")}
|
|
27
|
+
`}};r.styles=d`
|
|
28
|
+
table {
|
|
29
|
+
width: 100%;
|
|
30
|
+
border-collapse: collapse;
|
|
31
|
+
margin: 20px 0;
|
|
32
|
+
font-size: 14px;
|
|
33
|
+
text-align: left;
|
|
34
|
+
}
|
|
35
|
+
th,
|
|
36
|
+
td {
|
|
37
|
+
border: 1px solid #ddd;
|
|
38
|
+
padding: 8px;
|
|
39
|
+
}
|
|
40
|
+
th {
|
|
41
|
+
background-color: #f4f4f4;
|
|
42
|
+
font-weight: bold;
|
|
43
|
+
}
|
|
44
|
+
h3 {
|
|
45
|
+
margin-top: 20px;
|
|
46
|
+
font-size: 16px;
|
|
47
|
+
}
|
|
48
|
+
`,p([i({context:m,subscribe:!0})],r.prototype,"computedContext",2),r=p([l("print-item-variables")],r);export{r as a};
|