@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,5 @@
|
|
|
1
|
+
import{a as L}from"./chunk-DP5FVJRS.js";import{g as S}from"./chunk-WV5B4HNF.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 @@
|
|
|
1
|
+
import{a as i}from"./chunk-DP5FVJRS.js";import{a as l}from"./chunk-P6SSTAJ2.js";import{a as p}from"./chunk-O4RAJ3LM.js";import{d as r,i as a}from"./chunk-HKWYQB5Z.js";import{b as n}from"./chunk-3YQMAZEO.js";import{a as o}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=i(e)}render(){if(!this.computedContext)return r``;let e=this.computedContext.testParts.flatMap(m=>m.sections.flatMap(s=>s.items));return r` ${e.map(m=>this.myTemplate({item:m,view:this.computedContext.view}))} `}};o([n({context:l,subscribe:!0})],t.prototype,"computedContext",2),t=o([p("test-paging-buttons-stamp")],t);export{t as a};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{b as d,c as l}from"./chunk-YCBNF5QU.js";import{a,b as s}from"./chunk-O4RAJ3LM.js";import{a as o,d as n,i as p}from"./chunk-HKWYQB5Z.js";import{a as c}from"./chunk-TCHROQU3.js";import{b as r}from"./chunk-3YQMAZEO.js";import{a as e}from"./chunk-LO2NM3CE.js";var t=class extends p{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";this._hasCorrectResponse=!1;this._previousActiveItem=""}updated(){if(!this._hasCorrectResponse||this._previousActiveItem!==this.computedContext?.identifier){this._previousActiveItem=this.computedContext?.identifier;let m=!!this.computedContext?.variables.some(i=>i.correctResponse),h=!!this.computedContext?.variables.some(i=>i.mapping?.mapEntries?.length>0||i.areaMapping?.areaMapEntries?.length>0);this._hasCorrectResponse=m||h}this.disabled=!this._hasCorrectResponse}_toggleState(){this.disabled||this.dispatchEvent(new CustomEvent("item-show-correct-response",{detail:!this.shown,bubbles:!0}))}_getDisplayedText(){return this.disabled?this.noCorrectResponseText:this.shown?this.hideCorrectText:this.showCorrectText}render(){return n` <div @click="${this._toggleState}">${this._getDisplayedText()}</div> `}};t.styles=o`
|
|
2
|
+
:host {
|
|
3
|
+
${d};
|
|
4
|
+
}
|
|
5
|
+
:host([disabled]) {
|
|
6
|
+
${l};
|
|
7
|
+
}
|
|
8
|
+
`,e([r({context:c,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([a("item-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 p}from"./chunk-XUJ7TXHW.js";import{a,b as l}from"./chunk-HO6JOQX4.js";import{a as m,d as r,i as d}from"./chunk-FLQBFTRW.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 @@
|
|
|
1
|
+
import{a as c,c as m}from"./chunk-O4RAJ3LM.js";import{d as a,i as d}from"./chunk-HKWYQB5Z.js";import{a as h}from"./chunk-TCHROQU3.js";import{a as p}from"./chunk-7ME56ODO.js";import{a as r}from"./chunk-3YQMAZEO.js";import{a as n}from"./chunk-LO2NM3CE.js";var o=class extends d{constructor(){super();this.configContext={};this._onItemContextChanged=this._handleItemContextChanged.bind(this);this._onAssessmentItemConnected=this._handleAssessmentItemConnected.bind(this);this._onHandleShowCorrectResponse=this._handleShowCorrectResponse.bind(this);this._onHandleShowCandidateCorrection=this._handleShowCandidateCorrection.bind(this);this._onHandleSwitchCorrectResponseMode=this._handleSwitchCorrectResponseMode.bind(this);this.addEventListener("qti-item-context-updated",this._onItemContextChanged),this.addEventListener("qti-assessment-item-connected",this._onAssessmentItemConnected),this.addEventListener("item-show-correct-response",this._onHandleShowCorrectResponse),this.addEventListener("item-show-candidate-correction",this._onHandleShowCandidateCorrection),this.addEventListener("item-switch-correct-response-mode",this._onHandleSwitchCorrectResponseMode)}_handleItemContextChanged(e){this._updateItemVariablesInTestContext(e.detail.itemContext.identifier,e.detail?.itemContext?.variables||[])}_handleAssessmentItemConnected(e){let t=e.detail._context.variables;this._qtiAssessmentItem=e.detail,this.computedContext=this.computedContext?.identifier===this._qtiAssessmentItem.identifier?{...this.computedContext,title:this._qtiAssessmentItem.title}:{identifier:this._qtiAssessmentItem.identifier,title:this._qtiAssessmentItem.title,adaptive:this._qtiAssessmentItem.getAttribute("adaptive")?.toLowerCase()==="true"||!1,variables:t,correctResponseMode:"internal"},this._updateItemVariablesInTestContext(this._qtiAssessmentItem.identifier,t||[])}_handleShowCorrectResponse(e){this._qtiAssessmentItem&&this._qtiAssessmentItem.showCorrectResponse(e.detail)}_handleShowCandidateCorrection(e){this._qtiAssessmentItem&&this._qtiAssessmentItem.showCandidateCorrection(e.detail)}_handleSwitchCorrectResponseMode(e){this._handleShowCorrectResponse(new CustomEvent("item-show-correct-response",{detail:!1,bubbles:!0})),this.configContext={...this.configContext,correctResponseMode:e.detail}}_updateItemVariablesInTestContext(e,t){let C=t?.find(i=>i.identifier=="SCORE")?.value,s=parseFloat(C?.toString()),l=t?.find(i=>i.identifier==="completionStatus")?.value,x=s!==void 0&&!isNaN(s)&&s>0,u=s!==void 0&&!isNaN(s)&&s<=0,f=l==="completed";this.computedContext={...this.computedContext,identifier:e,correct:x,incorrect:u,completed:f,variables:t}}render(){return a`<slot></slot>`}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-item-context-changed",this._onItemContextChanged),this.removeEventListener("qti-assessment-item-connected",this._onAssessmentItemConnected)}};n([m(),r({context:h})],o.prototype,"computedContext",2),n([m(),r({context:p})],o.prototype,"configContext",2),o=n([c("qti-item")],o);export{o as a};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{b as d,c as l}from"./chunk-YCBNF5QU.js";import{a as c}from"./chunk-TCHROQU3.js";import{a,b as s}from"./chunk-O4RAJ3LM.js";import{a as o,d as n,i as p}from"./chunk-HKWYQB5Z.js";import{b as r}from"./chunk-3YQMAZEO.js";import{a as e}from"./chunk-LO2NM3CE.js";var t=class extends p{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";this._hasCorrectResponse=!1;this._previousActiveItem=""}updated(){if(!this._hasCorrectResponse||this._previousActiveItem!==this.computedContext?.identifier){this._previousActiveItem=this.computedContext?.identifier;let m=!!this.computedContext?.variables.some(i=>i.correctResponse),h=!!this.computedContext?.variables.some(i=>i.mapping?.mapEntries?.length>0||i.areaMapping?.areaMapEntries?.length>0);this._hasCorrectResponse=m||h}this.disabled=!this._hasCorrectResponse}_toggleState(){this.disabled||this.dispatchEvent(new CustomEvent("item-show-correct-response",{detail:!this.shown,bubbles:!0}))}_getDisplayedText(){return this.disabled?this.noCorrectResponseText:this.shown?this.hideCorrectText:this.showCorrectText}render(){return n` <div @click="${this._toggleState}">${this._getDisplayedText()}</div> `}};t.styles=o`
|
|
2
|
+
:host {
|
|
3
|
+
${d};
|
|
4
|
+
}
|
|
5
|
+
:host([disabled]) {
|
|
6
|
+
${l};
|
|
7
|
+
}
|
|
8
|
+
`,e([r({context:c,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([a("item-show-correct-response")],t);export{t as a};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{b as m}from"./chunk-CZDMOYYF.js";import{a as c}from"./chunk-XUJ7TXHW.js";import{a,b as n,c as l}from"./chunk-O4RAJ3LM.js";import{d as s,i as p}from"./chunk-HKWYQB5Z.js";import{b as r}from"./chunk-3YQMAZEO.js";import{a as i}from"./chunk-LO2NM3CE.js";var t=class extends p{constructor(){super(...arguments);this.label="view";this._handleViewOptionsChange=()=>{this.updateViewOptions()};this._viewOptions=t.DEFAULT_VIEW_OPTIONS}connectedCallback(){super.connectedCallback(),this.updateViewOptions()}updateViewOptions(){if(this.viewOptions){let e=this.viewOptions.split(",").map(o=>o.trim());this._viewOptions=e.filter(o=>t.DEFAULT_VIEW_OPTIONS.includes(o))}else this._viewOptions=t.DEFAULT_VIEW_OPTIONS}_switchView(e){this.dispatchEvent(new CustomEvent("on-test-switch-view",{composed:!0,bubbles:!0,detail:e}))}render(){return s`
|
|
2
|
+
<label part="label" for="viewSelect">${this.label}</label>
|
|
3
|
+
<select
|
|
4
|
+
part="select"
|
|
5
|
+
id="viewSelect"
|
|
6
|
+
@change=${e=>{let o=e.target;this._switchView(o.value)}}
|
|
7
|
+
>
|
|
8
|
+
${this._viewOptions.map(e=>s`<option value="${e}" ?selected=${e===this.sessionContext.view}>${e}</option>`)}
|
|
9
|
+
</select>
|
|
10
|
+
`}};t.DEFAULT_VIEW_OPTIONS=["author","candidate","proctor","scorer","testConstructor","tutor"],i([r({context:m,subscribe:!0})],t.prototype,"sessionContext",2),i([n({type:String})],t.prototype,"label",2),i([n({type:String,attribute:"view-options"})],t.prototype,"viewOptions",2),i([c("viewOptions",{waitUntilFirstUpdate:!0})],t.prototype,"_handleViewOptionsChange",2),i([l()],t.prototype,"_viewOptions",2),t=i([a("test-view")],t);export{t as a};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import{a as m}from"./chunk-O4RAJ3LM.js";import{a as d,d as a,i as l}from"./chunk-HKWYQB5Z.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 h,c as u}from"./chunk-3CVBBZDT.js";import{a as d}from"./chunk-P6SSTAJ2.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{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{a as p,b as c}from"./chunk-AAZIKH5Z.js";import{a as o}from"./chunk-XUJ7TXHW.js";import{a as l}from"./chunk-E6IOJ4MV.js";import{a as s,b as m,c as a}from"./chunk-HO6JOQX4.js";import{d as r,i as n}from"./chunk-FLQBFTRW.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,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-M4VO4BD3.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 V}from"./chunk-E6IOJ4MV.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,25 @@
|
|
|
1
|
+
import{b as l,c as p}from"./chunk-HKWYQB5Z.js";var y=e=>(r,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(e,r)}):customElements.define(e,r)};var f={attribute:!0,type:String,converter:l,reflect:!1,hasChanged:p},h=(e=f,r,t)=>{let{kind:n,metadata:c}=t,a=globalThis.litPropertyMetadata.get(c);if(a===void 0&&globalThis.litPropertyMetadata.set(c,a=new Map),n==="setter"&&((e=Object.create(e)).wrapped=!0),a.set(t.name,e),n==="accessor"){let{name:s}=t;return{set(i){let o=r.get.call(this);r.set.call(this,i),this.requestUpdate(s,o,e)},init(i){return i!==void 0&&this.C(s,void 0,e,i),i}}}if(n==="setter"){let{name:s}=t;return function(i){let o=this[s];r.call(this,i),this.requestUpdate(s,o,e)}}throw Error("Unsupported decorator location: "+n)};function d(e){return(r,t)=>typeof t=="object"?h(e,r,t):((n,c,a)=>{let s=c.hasOwnProperty(a);return c.constructor.createProperty(a,n),s?Object.getOwnPropertyDescriptor(c,a):void 0})(e,r,t)}function v(e){return d({...e,state:!0,attribute:!1})}var u=(e,r,t)=>(t.configurable=!0,t.enumerable=!0,Reflect.decorate&&typeof r!="object"&&Object.defineProperty(e,r,t),t);function S(e,r){return(t,n,c)=>{let a=s=>s.renderRoot?.querySelector(e)??null;if(r){let{get:s,set:i}=typeof n=="object"?t:c??(()=>{let o=Symbol();return{get(){return this[o]},set(m){this[o]=m}}})();return u(t,n,{get(){let o=s.call(this);return o===void 0&&(o=a(this),(o!==null||this.hasUpdated)&&i.call(this,o)),o}})}return u(t,n,{get(){return a(this)}})}}function D(e){return(r,t)=>{let{slot:n,selector:c}=e??{},a="slot"+(n?`[name=${n}]`:":not([name])");return u(r,t,{get(){let s=this.renderRoot?.querySelector(a),i=s?.assignedElements(e)??[];return c===void 0?i:i.filter(o=>o.matches(c))}})}}export{y as a,d as b,v as c,S as d,D as e};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
@lit/reactive-element/node/decorators/custom-element.js:
|
|
5
|
+
@lit/reactive-element/node/decorators/property.js:
|
|
6
|
+
@lit/reactive-element/node/decorators/state.js:
|
|
7
|
+
@lit/reactive-element/node/decorators/event-options.js:
|
|
8
|
+
@lit/reactive-element/node/decorators/base.js:
|
|
9
|
+
@lit/reactive-element/node/decorators/query.js:
|
|
10
|
+
@lit/reactive-element/node/decorators/query-all.js:
|
|
11
|
+
@lit/reactive-element/node/decorators/query-async.js:
|
|
12
|
+
@lit/reactive-element/node/decorators/query-assigned-nodes.js:
|
|
13
|
+
(**
|
|
14
|
+
* @license
|
|
15
|
+
* Copyright 2017 Google LLC
|
|
16
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
+
*)
|
|
18
|
+
|
|
19
|
+
@lit/reactive-element/node/decorators/query-assigned-elements.js:
|
|
20
|
+
(**
|
|
21
|
+
* @license
|
|
22
|
+
* Copyright 2021 Google LLC
|
|
23
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
24
|
+
*)
|
|
25
|
+
*/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import{h as l}from"./chunk-FLQBFTRW.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,D=e=>e===null||typeof e!="object"&&typeof e!="function";var p=e=>e.strings===void 0,h=()=>document.createComment(""),E=(e,t,i)=>{let s=e._$AA.parentNode,o=t===void 0?e._$AB:t._$AA;if(i===void 0){let r=s.insertBefore(h(),o),_=s.insertBefore(h(),o);i=new m(r,_,e,e.options)}else{let r=i._$AB.nextSibling,_=i._$AM,a=_!==e;if(a){let $;i._$AQ?.(e),i._$AM=e,i._$AP!==void 0&&($=e._$AU)!==_._$AU&&i._$AP($)}if(r!==o||a){let $=i._$AA;for(;$!==r;){let v=$.nextSibling;s.insertBefore($,o),$=v}}}return i},N=(e,t,i=e)=>(e._$AI(t,i),e),C={},B=(e,t=C)=>e._$AH=t,H=e=>e._$AH,R=e=>{e._$AP?.(!1,!0);let t=e._$AA,i=e._$AB.nextSibling;for(;t!==i;){let s=t.nextSibling;t.remove(),t=s}};var n=(e,t)=>{let i=e._$AN;if(i===void 0)return!1;for(let s of i)s._$AO?.(t,!1),n(s,t);return!0},c=e=>{let t,i;do{if((t=e._$AM)===void 0)break;i=t._$AN,i.delete(e),e=t}while(i?.size===0)},f=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),M(t)}};function P(e){this._$AN!==void 0?(c(this),this._$AM=e,f(this)):this._$AM=e}function y(e,t=!1,i=0){let s=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(t)if(Array.isArray(s))for(let r=i;r<s.length;r++)n(s[r],!1),c(s[r]);else s!=null&&(n(s,!1),c(s));else n(this,e)}var M=e=>{e.type==d.CHILD&&(e._$AP??=y,e._$AQ??=P)},u=class extends A{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,i,s){super._$AT(t,i,s),f(this),this.isConnected=t._$AU}_$AO(t,i=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),i&&(n(this,t),c(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,D as d,E as e,N as f,B as g,H as h,R 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,5 @@
|
|
|
1
|
+
import{a as L}from"./chunk-PQLJWD6V.js";import{a as R,b as A}from"./chunk-CZDMOYYF.js";import{g as S}from"./chunk-V2AJKKRF.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 V}from"./chunk-E6IOJ4MV.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 n,c as l}from"./chunk-3CVBBZDT.js";import{a as i}from"./chunk-O4RAJ3LM.js";import{a as s,d as o,i as r}from"./chunk-HKWYQB5Z.js";import{a as e}from"./chunk-LO2NM3CE.js";var t=class extends r{constructor(){super(),this.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("test-end-attempt",{bubbles:!0})),this.dispatchEvent(new CustomEvent("test-show-correct-response",{detail:!0,bubbles:!0}));let c=this.closest("qti-test").querySelector("test-container");Array.from(c.shadowRoot.querySelectorAll("[view]")).forEach(a=>{a.classList.toggle("show",!0)})})}render(){return o` <slot></slot> `}};t.styles=s`
|
|
2
|
+
:host {
|
|
3
|
+
${n};
|
|
4
|
+
}
|
|
5
|
+
:host([disabled]) {
|
|
6
|
+
${l};
|
|
7
|
+
}
|
|
8
|
+
`,t=e([i("test-check-item")],t);export{t as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as f}from"./chunk-PQLJWD6V.js";import{a as d,b as l}from"./chunk-HO6JOQX4.js";import{d as s,g as c,i as u}from"./chunk-FLQBFTRW.js";import{a as b}from"./chunk-P6SSTAJ2.js";import{b as p}from"./chunk-3YQMAZEO.js";import{a as m}from"./chunk-LO2NM3CE.js";var r=class extends u{constructor(){super();this.view="";this.disabled=!1;this.myTemplate=null;this.addEventListener("click",e=>{let o=e.target,n=parseFloat(o.value);o.tagName==="INPUT"&&this._changeOutcomeScore(n)})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback();let e=this.querySelector("template");if(!e){this.myTemplate=null;return}this.myTemplate=f(e)}_changeOutcomeScore(e){let i=(this.computedContext?.testParts.find(t=>t.active)).sections.flatMap(t=>t.items).find(t=>t.active)?.identifier;this.dispatchEvent(new CustomEvent("test-update-outcome-variable",{detail:{assessmentItemRefId:i,outcomeVariableId:"SCORE",value:e},bubbles:!0}))}render(){let e=this.computedContext?.testParts.flatMap(a=>a.sections.flatMap(h=>h.items)).find(a=>a.active);if(!e||!e.variables)return s``;let o=e.variables.find(a=>a.identifier=="MAXSCORE")?.value,n=e.variables.find(a=>a.identifier=="SCORE"),i=n?.value,t=n?.externalScored!=="human";if(!o||!n)return c;let v=[...Array(Number(o)+1).keys()];return s`${this.myTemplate?this.myTemplate({scores:v,score:i,disabled:t}):c}`}};m([l({type:String,attribute:"view"})],r.prototype,"view",2),m([l({type:Boolean})],r.prototype,"disabled",2),m([p({context:b,subscribe:!0})],r.prototype,"computedContext",2),r=m([d("test-scoring-buttons")],r);export{r as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./chunk-FEJUVLN4.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,10 @@
|
|
|
1
|
+
import{a as c}from"./chunk-XUJ7TXHW.js";import{b as m}from"./chunk-CZDMOYYF.js";import{a,b as n,c as l}from"./chunk-HO6JOQX4.js";import{d as s,i as p}from"./chunk-FLQBFTRW.js";import{b as r}from"./chunk-3YQMAZEO.js";import{a as i}from"./chunk-LO2NM3CE.js";var t=class extends p{constructor(){super(...arguments);this.label="view";this._handleViewOptionsChange=()=>{this.updateViewOptions()};this._viewOptions=t.DEFAULT_VIEW_OPTIONS}connectedCallback(){super.connectedCallback(),this.updateViewOptions()}updateViewOptions(){if(this.viewOptions){let e=this.viewOptions.split(",").map(o=>o.trim());this._viewOptions=e.filter(o=>t.DEFAULT_VIEW_OPTIONS.includes(o))}else this._viewOptions=t.DEFAULT_VIEW_OPTIONS}_switchView(e){this.dispatchEvent(new CustomEvent("on-test-switch-view",{composed:!0,bubbles:!0,detail:e}))}render(){return s`
|
|
2
|
+
<label part="label" for="viewSelect">${this.label}</label>
|
|
3
|
+
<select
|
|
4
|
+
part="select"
|
|
5
|
+
id="viewSelect"
|
|
6
|
+
@change=${e=>{let o=e.target;this._switchView(o.value)}}
|
|
7
|
+
>
|
|
8
|
+
${this._viewOptions.map(e=>s`<option value="${e}" ?selected=${e===this.sessionContext.view}>${e}</option>`)}
|
|
9
|
+
</select>
|
|
10
|
+
`}};t.DEFAULT_VIEW_OPTIONS=["author","candidate","proctor","scorer","testConstructor","tutor"],i([r({context:m,subscribe:!0})],t.prototype,"sessionContext",2),i([n({type:String})],t.prototype,"label",2),i([n({type:String,attribute:"view-options"})],t.prototype,"viewOptions",2),i([c("viewOptions",{waitUntilFirstUpdate:!0})],t.prototype,"_handleViewOptionsChange",2),i([l()],t.prototype,"_viewOptions",2),t=i([a("test-view")],t);export{t as a};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{b as n,c as a}from"./chunk-3CVBBZDT.js";import{a as l,b as o}from"./chunk-O4RAJ3LM.js";import{a as s,d as r,i}from"./chunk-HKWYQB5Z.js";import{a as e}from"./chunk-LO2NM3CE.js";var t=class extends i{constructor(){super();this.sectionId=null;this.addEventListener("click",()=>this._requestItem(this.sectionId))}_requestItem(m){this.dispatchEvent(new CustomEvent("qti-request-navigation",{composed:!0,bubbles:!0,detail:{type:"section",id:m}}))}render(){return r` <slot></slot> `}};t.styles=s`
|
|
2
|
+
:host {
|
|
3
|
+
${n};
|
|
4
|
+
}
|
|
5
|
+
:host([disabled]) {
|
|
6
|
+
${a};
|
|
7
|
+
}
|
|
8
|
+
`,e([o({type:String,attribute:"section-id"})],t.prototype,"sectionId",2),t=e([l("test-section-link")],t);export{t as a};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{f as $,g as U,h as m}from"./chunk-FLQBFTRW.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.#E();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])}#E(){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.#m();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.#E();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)}#E(){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.#m();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)}#m(){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.#m();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:m.M,marker:m.P,markerMatch:m.A,HTML_RESULT:m.C,getTemplateHtml:m.L,overrideDirectiveResolve:(e,t)=>class extends e{_$AS(r,s){return t(this,s)}},patchDirectiveResolve:(e,t)=>{if(e.prototype._$AS!==t){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:m.V,AttributePart:m.H,PropertyPart:m.B,BooleanAttributePart:m.N,EventPart:m.U,ElementPart:m.F,TemplateInstance:m.R,isIterable:m.D,ChildPart:m.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 E of a.parts){let f=E.update(h,r,s);E.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,E,f)=>b(s,p,E,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(),E=p.startsWith("{{")&&p.endsWith("}}");d=(f,O,R)=>{let g=a.getAttribute("data"),G=g===null?void 0:P(g,f);return(E?P(p,f):R[h])?.(G,O,R)}}else u!==null?d=(p,E,f)=>{let O=E[u];return O?.(a,p,E,f)}:(c==="super"?t.renderers.super=(p,E,f)=>{let O=f.super,R=T(a);return f={...f,...R.renderers},O(p,E,f)}:t.renderers[c]=(p,E,f)=>b(a,p,E,f),d=(p,E,f)=>{let O=f[c];return O?.(p,E,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,E=u[0];E==="."?(d=z(u.substring(1)),p=ht):E==="?"?(d=u.substring(1),p=lt):E==="@"&&(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:(E,f)=>d.evaluate(E)});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,2 @@
|
|
|
1
|
+
import{a as x}from"./chunk-DP5FVJRS.js";import{a as v,b as f,c as p}from"./chunk-O4RAJ3LM.js";import{d as r,g as c,i as d}from"./chunk-HKWYQB5Z.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 @@
|
|
|
1
|
+
import{a as e}from"./chunk-2BSPQRNR.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 @@
|
|
|
1
|
+
import{a as l}from"./chunk-P6SSTAJ2.js";import{a as p,c}from"./chunk-HO6JOQX4.js";import{d as m,i as r}from"./chunk-FLQBFTRW.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,8 @@
|
|
|
1
|
+
import{b as a,c as n}from"./chunk-3CVBBZDT.js";import{a as o}from"./chunk-O4RAJ3LM.js";import{a as s,d as r,i as l}from"./chunk-HKWYQB5Z.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 @@
|
|
|
1
|
+
import{a as s}from"./chunk-PQLJWD6V.js";import{a as p}from"./chunk-HO6JOQX4.js";import{d as m,i as a}from"./chunk-FLQBFTRW.js";import{a as l}from"./chunk-P6SSTAJ2.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,2 @@
|
|
|
1
|
+
import{a as x}from"./chunk-DP5FVJRS.js";import{a as h}from"./chunk-P6SSTAJ2.js";import{a as v,b as f,c as p}from"./chunk-O4RAJ3LM.js";import{d as r,g as c,i as d}from"./chunk-HKWYQB5Z.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 @@
|
|
|
1
|
+
import{a as c,c as m}from"./chunk-HO6JOQX4.js";import{d as a,i as d}from"./chunk-FLQBFTRW.js";import{a as h}from"./chunk-TCHROQU3.js";import{a as p}from"./chunk-7ME56ODO.js";import{a as r}from"./chunk-3YQMAZEO.js";import{a as n}from"./chunk-LO2NM3CE.js";var o=class extends d{constructor(){super();this.configContext={};this._onItemContextChanged=this._handleItemContextChanged.bind(this);this._onAssessmentItemConnected=this._handleAssessmentItemConnected.bind(this);this._onHandleShowCorrectResponse=this._handleShowCorrectResponse.bind(this);this._onHandleShowCandidateCorrection=this._handleShowCandidateCorrection.bind(this);this._onHandleSwitchCorrectResponseMode=this._handleSwitchCorrectResponseMode.bind(this);this.addEventListener("qti-item-context-updated",this._onItemContextChanged),this.addEventListener("qti-assessment-item-connected",this._onAssessmentItemConnected),this.addEventListener("item-show-correct-response",this._onHandleShowCorrectResponse),this.addEventListener("item-show-candidate-correction",this._onHandleShowCandidateCorrection),this.addEventListener("item-switch-correct-response-mode",this._onHandleSwitchCorrectResponseMode)}_handleItemContextChanged(e){this._updateItemVariablesInTestContext(e.detail.itemContext.identifier,e.detail?.itemContext?.variables||[])}_handleAssessmentItemConnected(e){let t=e.detail._context.variables;this._qtiAssessmentItem=e.detail,this.computedContext=this.computedContext?.identifier===this._qtiAssessmentItem.identifier?{...this.computedContext,title:this._qtiAssessmentItem.title}:{identifier:this._qtiAssessmentItem.identifier,title:this._qtiAssessmentItem.title,adaptive:this._qtiAssessmentItem.getAttribute("adaptive")?.toLowerCase()==="true"||!1,variables:t,correctResponseMode:"internal"},this._updateItemVariablesInTestContext(this._qtiAssessmentItem.identifier,t||[])}_handleShowCorrectResponse(e){this._qtiAssessmentItem&&this._qtiAssessmentItem.showCorrectResponse(e.detail)}_handleShowCandidateCorrection(e){this._qtiAssessmentItem&&this._qtiAssessmentItem.showCandidateCorrection(e.detail)}_handleSwitchCorrectResponseMode(e){this._handleShowCorrectResponse(new CustomEvent("item-show-correct-response",{detail:!1,bubbles:!0})),this.configContext={...this.configContext,correctResponseMode:e.detail}}_updateItemVariablesInTestContext(e,t){let C=t?.find(i=>i.identifier=="SCORE")?.value,s=parseFloat(C?.toString()),l=t?.find(i=>i.identifier==="completionStatus")?.value,x=s!==void 0&&!isNaN(s)&&s>0,u=s!==void 0&&!isNaN(s)&&s<=0,f=l==="completed";this.computedContext={...this.computedContext,identifier:e,correct:x,incorrect:u,completed:f,variables:t}}render(){return a`<slot></slot>`}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("qti-item-context-changed",this._onItemContextChanged),this.removeEventListener("qti-assessment-item-connected",this._onAssessmentItemConnected)}};n([m(),r({context:h})],o.prototype,"computedContext",2),n([m(),r({context:p})],o.prototype,"configContext",2),o=n([c("qti-item")],o);export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as p}from"./chunk-P6SSTAJ2.js";import{a as d,b as c}from"./chunk-O4RAJ3LM.js";import{d as a,i as m}from"./chunk-HKWYQB5Z.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-PQLJWD6V.js";import{g as S}from"./chunk-ZO5G6CHW.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 c}from"./chunk-XUJ7TXHW.js";import{a as l,b as d}from"./chunk-O4RAJ3LM.js";import{a as r,d as a,i as m}from"./chunk-HKWYQB5Z.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 @@
|
|
|
1
|
+
import{a as e}from"./chunk-522JFYKC.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 @@
|
|
|
1
|
+
import{a as l}from"./chunk-PQLJWD6V.js";import{b as a}from"./chunk-CZDMOYYF.js";import{a as m}from"./chunk-HO6JOQX4.js";import{d as o,g as r,i as n}from"./chunk-FLQBFTRW.js";import{b as i}from"./chunk-3YQMAZEO.js";import{a as s}from"./chunk-LO2NM3CE.js";var t=class extends n{createRenderRoot(){return this}connectedCallback(){super.connectedCallback();let e=this.querySelector("template");if(!e){this.myTemplate=null;return}this.myTemplate=l(e)}_switchView(e){this.dispatchEvent(new CustomEvent("on-test-switch-view",{composed:!0,bubbles:!0,detail:e}))}firstUpdated(e){this.addEventListener("click",()=>{this.sessionContext?.view==="scorer"?this._switchView("candidate"):this._switchView("scorer")})}render(){return o`${this.myTemplate?this.myTemplate({view:this.sessionContext?.view}):r}`}};s([i({context:a,subscribe:!0})],t.prototype,"sessionContext",2),t=s([m("test-view-toggle")],t);export{t as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s}from"./chunk-DP5FVJRS.js";import{a as p}from"./chunk-O4RAJ3LM.js";import{d as m,i as a}from"./chunk-HKWYQB5Z.js";import{a as l}from"./chunk-P6SSTAJ2.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 @@
|
|
|
1
|
+
import{a as f}from"./chunk-DP5FVJRS.js";import{a as b}from"./chunk-P6SSTAJ2.js";import{a as d,b as l}from"./chunk-O4RAJ3LM.js";import{d as s,g as c,i as u}from"./chunk-HKWYQB5Z.js";import{b as p}from"./chunk-3YQMAZEO.js";import{a as m}from"./chunk-LO2NM3CE.js";var r=class extends u{constructor(){super();this.view="";this.disabled=!1;this.myTemplate=null;this.addEventListener("click",e=>{let o=e.target,n=parseFloat(o.value);o.tagName==="INPUT"&&this._changeOutcomeScore(n)})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback();let e=this.querySelector("template");if(!e){this.myTemplate=null;return}this.myTemplate=f(e)}_changeOutcomeScore(e){let i=(this.computedContext?.testParts.find(t=>t.active)).sections.flatMap(t=>t.items).find(t=>t.active)?.identifier;this.dispatchEvent(new CustomEvent("test-update-outcome-variable",{detail:{assessmentItemRefId:i,outcomeVariableId:"SCORE",value:e},bubbles:!0}))}render(){let e=this.computedContext?.testParts.flatMap(a=>a.sections.flatMap(h=>h.items)).find(a=>a.active);if(!e||!e.variables)return s``;let o=e.variables.find(a=>a.identifier=="MAXSCORE")?.value,n=e.variables.find(a=>a.identifier=="SCORE"),i=n?.value,t=n?.externalScored!=="human";if(!o||!n)return c;let v=[...Array(Number(o)+1).keys()];return s`${this.myTemplate?this.myTemplate({scores:v,score:i,disabled:t}):c}`}};m([l({type:String,attribute:"view"})],r.prototype,"view",2),m([l({type:Boolean})],r.prototype,"disabled",2),m([p({context:b,subscribe:!0})],r.prototype,"computedContext",2),r=m([d("test-scoring-buttons")],r);export{r as a};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as c,b as h}from"./chunk-4DXCBZFR.js";import{a as i}from"./chunk-XUJ7TXHW.js";import{a as n,b as p,c as a}from"./chunk-O4RAJ3LM.js";import{d as s,i as o}from"./chunk-HKWYQB5Z.js";import{c as l}from"./chunk-E6IOJ4MV.js";import{a as r}from"./chunk-LO2NM3CE.js";var e=class extends o{constructor(){super(...arguments);this.testURL=null;this.testDoc=null;this.testXML=null;this.templateContent=null}async handleTestURLChange(){if(this.testURL)try{let t=await l().load(this.testURL);this.testDoc=t.htmlDoc()}catch(t){console.error("Error loading or parsing XML:",t)}}handleTestXMLChange(){if(this.testXML)try{this.testDoc=l().parse(this.testXML).htmlDoc()}catch(t){console.error("Error parsing XML:",t)}}async connectedCallback(){super.connectedCallback(),this.initializeTemplateContent(),this.applyStyles(),this.testURL&&this.handleTestURLChange(),this.testXML&&this.handleTestXMLChange()}initializeTemplateContent(){let t=this.querySelector("template");this.templateContent=t?t.content:s``}applyStyles(){let t=new CSSStyleSheet;t.replaceSync(h),this.shadowRoot.adoptedStyleSheets=[t]}render(){return s`
|
|
2
|
+
${this.templateContent}
|
|
3
|
+
<slot></slot>
|
|
4
|
+
${c(this.testDoc,s`<span>Loading...</span>`)}
|
|
5
|
+
`}};r([p({type:String,attribute:"test-url"})],e.prototype,"testURL",2),r([a()],e.prototype,"testDoc",2),r([a()],e.prototype,"testXML",2),r([i("testURL",{waitUntilFirstUpdate:!0})],e.prototype,"handleTestURLChange",1),r([i("testXML",{waitUntilFirstUpdate:!0})],e.prototype,"handleTestXMLChange",1),e=r([n("test-container")],e);export{e as a};
|