@citolab/qti-components 7.3.1 → 7.3.3
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-2F7QLIQX.js +2 -0
- package/cdn/chunks/chunk-2FHBMRTL.js +10 -0
- package/cdn/chunks/chunk-2IPVI6JS.js +8 -0
- package/cdn/chunks/chunk-2MMQH3OR.js +8 -0
- package/cdn/chunks/chunk-3OIAVUFK.js +8 -0
- package/cdn/chunks/chunk-3XOKPK45.js +2 -0
- package/cdn/chunks/chunk-5DVOEPIP.js +8 -0
- package/cdn/chunks/chunk-5PA3GEIX.js +2 -0
- package/cdn/chunks/chunk-7JO3EE5V.js +5 -0
- package/cdn/chunks/chunk-AMH674XL.js +1450 -0
- package/cdn/chunks/chunk-C26NWYVO.js +2 -0
- package/cdn/chunks/chunk-C55DPNSW.js +8 -0
- package/cdn/chunks/chunk-CIIKVJF7.js +2 -0
- package/cdn/chunks/chunk-CMGZUMGV.js +2 -0
- package/cdn/chunks/chunk-DZTNCG5K.js +2 -0
- package/cdn/chunks/chunk-E7FZUPJ2.js +8 -0
- package/cdn/chunks/chunk-H3WTP2FL.js +2 -0
- package/cdn/chunks/chunk-IEHCQ5EK.js +2 -0
- package/cdn/chunks/chunk-LGSTDI7O.js +8 -0
- package/cdn/chunks/chunk-N3YBYEEI.js +2 -0
- package/cdn/chunks/chunk-N7K6VO7F.js +1 -0
- package/cdn/chunks/chunk-NPYS4GGN.js +5 -0
- package/cdn/chunks/chunk-OGZEE7T7.js +8 -0
- package/cdn/chunks/chunk-QA3FBQSF.js +5 -0
- package/cdn/chunks/chunk-QHO7IBHQ.js +2 -0
- package/cdn/chunks/chunk-QT25DBDO.js +8 -0
- package/cdn/chunks/chunk-SSBR2KEX.js +8 -0
- package/cdn/chunks/chunk-TB7NCJUL.js +8 -0
- package/cdn/chunks/chunk-UN2WT4WS.js +2 -0
- package/cdn/chunks/chunk-V6LLE3H4.js +8 -0
- package/cdn/chunks/chunk-X5K7LBUM.js +8 -0
- package/cdn/chunks/chunk-X6XRXEW2.js +2 -0
- package/cdn/chunks/chunk-Z6WP2K4O.js +1450 -0
- package/cdn/chunks/chunk-ZKETWB2E.js +8 -0
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +1 -1
- package/cdn/qti-components/index.js +1 -1
- package/cdn/qti-test/components/index.js +1 -1
- package/cdn/qti-test/components/test-next.js +1 -1
- package/cdn/qti-test/components/test-prev.js +1 -1
- package/cdn/qti-test/components/test-scoring-feedback.js +1 -1
- package/cdn/qti-test/components/test-stamp.js +1 -1
- package/cdn/qti-test/core/index.js +1 -1
- package/dist/chunks/chunk-3IAZELYI.js +90 -0
- package/dist/chunks/chunk-3IAZELYI.js.map +1 -0
- package/dist/chunks/chunk-3YJPKRFS.js +91 -0
- package/dist/chunks/chunk-3YJPKRFS.js.map +1 -0
- package/dist/chunks/chunk-4PL7XU3H.js +82 -0
- package/dist/chunks/chunk-4PL7XU3H.js.map +1 -0
- package/dist/chunks/chunk-4YWF7QTH.js +92 -0
- package/dist/chunks/chunk-4YWF7QTH.js.map +1 -0
- package/dist/chunks/chunk-5AZFPSD4.js +87 -0
- package/dist/chunks/chunk-5AZFPSD4.js.map +1 -0
- package/dist/chunks/chunk-5OZP32ZZ.js +90 -0
- package/dist/chunks/chunk-5OZP32ZZ.js.map +1 -0
- package/dist/chunks/chunk-5SU6S5L4.js +94 -0
- package/dist/chunks/chunk-5SU6S5L4.js.map +1 -0
- package/dist/chunks/chunk-5WHKITF6.js +90 -0
- package/dist/chunks/chunk-5WHKITF6.js.map +1 -0
- package/dist/chunks/chunk-64JRMFTB.js +93 -0
- package/dist/chunks/chunk-64JRMFTB.js.map +1 -0
- package/dist/chunks/chunk-7RFWGVJR.js +109 -0
- package/dist/chunks/chunk-7RFWGVJR.js.map +1 -0
- package/dist/chunks/chunk-BAG5H6N2.js +7970 -0
- package/dist/chunks/chunk-BAG5H6N2.js.map +1 -0
- package/dist/chunks/chunk-CWT66FG4.js +95 -0
- package/dist/chunks/chunk-CWT66FG4.js.map +1 -0
- package/dist/chunks/chunk-F2JDNMKV.js +100 -0
- package/dist/chunks/chunk-F2JDNMKV.js.map +1 -0
- package/dist/chunks/chunk-F5OPIJ4X.js +90 -0
- package/dist/chunks/chunk-F5OPIJ4X.js.map +1 -0
- package/dist/chunks/chunk-FZHYC3TU.js +92 -0
- package/dist/chunks/chunk-FZHYC3TU.js.map +1 -0
- package/dist/chunks/chunk-GDNPYP37.js +85 -0
- package/dist/chunks/chunk-GDNPYP37.js.map +1 -0
- package/dist/chunks/chunk-H2HBYOZZ.js +90 -0
- package/dist/chunks/chunk-H2HBYOZZ.js.map +1 -0
- package/dist/chunks/chunk-H6RDLSTK.js +87 -0
- package/dist/chunks/chunk-H6RDLSTK.js.map +1 -0
- package/dist/chunks/chunk-IDRQNT6W.js +86 -0
- package/dist/chunks/chunk-IDRQNT6W.js.map +1 -0
- package/dist/chunks/chunk-KXDEFGCK.js +887 -0
- package/dist/chunks/chunk-KXDEFGCK.js.map +1 -0
- package/dist/chunks/chunk-KZAEUKGI.js +100 -0
- package/dist/chunks/chunk-KZAEUKGI.js.map +1 -0
- package/dist/chunks/chunk-LBL5YIK7.js +94 -0
- package/dist/chunks/chunk-LBL5YIK7.js.map +1 -0
- package/dist/chunks/chunk-LJ4KYDFF.js +56 -0
- package/dist/chunks/chunk-LJ4KYDFF.js.map +1 -0
- package/dist/chunks/chunk-LMMYXE6U.js +85 -0
- package/dist/chunks/chunk-LMMYXE6U.js.map +1 -0
- package/dist/chunks/chunk-MTWSJYVA.js +86 -0
- package/dist/chunks/chunk-MTWSJYVA.js.map +1 -0
- package/dist/chunks/chunk-OD6DYLAO.js +7940 -0
- package/dist/chunks/chunk-OD6DYLAO.js.map +1 -0
- package/dist/chunks/chunk-OLZSWYQO.js +100 -0
- package/dist/chunks/chunk-OLZSWYQO.js.map +1 -0
- package/dist/chunks/chunk-PI2VZUCF.js +91 -0
- package/dist/chunks/chunk-PI2VZUCF.js.map +1 -0
- package/dist/chunks/chunk-PRO3U224.js +91 -0
- package/dist/chunks/chunk-PRO3U224.js.map +1 -0
- package/dist/chunks/chunk-RZK54XLD.js +100 -0
- package/dist/chunks/chunk-RZK54XLD.js.map +1 -0
- package/dist/chunks/chunk-SBY26ONA.js +99 -0
- package/dist/chunks/chunk-SBY26ONA.js.map +1 -0
- package/dist/chunks/chunk-W7DAMVVM.js +90 -0
- package/dist/chunks/chunk-W7DAMVVM.js.map +1 -0
- package/dist/chunks/chunk-WH6TRM5K.js +82 -0
- package/dist/chunks/chunk-WH6TRM5K.js.map +1 -0
- package/dist/chunks/chunk-WLDX63OS.js +92 -0
- package/dist/chunks/chunk-WLDX63OS.js.map +1 -0
- package/dist/chunks/chunk-WTV3RW6F.js +91 -0
- package/dist/chunks/chunk-WTV3RW6F.js.map +1 -0
- package/dist/chunks/chunk-X5L7SQQN.js +887 -0
- package/dist/chunks/chunk-X5L7SQQN.js.map +1 -0
- package/dist/chunks/chunk-X5RBTIXP.js +86 -0
- package/dist/chunks/chunk-X5RBTIXP.js.map +1 -0
- package/dist/exports/computed-item.context.d.ts +1 -1
- package/dist/exports/computed.context.d.ts +2 -2
- package/dist/exports/interaction.d.ts +1 -1
- package/dist/exports/item.context.d.ts +1 -1
- package/dist/exports/qti-assessment-item.context.d.ts +1 -1
- package/dist/exports/qti-condition-expression.d.ts +1 -1
- package/dist/exports/qti-expression.d.ts +1 -1
- package/dist/exports/session.context.d.ts +2 -2
- package/dist/exports/test.context.d.ts +1 -1
- package/dist/exports/variables.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -7
- package/dist/qti-components/index.d.ts +2 -2
- package/dist/qti-components/index.js +1 -2
- package/dist/qti-components-jsx.d.ts +73 -12
- package/dist/qti-item/components/item-show-correct-response.d.ts +1 -1
- package/dist/qti-item/components/print-item-variables.d.ts +1 -1
- package/dist/qti-item/core/index.d.ts +1 -1
- package/dist/qti-loader/index.d.ts +1 -1
- package/dist/qti-response-declaration-pCFZA_aW.d.ts +1356 -0
- package/dist/qti-test/components/index.d.ts +2 -2
- package/dist/qti-test/components/index.js +4 -5
- package/dist/qti-test/components/test-navigation.d.ts +2 -2
- package/dist/qti-test/components/test-next.d.ts +14 -16
- package/dist/qti-test/components/test-next.js +1 -1
- package/dist/qti-test/components/test-prev.d.ts +16 -18
- package/dist/qti-test/components/test-prev.js +1 -3
- package/dist/qti-test/components/test-print-context.d.ts +2 -2
- package/dist/qti-test/components/test-print-item-variables.d.ts +2 -2
- package/dist/qti-test/components/test-scoring-buttons.d.ts +2 -2
- package/dist/qti-test/components/test-scoring-feedback.d.ts +2 -2
- package/dist/qti-test/components/test-scoring-feedback.js +1 -1
- package/dist/qti-test/components/test-show-correct-response.d.ts +2 -2
- package/dist/qti-test/components/test-stamp.d.ts +2 -2
- package/dist/qti-test/components/test-stamp.js +1 -1
- package/dist/qti-test/core/index.d.ts +3 -3
- package/dist/qti-test/core/index.js +2 -3
- package/dist/qti-test-feedback-2xjKezsY.d.ts +85 -0
- package/dist/vscode.html-custom-data.json +39 -15
- package/package.json +1 -1
package/cdn/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as dr}from"./chunks/chunk-VXQNVDBK.js";import{a as ar}from"./chunks/chunk-N5BGKNYJ.js";import{a as cr}from"./chunks/chunk-DHC7PAPQ.js";import{a as br}from"./chunks/chunk-DQTXWGN5.js";import"./chunks/chunk-TC54XTRL.js";import{a as Mo,b as No,c as Oo,d as Po,e as Qo,f as Ro}from"./chunks/chunk-NPYS4GGN.js";import"./chunks/chunk-PUI3LIFH.js";import{a as fr}from"./chunks/chunk-C26NWYVO.js";import{a as pr}from"./chunks/chunk-ODMQDF6O.js";import{a as Vo}from"./chunks/chunk-XQIN4PIX.js";import{a as Uo}from"./chunks/chunk-ZKETWB2E.js";import{a as er}from"./chunks/chunk-UZYJ2YET.js";import{a as $o}from"./chunks/chunk-FGR3JZXL.js";import{a as mr}from"./chunks/chunk-IPAFN4CK.js";import{a as tr}from"./chunks/chunk-N7K6VO7F.js";import{a as or}from"./chunks/chunk-AA47N7CH.js";import{a as rr}from"./chunks/chunk-GFVOBN7D.js";import{a as Yo}from"./chunks/chunk-4HPXSOYI.js";import{a as xr}from"./chunks/chunk-3KGTXIVH.js";import{a as _o}from"./chunks/chunk-EZJSKOLP.js";import{a as Xo}from"./chunks/chunk-SDWXKOZK.js";import{a as Wo}from"./chunks/chunk-TDS4LYUD.js";import{a as So}from"./chunks/chunk-5EXLLJZQ.js";import{a as To}from"./chunks/chunk-V6LLE3H4.js";import"./chunks/chunk-U5Y5T4ZS.js";import{a as Zo}from"./chunks/chunk-YXZ773BI.js";import"./chunks/chunk-IEOQ2ZTN.js";import"./chunks/chunk-D4A6UBNV.js";import"./chunks/chunk-CZDMOYYF.js";import{a as Ko,b as Lo}from"./chunks/chunk-QQR6POPY.js";import{$ as eo,A as D,Aa as Eo,B as E,Ba as Fo,C as F,Ca as Go,D as G,Da as Ho,E as H,Ea as Io,F as I,Fa as Jo,G as J,H as K,I as L,J as M,K as N,L as O,M as P,N as Q,O as R,P as S,Q as T,R as U,S as V,T as W,U as X,V as Y,W as Z,X as _,Y as $,Z as oo,_ as ro,a as o,aa as fo,b as m,ba as mo,c as p,ca as po,d as t,da as to,e as x,ea as xo,f as a,fa as ao,g as b,ga as bo,h as c,ha as co,i as d,ia as go,j as g,ja as ho,k as h,ka as io,l as i,la as jo,m as j,ma as ko,n as k,na as lo,o as l,oa as no,p as n,pa as qo,q,qa as so,r as s,ra as uo,s as u,sa as vo,t as v,ta as wo,u as w,ua as yo,v as y,va as zo,w as z,wa as Ao,x as A,xa as Bo,y as B,ya as Co,z as C,za as Do}from"./chunks/chunk-Z6WP2K4O.js";import"./chunks/chunk-6BGG2JJR.js";import"./chunks/chunk-XUJ7TXHW.js";import"./chunks/chunk-4NRLYCX4.js";import"./chunks/chunk-65EW446C.js";import"./chunks/chunk-QQCGUVEV.js";import{a as gr,b as hr}from"./chunks/chunk-4VDQDT6F.js";import{a as r,b as e,c as f}from"./chunks/chunk-ULI6NOVG.js";import"./chunks/chunk-TCHROQU3.js";import"./chunks/chunk-P6SSTAJ2.js";import"./chunks/chunk-7WJYJA45.js";import"./chunks/chunk-KP5NLKZ5.js";import"./chunks/chunk-42P7F3FC.js";import"./chunks/chunk-65CZNGQC.js";import"./chunks/chunk-KWPDTFYH.js";import"./chunks/chunk-IAP2CEE7.js";export{Ko as INITIAL_TEST_CONTEXT,ar as ItemContainer,cr as ItemShowCorrectResponse,br as PrintItemVariables,oo as QtiAnd,o as QtiAssessmentItem,No as QtiAssessmentItemRef,Oo as QtiAssessmentSection,m as QtiAssessmentStimulusRef,Po as QtiAssessmentTest,c as QtiAssociableHotspot,d as QtiAssociateInteraction,eo as QtiBaseValue,g as QtiChoiceInteraction,p as QtiCompanionMaterialsInfo,fo as QtiContains,Fo as QtiContentBody,mo as QtiCorrect,h as QtiCustomInteraction,t as QtiCustomOperator,Eo as QtiDelete,i as QtiEndAttemptInteraction,to as QtiEqual,po as QtiEqualRounded,j as QtiExtendedTextInteraction,x as QtiFeedbackBlock,a as QtiFeedbackInline,q as QtiGap,k as QtiGapImg,l as QtiGapMatchInteraction,n as QtiGapText,s as QtiGraphicAssociateInteraction,u as QtiGraphicGapMatchInteraction,v as QtiGraphicOrderInteraction,xo as QtiGt,ao as QtiGte,w as QtiHotspotChoice,y as QtiHotspotInteraction,A as QtiHottext,z as QtiHottextInteraction,C as QtiInlineChoice,B as QtiInlineChoiceInteraction,bo as QtiIsNull,dr as QtiItem,P as QtiItemBody,V as QtiLookupOutcomeValue,co as QtiLt,go as QtiLte,ho as QtiMapResponse,io as QtiMapResponsePoint,jo as QtiMatch,E as QtiMatchInteraction,F as QtiMediaInteraction,ko as QtiMember,b as QtiModalFeedback,lo as QtiMultiple,no as QtiNot,qo as QtiOr,G as QtiOrderInteraction,so as QtiOrdered,Io as QtiOutcomeDeclaration,Q as QtiOutcomeProcessing,R as QtiOutcomeProcessingProcessor,H as QtiPortableCustomInteraction,I as QtiPositionObjectInteraction,J as QtiPositionObjectStage,uo as QtiPrintedVariable,vo as QtiProduct,S as QtiPrompt,Do as QtiRandom,W as QtiResponseCondition,Jo as QtiResponseDeclaration,Z as QtiResponseElse,$ as QtiResponseElseIf,_ as QtiResponseIf,T as QtiResponseProcessing,Go as QtiRubricBlock,U as QtiRule,K as QtiSelectPointInteraction,X as QtiSetOutcomeValue,Y as QtiSetOutcomeValueRule,D as QtiSimpleAssociableChoice,L as QtiSimpleChoice,M as QtiSliderInteraction,zo as QtiStringMatch,Ho as QtiStylesheet,wo as QtiSubtract,Ao as QtiSum,Bo as QtiSumExpression,Mo as QtiTest,Ro as QtiTestFeedback,Qo as QtiTestPart,N as QtiTextEntryInteraction,O as QtiUploadInteraction,Co as QtiVariable,xr as TestCheckItem,_o as TestContainer,Xo as TestEndAttempt,Wo as TestItemLink,So as TestNavigation,To as TestNext,Zo as TestPagingButtonsStamp,Uo as TestPrev,er as TestPrintContext,$o as TestPrintVariables,mr as TestScoringButtons,tr as TestScoringFeedback,or as TestSectionButtonsStamp,rr as TestSectionLink,Yo as TestShowCorrectResponse,fr as TestStamp,Vo as TestView,pr as TestViewToggle,hr as getItemByUri,gr as getManifestInfo,ro as qtiAndMixin,yo as qtiSubtractMixin,r as qtiTransformItem,e as qtiTransformManifest,f as qtiTransformTest,Lo as testContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$,A,Aa,B,Ba,C,Ca,D,Da,E,Ea,F,Fa,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,_,a,aa,b,ba,c,ca,d,da,e,ea,f,fa,g,ga,h,ha,i,ia,j,ja,k,ka,l,la,m,ma,n,na,o,oa,p,pa,q,qa,r,ra,s,sa,t,ta,u,ua,v,va,w,wa,x,xa,y,ya,z,za}from"../chunks/chunk-
|
|
1
|
+
import{$,A,Aa,B,Ba,C,Ca,D,Da,E,Ea,F,Fa,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,_,a,aa,b,ba,c,ca,d,da,e,ea,f,fa,g,ga,h,ha,i,ia,j,ja,k,ka,l,la,m,ma,n,na,o,oa,p,pa,q,qa,r,ra,s,sa,t,ta,u,ua,v,va,w,wa,x,xa,y,ya,z,za}from"../chunks/chunk-Z6WP2K4O.js";import"../chunks/chunk-6BGG2JJR.js";import"../chunks/chunk-XUJ7TXHW.js";import"../chunks/chunk-4NRLYCX4.js";import"../chunks/chunk-65EW446C.js";import"../chunks/chunk-QQCGUVEV.js";import"../chunks/chunk-ULI6NOVG.js";import"../chunks/chunk-7WJYJA45.js";import"../chunks/chunk-KP5NLKZ5.js";import"../chunks/chunk-42P7F3FC.js";import"../chunks/chunk-65CZNGQC.js";import"../chunks/chunk-KWPDTFYH.js";import"../chunks/chunk-IAP2CEE7.js";export{Z as QtiAnd,a as QtiAssessmentItem,b as QtiAssessmentStimulusRef,h as QtiAssociableHotspot,i as QtiAssociateInteraction,$ as QtiBaseValue,j as QtiChoiceInteraction,c as QtiCompanionMaterialsInfo,aa as QtiContains,Ba as QtiContentBody,ba as QtiCorrect,k as QtiCustomInteraction,d as QtiCustomOperator,Aa as QtiDelete,l as QtiEndAttemptInteraction,da as QtiEqual,ca as QtiEqualRounded,m as QtiExtendedTextInteraction,e as QtiFeedbackBlock,f as QtiFeedbackInline,q as QtiGap,n as QtiGapImg,o as QtiGapMatchInteraction,p as QtiGapText,r as QtiGraphicAssociateInteraction,s as QtiGraphicGapMatchInteraction,t as QtiGraphicOrderInteraction,ea as QtiGt,fa as QtiGte,u as QtiHotspotChoice,v as QtiHotspotInteraction,x as QtiHottext,w as QtiHottextInteraction,z as QtiInlineChoice,y as QtiInlineChoiceInteraction,ga as QtiIsNull,M as QtiItemBody,S as QtiLookupOutcomeValue,ha as QtiLt,ia as QtiLte,ja as QtiMapResponse,ka as QtiMapResponsePoint,la as QtiMatch,B as QtiMatchInteraction,C as QtiMediaInteraction,ma as QtiMember,g as QtiModalFeedback,na as QtiMultiple,oa as QtiNot,pa as QtiOr,D as QtiOrderInteraction,qa as QtiOrdered,Ea as QtiOutcomeDeclaration,N as QtiOutcomeProcessing,O as QtiOutcomeProcessingProcessor,E as QtiPortableCustomInteraction,F as QtiPositionObjectInteraction,G as QtiPositionObjectStage,ra as QtiPrintedVariable,sa as QtiProduct,P as QtiPrompt,za as QtiRandom,T as QtiResponseCondition,Fa as QtiResponseDeclaration,W as QtiResponseElse,Y as QtiResponseElseIf,X as QtiResponseIf,Q as QtiResponseProcessing,Ca as QtiRubricBlock,R as QtiRule,H as QtiSelectPointInteraction,U as QtiSetOutcomeValue,V as QtiSetOutcomeValueRule,A as QtiSimpleAssociableChoice,I as QtiSimpleChoice,J as QtiSliderInteraction,va as QtiStringMatch,Da as QtiStylesheet,ta as QtiSubtract,wa as QtiSum,xa as QtiSumExpression,K as QtiTextEntryInteraction,L as QtiUploadInteraction,ya as QtiVariable,_ as qtiAndMixin,ua as qtiSubtractMixin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunks/chunk-PUI3LIFH.js";import{a as
|
|
1
|
+
import"../../chunks/chunk-PUI3LIFH.js";import{a as n}from"../../chunks/chunk-C26NWYVO.js";import{a as p}from"../../chunks/chunk-ODMQDF6O.js";import{a as d}from"../../chunks/chunk-XQIN4PIX.js";import{a as c}from"../../chunks/chunk-ZKETWB2E.js";import{a as m}from"../../chunks/chunk-UZYJ2YET.js";import{a as j}from"../../chunks/chunk-FGR3JZXL.js";import{a as o}from"../../chunks/chunk-IPAFN4CK.js";import{a as q}from"../../chunks/chunk-N7K6VO7F.js";import{a as k}from"../../chunks/chunk-AA47N7CH.js";import{a as l}from"../../chunks/chunk-GFVOBN7D.js";import{a as g}from"../../chunks/chunk-4HPXSOYI.js";import{a as r}from"../../chunks/chunk-3KGTXIVH.js";import{a as i}from"../../chunks/chunk-EZJSKOLP.js";import{a as f}from"../../chunks/chunk-SDWXKOZK.js";import{a as e}from"../../chunks/chunk-TDS4LYUD.js";import{a}from"../../chunks/chunk-5EXLLJZQ.js";import{a as b}from"../../chunks/chunk-V6LLE3H4.js";import"../../chunks/chunk-U5Y5T4ZS.js";import{a as h}from"../../chunks/chunk-YXZ773BI.js";import"../../chunks/chunk-IEOQ2ZTN.js";import"../../chunks/chunk-D4A6UBNV.js";import"../../chunks/chunk-CZDMOYYF.js";import"../../chunks/chunk-QQR6POPY.js";import"../../chunks/chunk-6BGG2JJR.js";import"../../chunks/chunk-XUJ7TXHW.js";import"../../chunks/chunk-ULI6NOVG.js";import"../../chunks/chunk-P6SSTAJ2.js";import"../../chunks/chunk-7WJYJA45.js";import"../../chunks/chunk-42P7F3FC.js";import"../../chunks/chunk-65CZNGQC.js";import"../../chunks/chunk-IAP2CEE7.js";export{r as TestCheckItem,i as TestContainer,f as TestEndAttempt,e as TestItemLink,a as TestNavigation,b as TestNext,h as TestPagingButtonsStamp,c as TestPrev,m as TestPrintContext,j as TestPrintVariables,o as TestScoringButtons,q as TestScoringFeedback,k as TestSectionButtonsStamp,l as TestSectionLink,g as TestShowCorrectResponse,n as TestStamp,d as TestView,p as TestViewToggle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunks/chunk-
|
|
1
|
+
import{a}from"../../chunks/chunk-V6LLE3H4.js";import"../../chunks/chunk-U5Y5T4ZS.js";import"../../chunks/chunk-P6SSTAJ2.js";import"../../chunks/chunk-7WJYJA45.js";import"../../chunks/chunk-42P7F3FC.js";import"../../chunks/chunk-65CZNGQC.js";import"../../chunks/chunk-IAP2CEE7.js";export{a as TestNext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunks/chunk-
|
|
1
|
+
import{a}from"../../chunks/chunk-ZKETWB2E.js";import"../../chunks/chunk-U5Y5T4ZS.js";import"../../chunks/chunk-P6SSTAJ2.js";import"../../chunks/chunk-7WJYJA45.js";import"../../chunks/chunk-42P7F3FC.js";import"../../chunks/chunk-65CZNGQC.js";import"../../chunks/chunk-IAP2CEE7.js";export{a as TestPrev};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunks/chunk-
|
|
1
|
+
import{a}from"../../chunks/chunk-N7K6VO7F.js";import"../../chunks/chunk-P6SSTAJ2.js";import"../../chunks/chunk-7WJYJA45.js";import"../../chunks/chunk-42P7F3FC.js";import"../../chunks/chunk-65CZNGQC.js";import"../../chunks/chunk-IAP2CEE7.js";export{a as TestScoringFeedback};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunks/chunk-
|
|
1
|
+
import{a}from"../../chunks/chunk-C26NWYVO.js";import"../../chunks/chunk-D4A6UBNV.js";import"../../chunks/chunk-P6SSTAJ2.js";import"../../chunks/chunk-7WJYJA45.js";import"../../chunks/chunk-42P7F3FC.js";import"../../chunks/chunk-65CZNGQC.js";import"../../chunks/chunk-IAP2CEE7.js";export{a as TestStamp};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c,b as d,c as e,d as f,e as g,f as h}from"../../chunks/chunk-
|
|
1
|
+
import{a as c,b as d,c as e,d as f,e as g,f as h}from"../../chunks/chunk-NPYS4GGN.js";import"../../chunks/chunk-D4A6UBNV.js";import"../../chunks/chunk-CZDMOYYF.js";import{a,b}from"../../chunks/chunk-QQR6POPY.js";import"../../chunks/chunk-Z6WP2K4O.js";import"../../chunks/chunk-6BGG2JJR.js";import"../../chunks/chunk-XUJ7TXHW.js";import"../../chunks/chunk-4NRLYCX4.js";import"../../chunks/chunk-65EW446C.js";import"../../chunks/chunk-QQCGUVEV.js";import"../../chunks/chunk-ULI6NOVG.js";import"../../chunks/chunk-7WJYJA45.js";import"../../chunks/chunk-KP5NLKZ5.js";import"../../chunks/chunk-42P7F3FC.js";import"../../chunks/chunk-65CZNGQC.js";import"../../chunks/chunk-KWPDTFYH.js";import"../../chunks/chunk-IAP2CEE7.js";export{a as INITIAL_TEST_CONTEXT,d as QtiAssessmentItemRef,e as QtiAssessmentSection,f as QtiAssessmentTest,c as QtiTest,h as QtiTestFeedback,g as QtiTestPart,b as testContext};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computedContext
|
|
3
|
+
} from "./chunk-AZIKAG7K.js";
|
|
4
|
+
import {
|
|
5
|
+
__decorateClass
|
|
6
|
+
} from "./chunk-H2JE6IVU.js";
|
|
7
|
+
|
|
8
|
+
// src/lib/qti-test/components/test-stamp.ts
|
|
9
|
+
import { html, LitElement, nothing } from "lit";
|
|
10
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
11
|
+
import { prepareTemplate } from "stampino";
|
|
12
|
+
import { consume } from "@lit/context";
|
|
13
|
+
var TestStamp = class extends LitElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.debug = false;
|
|
17
|
+
this.stampContext = {
|
|
18
|
+
view: "candidate",
|
|
19
|
+
activeItem: {},
|
|
20
|
+
activeSection: {
|
|
21
|
+
items: []
|
|
22
|
+
},
|
|
23
|
+
activeTestpart: {
|
|
24
|
+
items: []
|
|
25
|
+
},
|
|
26
|
+
test: {}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
createRenderRoot() {
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
connectedCallback() {
|
|
33
|
+
super.connectedCallback();
|
|
34
|
+
const templateElement = this.querySelector("template");
|
|
35
|
+
if (!templateElement) {
|
|
36
|
+
this.myTemplate = null;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
this.myTemplate = prepareTemplate(templateElement);
|
|
40
|
+
}
|
|
41
|
+
willUpdate(_changedProperties) {
|
|
42
|
+
if (!this.computedContext) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const activeTestPart = this.computedContext.testParts.find((testPart) => testPart.active);
|
|
46
|
+
const activeSection = activeTestPart?.sections.find((section) => section.active);
|
|
47
|
+
const activeItem = activeSection?.items.find((item) => item.active);
|
|
48
|
+
const { variables, ...augmentedItem } = activeItem || {};
|
|
49
|
+
const augmentedTestPart = {
|
|
50
|
+
...activeTestPart,
|
|
51
|
+
items: activeTestPart.sections.flatMap((section) => section.items.map(({ variables: variables2, ...rest }) => rest)),
|
|
52
|
+
sections: activeTestPart.sections.map((section) => ({
|
|
53
|
+
...section,
|
|
54
|
+
items: section.items.map(({ variables: variables2, ...rest }) => rest)
|
|
55
|
+
}))
|
|
56
|
+
};
|
|
57
|
+
console.log("activeTestPart", activeTestPart);
|
|
58
|
+
const augmentedSection = { ...activeSection, items: activeSection.items.map(({ variables: variables2, ...rest }) => rest) };
|
|
59
|
+
const { testParts, ...activeTest } = this.computedContext;
|
|
60
|
+
this.stampContext = {
|
|
61
|
+
view: this.computedContext.view,
|
|
62
|
+
activeItem: augmentedItem,
|
|
63
|
+
activeSection: augmentedSection,
|
|
64
|
+
activeTestpart: augmentedTestPart,
|
|
65
|
+
test: activeTest
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
render() {
|
|
69
|
+
return html` ${this.debug ? html`<small><pre>${JSON.stringify(this.stampContext, null, 2)}</pre></small>` : nothing}
|
|
70
|
+
${this.myTemplate ? this.myTemplate(this.stampContext) : nothing}`;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
__decorateClass([
|
|
74
|
+
property({ type: Boolean, reflect: true })
|
|
75
|
+
], TestStamp.prototype, "debug", 2);
|
|
76
|
+
__decorateClass([
|
|
77
|
+
state(),
|
|
78
|
+
consume({ context: computedContext, subscribe: true })
|
|
79
|
+
], TestStamp.prototype, "computedContext", 2);
|
|
80
|
+
__decorateClass([
|
|
81
|
+
state()
|
|
82
|
+
], TestStamp.prototype, "stampContext", 2);
|
|
83
|
+
TestStamp = __decorateClass([
|
|
84
|
+
customElement("test-stamp")
|
|
85
|
+
], TestStamp);
|
|
86
|
+
|
|
87
|
+
export {
|
|
88
|
+
TestStamp
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=chunk-3IAZELYI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-test/components/test-stamp.ts"],"sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { prepareTemplate } from 'stampino';\nimport { consume } from '@lit/context';\n\nimport { computedContext } from '../../exports/computed.context';\n\nimport type { View } from '../core/mixins/test-view.mixin';\nimport type { PropertyValues } from 'lit';\nimport type { ComputedContext } from '../../exports/computed.context';\nimport type { TemplateFunction } from 'stampino';\n\n/**\n * A custom web component that renders a test stamp using the Lit framework.\n * This component is deprecated and will be removed in the future.\n * @customElement\n * @extends {LitElement}\n */\n@customElement('test-stamp')\nexport class TestStamp extends LitElement {\n /**\n * Indicates whether the component is in debug mode.\n * When set to `true`, the available objects and properties (i.e.: stampContext) is displayed.\n */\n @property({ type: Boolean, reflect: true })\n public debug = false;\n\n @state()\n @consume({ context: computedContext, subscribe: true })\n private computedContext: ComputedContext;\n\n @state()\n private stampContext: {\n view?: View;\n test?: unknown;\n activeTestpart?: unknown;\n activeSection?: unknown;\n activeItem?: unknown;\n } = {\n view: 'candidate',\n activeItem: {},\n activeSection: {\n items: []\n },\n activeTestpart: {\n items: []\n },\n test: {}\n };\n\n myTemplate: TemplateFunction;\n\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n const templateElement = this.querySelector<HTMLTemplateElement>('template');\n if (!templateElement) {\n this.myTemplate = null;\n return;\n }\n this.myTemplate = prepareTemplate(templateElement);\n }\n\n protected willUpdate(_changedProperties: PropertyValues): void {\n if (!this.computedContext) {\n return;\n }\n const activeTestPart = this.computedContext.testParts.find(testPart => testPart.active);\n const activeSection = activeTestPart?.sections.find(section => section.active);\n const activeItem = activeSection?.items.find(item => item.active);\n const { variables, ...augmentedItem } = activeItem || {};\n\n // if (!activeTestPart || !activeSection || !activeItem) {\n // this.stampContext = null;\n // return;\n // }\n\n const augmentedTestPart = {\n ...activeTestPart,\n items: activeTestPart.sections.flatMap(section => section.items.map(({ variables, ...rest }) => rest)),\n sections: activeTestPart.sections.map(section => ({\n ...section,\n items: section.items.map(({ variables, ...rest }) => rest)\n }))\n };\n\n console.log('activeTestPart', activeTestPart);\n\n const augmentedSection = { ...activeSection, items: activeSection.items.map(({ variables, ...rest }) => rest) };\n const { testParts, ...activeTest } = this.computedContext;\n\n this.stampContext = {\n view: this.computedContext.view,\n activeItem: augmentedItem,\n activeSection: augmentedSection,\n activeTestpart: augmentedTestPart,\n test: activeTest\n };\n }\n\n render() {\n // if (!this.stampContext) return nothing;\n return html` ${this.debug ? html`<small><pre>${JSON.stringify(this.stampContext, null, 2)}</pre></small>` : nothing}\n ${this.myTemplate ? this.myTemplate(this.stampContext) : nothing}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-stamp': TestStamp;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,MAAM,YAAY,eAAe;AAC1C,SAAS,eAAe,UAAU,aAAa;AAC/C,SAAS,uBAAuB;AAChC,SAAS,eAAe;AAgBjB,IAAM,YAAN,cAAwB,WAAW;AAAA,EAAnC;AAAA;AAML,SAAO,QAAQ;AAOf,SAAQ,eAMJ;AAAA,MACF,MAAM;AAAA,MACN,YAAY,CAAC;AAAA,MACb,eAAe;AAAA,QACb,OAAO,CAAC;AAAA,MACV;AAAA,MACA,gBAAgB;AAAA,QACd,OAAO,CAAC;AAAA,MACV;AAAA,MACA,MAAM,CAAC;AAAA,IACT;AAAA;AAAA,EAIU,mBAAmD;AAC3D,WAAO;AAAA,EACT;AAAA,EAEA,oBAA0B;AACxB,UAAM,kBAAkB;AACxB,UAAM,kBAAkB,KAAK,cAAmC,UAAU;AAC1E,QAAI,CAAC,iBAAiB;AACpB,WAAK,aAAa;AAClB;AAAA,IACF;AACA,SAAK,aAAa,gBAAgB,eAAe;AAAA,EACnD;AAAA,EAEU,WAAW,oBAA0C;AAC7D,QAAI,CAAC,KAAK,i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,MAAM;AAAA,EACN,QAAQ,EAAE,SAAS,iBAAiB,WAAW,KAAK,CAAC;AAAA,GAT3C,UAUH;AAGA;AAAA,EADP,MAAM;AAAA,GAZI,UAaH;AAbG,YAAN;AAAA,EADN,cAAc,YAAY;AAAA,GACd;","names":["variables"]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computedContext
|
|
3
|
+
} from "./chunk-AZIKAG7K.js";
|
|
4
|
+
import {
|
|
5
|
+
__decorateClass
|
|
6
|
+
} from "./chunk-H2JE6IVU.js";
|
|
7
|
+
|
|
8
|
+
// src/lib/qti-test/components/test-stamp.ts
|
|
9
|
+
import { html, LitElement, nothing } from "lit";
|
|
10
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
11
|
+
import { prepareTemplate } from "stampino";
|
|
12
|
+
import { consume } from "@lit/context";
|
|
13
|
+
var TestStamp = class extends LitElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.debug = false;
|
|
17
|
+
this.stampContext = {
|
|
18
|
+
view: "candidate",
|
|
19
|
+
activeItem: {},
|
|
20
|
+
activeSection: {
|
|
21
|
+
items: []
|
|
22
|
+
},
|
|
23
|
+
activeTestpart: {
|
|
24
|
+
items: []
|
|
25
|
+
},
|
|
26
|
+
test: {}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
createRenderRoot() {
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
connectedCallback() {
|
|
33
|
+
super.connectedCallback();
|
|
34
|
+
const templateElement = this.querySelector("template");
|
|
35
|
+
if (!templateElement) {
|
|
36
|
+
this.myTemplate = null;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
this.myTemplate = prepareTemplate(templateElement);
|
|
40
|
+
}
|
|
41
|
+
willUpdate(_changedProperties) {
|
|
42
|
+
if (!this.computedContext) {
|
|
43
|
+
this.stampContext = null;
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const activeTestPart = this.computedContext.testParts.find((testPart) => testPart.active);
|
|
47
|
+
const activeSection = activeTestPart?.sections.find((section) => section.active);
|
|
48
|
+
const activeItem = activeSection?.items.find((item) => item.active);
|
|
49
|
+
const { variables, ...augmentedItem } = activeItem || {};
|
|
50
|
+
const augmentedTestPart = {
|
|
51
|
+
...activeTestPart,
|
|
52
|
+
items: activeTestPart.sections.flatMap((section) => section.items.map(({ variables: variables2, ...rest }) => rest)),
|
|
53
|
+
sections: activeTestPart.sections.map((section) => ({
|
|
54
|
+
...section,
|
|
55
|
+
items: section.items.map(({ variables: variables2, ...rest }) => rest)
|
|
56
|
+
}))
|
|
57
|
+
};
|
|
58
|
+
console.log("activeTestPart", activeTestPart);
|
|
59
|
+
const augmentedSection = { ...activeSection, items: activeSection.items.map(({ variables: variables2, ...rest }) => rest) };
|
|
60
|
+
const { testParts, ...activeTest } = this.computedContext;
|
|
61
|
+
this.stampContext = {
|
|
62
|
+
view: this.computedContext.view,
|
|
63
|
+
activeItem: augmentedItem,
|
|
64
|
+
activeSection: augmentedSection,
|
|
65
|
+
activeTestpart: augmentedTestPart,
|
|
66
|
+
test: activeTest
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
render() {
|
|
70
|
+
return html` ${this.debug ? html`<small><pre>${JSON.stringify(this.stampContext, null, 2)}</pre></small>` : nothing}
|
|
71
|
+
${this.myTemplate ? this.myTemplate(this.stampContext) : nothing}`;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
__decorateClass([
|
|
75
|
+
property({ type: Boolean, reflect: true })
|
|
76
|
+
], TestStamp.prototype, "debug", 2);
|
|
77
|
+
__decorateClass([
|
|
78
|
+
state(),
|
|
79
|
+
consume({ context: computedContext, subscribe: true })
|
|
80
|
+
], TestStamp.prototype, "computedContext", 2);
|
|
81
|
+
__decorateClass([
|
|
82
|
+
state()
|
|
83
|
+
], TestStamp.prototype, "stampContext", 2);
|
|
84
|
+
TestStamp = __decorateClass([
|
|
85
|
+
customElement("test-stamp")
|
|
86
|
+
], TestStamp);
|
|
87
|
+
|
|
88
|
+
export {
|
|
89
|
+
TestStamp
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=chunk-3YJPKRFS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-test/components/test-stamp.ts"],"sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { prepareTemplate } from 'stampino';\nimport { consume } from '@lit/context';\n\nimport { computedContext } from '../../exports/computed.context';\n\nimport type { View } from '../core/mixins/test-view.mixin';\nimport type { PropertyValues } from 'lit';\nimport type { ComputedContext } from '../../exports/computed.context';\nimport type { TemplateFunction } from 'stampino';\n\n/**\n * A custom web component that renders a test stamp using the Lit framework.\n * This component is deprecated and will be removed in the future.\n * @customElement\n * @extends {LitElement}\n */\n@customElement('test-stamp')\nexport class TestStamp extends LitElement {\n /**\n * Indicates whether the component is in debug mode.\n * When set to `true`, the available objects and properties (i.e.: stampContext) is displayed.\n */\n @property({ type: Boolean, reflect: true })\n public debug = false;\n\n @state()\n @consume({ context: computedContext, subscribe: true })\n private computedContext: ComputedContext;\n\n @state()\n private stampContext: {\n view?: View;\n test?: unknown;\n activeTestpart?: unknown;\n activeSection?: unknown;\n activeItem?: unknown;\n } = {\n view: 'candidate',\n activeItem: {},\n activeSection: {\n items: []\n },\n activeTestpart: {\n items: []\n },\n test: {}\n };\n\n myTemplate: TemplateFunction;\n\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n const templateElement = this.querySelector<HTMLTemplateElement>('template');\n if (!templateElement) {\n this.myTemplate = null;\n return;\n }\n this.myTemplate = prepareTemplate(templateElement);\n }\n\n protected willUpdate(_changedProperties: PropertyValues): void {\n if (!this.computedContext) {\n this.stampContext = null;\n return;\n }\n const activeTestPart = this.computedContext.testParts.find(testPart => testPart.active);\n const activeSection = activeTestPart?.sections.find(section => section.active);\n const activeItem = activeSection?.items.find(item => item.active);\n const { variables, ...augmentedItem } = activeItem || {};\n\n // if (!activeTestPart || !activeSection || !activeItem) {\n // this.stampContext = null;\n // return;\n // }\n\n const augmentedTestPart = {\n ...activeTestPart,\n items: activeTestPart.sections.flatMap(section => section.items.map(({ variables, ...rest }) => rest)),\n sections: activeTestPart.sections.map(section => ({\n ...section,\n items: section.items.map(({ variables, ...rest }) => rest)\n }))\n };\n\n console.log('activeTestPart', activeTestPart);\n\n const augmentedSection = { ...activeSection, items: activeSection.items.map(({ variables, ...rest }) => rest) };\n const { testParts, ...activeTest } = this.computedContext;\n\n this.stampContext = {\n view: this.computedContext.view,\n activeItem: augmentedItem,\n activeSection: augmentedSection,\n activeTestpart: augmentedTestPart,\n test: activeTest\n };\n }\n\n render() {\n // if (!this.stampContext) return nothing;\n return html` ${this.debug ? html`<small><pre>${JSON.stringify(this.stampContext, null, 2)}</pre></small>` : nothing}\n ${this.myTemplate ? this.myTemplate(this.stampContext) : nothing}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-stamp': TestStamp;\n }\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,MAAM,YAAY,eAAe;AAC1C,SAAS,eAAe,UAAU,aAAa;AAC/C,SAAS,uBAAuB;AAChC,SAAS,eAAe;AAgBjB,IAAM,YAAN,cAAwB,WAAW;AAAA,EAAnC;AAAA;AAML,SAAO,QAAQ;AAOf,SAAQ,eAMJ;AAAA,MACF,MAAM;AAAA,MACN,YAAY,CAAC;AAAA,MACb,eAAe;AAAA,QACb,OAAO,CAAC;AAAA,MACV;AAAA,MACA,gBAAgB;AAAA,QACd,OAAO,CAAC;AAAA,MACV;AAAA,MACA,MAAM,CAAC;AAAA,IACT;AAAA;AAAA,EAIU,mBAAmD;AAC3D,WAAO;AAAA,EACT;AAAA,EAEA,oBAA0B;AACxB,UAAM,kBAAkB;AACxB,UAAM,kBAAkB,KAAK,cAAmC,UAAU;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O;AAAA,MACjH,KAAK,aAAa,KAAK,WAAW,KAAK,YAAY,IAAI,OAAO;AAAA,EAClE;AACF;AApFS;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAL/B,UAMJ;AAIC;AAAA,EAFP,MAAM;AAAA,EACN,QAAQ,EAAE,SAAS,iBAAiB,WAAW,KAAK,CAAC;AAAA,GAT3C,UAUH;AAGA;AAAA,EADP,MAAM;AAAA,GAZI,UAaH;AAbG,YAAN;AAAA,EADN,cAAc,YAAY;AAAA,GACd;","names":["variables"]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import {
|
|
2
|
+
btn,
|
|
3
|
+
dis
|
|
4
|
+
} from "./chunk-5ZHHNEDA.js";
|
|
5
|
+
import {
|
|
6
|
+
computedContext
|
|
7
|
+
} from "./chunk-AZIKAG7K.js";
|
|
8
|
+
import {
|
|
9
|
+
__decorateClass
|
|
10
|
+
} from "./chunk-H2JE6IVU.js";
|
|
11
|
+
|
|
12
|
+
// src/lib/qti-test/components/test-next.ts
|
|
13
|
+
import { css, html, LitElement } from "lit";
|
|
14
|
+
import { customElement, property } from "lit/decorators.js";
|
|
15
|
+
import { consume } from "@lit/context";
|
|
16
|
+
var TestNext = class extends LitElement {
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
this.disabled = false;
|
|
20
|
+
this._internals = this.attachInternals();
|
|
21
|
+
this._internals.role = "button";
|
|
22
|
+
this._internals.ariaLabel = "Next item";
|
|
23
|
+
this.addEventListener("click", (e) => {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
if (!this.disabled) this._requestItem(this.sectionItems[this.itemIndex + 1].identifier);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
super.connectedCallback();
|
|
30
|
+
}
|
|
31
|
+
willUpdate(_changedProperties) {
|
|
32
|
+
if (!this.computedContext) return;
|
|
33
|
+
const testPart = this.computedContext?.testParts.find((testPart2) => testPart2.active);
|
|
34
|
+
if (!testPart) return;
|
|
35
|
+
this.sectionItems = testPart.sections.flatMap((section) => section.items);
|
|
36
|
+
this.itemIndex = this.sectionItems.findIndex((item) => item.active);
|
|
37
|
+
this.checkDisabled();
|
|
38
|
+
}
|
|
39
|
+
checkDisabled() {
|
|
40
|
+
const shouldBeDisabled = !this.computedContext || this.itemIndex < 0 || this.itemIndex >= this.sectionItems?.length - 1;
|
|
41
|
+
if (shouldBeDisabled) {
|
|
42
|
+
this.disabled = true;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
_requestItem(identifier) {
|
|
46
|
+
this.dispatchEvent(
|
|
47
|
+
new CustomEvent("qti-request-navigation", {
|
|
48
|
+
composed: true,
|
|
49
|
+
bubbles: true,
|
|
50
|
+
detail: {
|
|
51
|
+
type: "item",
|
|
52
|
+
id: identifier
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
return html`<slot></slot>`;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
TestNext.styles = css`
|
|
62
|
+
:host {
|
|
63
|
+
${btn};
|
|
64
|
+
}
|
|
65
|
+
:host([disabled]) {
|
|
66
|
+
${dis};
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
69
|
+
__decorateClass([
|
|
70
|
+
property({ type: Boolean, reflect: true })
|
|
71
|
+
], TestNext.prototype, "disabled", 2);
|
|
72
|
+
__decorateClass([
|
|
73
|
+
consume({ context: computedContext, subscribe: true })
|
|
74
|
+
], TestNext.prototype, "computedContext", 2);
|
|
75
|
+
TestNext = __decorateClass([
|
|
76
|
+
customElement("test-next")
|
|
77
|
+
], TestNext);
|
|
78
|
+
|
|
79
|
+
export {
|
|
80
|
+
TestNext
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=chunk-4PL7XU3H.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-test/components/test-next.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\n\nimport * as styles from './styles';\n// import { watch } from '../../decorators';\nimport { computedContext } from '../../exports/computed.context';\n\nimport type { ComputedContext, ComputedItem } from '../../exports/computed.context';\n\n/**\n * Represents a custom element for navigating to the next test item.\n *\n * @remarks\n * This element provides functionality for navigating to the next test item.\n *\n * @example\n * ```html\n * <test-next></test-next>\n * ```\n */\n@customElement('test-next')\nexport class TestNext extends LitElement {\n @property({ type: Boolean, reflect: true })\n public disabled = false;\n\n @consume({ context: computedContext, subscribe: true })\n protected computedContext: ComputedContext;\n\n sectionItems: ComputedItem[];\n itemIndex: number;\n\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n private _internals: ElementInternals;\n\n constructor() {\n super();\n\n this._internals = this.attachInternals();\n this._internals.role = 'button';\n this._internals.ariaLabel = 'Next item';\n\n this.addEventListener('click', e => {\n e.preventDefault();\n if (!this.disabled) this._requestItem(this.sectionItems[this.itemIndex + 1].identifier);\n });\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n }\n\n willUpdate(_changedProperties: Map<string | number | symbol, unknown>) {\n if (!this.computedContext) return;\n const testPart = this.computedContext?.testParts.find(testPart => testPart.active);\n if (!testPart) return;\n this.sectionItems = testPart.sections.flatMap(section => section.items);\n this.itemIndex = this.sectionItems.findIndex(item => item.active);\n this.checkDisabled();\n }\n\n checkDisabled() {\n const shouldBeDisabled =\n !this.computedContext || this.itemIndex < 0 || this.itemIndex >= this.sectionItems?.length - 1;\n if (shouldBeDisabled) {\n this.disabled = true;\n }\n }\n\n protected _requestItem(identifier: string): void {\n this.dispatchEvent(\n new CustomEvent('qti-request-navigation', {\n composed: true,\n bubbles: true,\n detail: {\n type: 'item',\n id: identifier\n }\n })\n );\n }\n\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTag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F;AAtEa,SAUJ,SAAS;AAAA;AAAA,QAEH,GAAG;AAAA;AAAA;AAAA,QAGH,GAAG;AAAA;AAAA;AAbT;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAD/B,SAEJ;AAGG;AAAA,EADT,QAAQ,EAAE,SAAS,iBAAiB,WAAW,KAAK,CAAC;AAAA,GAJ3C,SAKD;AALC,WAAN;AAAA,EADN,cAAc,WAAW;AAAA,GACb;","names":["testPart"]}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import {
|
|
2
|
+
btn,
|
|
3
|
+
dis
|
|
4
|
+
} from "./chunk-5ZHHNEDA.js";
|
|
5
|
+
import {
|
|
6
|
+
computedContext
|
|
7
|
+
} from "./chunk-AZIKAG7K.js";
|
|
8
|
+
import {
|
|
9
|
+
__decorateClass
|
|
10
|
+
} from "./chunk-H2JE6IVU.js";
|
|
11
|
+
|
|
12
|
+
// src/lib/qti-test/components/test-next.ts
|
|
13
|
+
import { css, html, LitElement } from "lit";
|
|
14
|
+
import { customElement, property } from "lit/decorators.js";
|
|
15
|
+
import { consume } from "@lit/context";
|
|
16
|
+
var TestNext = class extends LitElement {
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
this.disabled = false;
|
|
20
|
+
this._internals = this.attachInternals();
|
|
21
|
+
this._internals.role = "button";
|
|
22
|
+
this._internals.ariaLabel = "Next item";
|
|
23
|
+
this.addEventListener("click", (e) => {
|
|
24
|
+
e.preventDefault();
|
|
25
|
+
if (!this.disabled) this._requestItem(this.sectionItems[this.itemIndex + 1].identifier);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
super.connectedCallback();
|
|
30
|
+
}
|
|
31
|
+
willUpdate(_changedProperties) {
|
|
32
|
+
if (!this.computedContext) return;
|
|
33
|
+
const testPart = this.computedContext?.testParts.find((testPart2) => testPart2.active);
|
|
34
|
+
if (!testPart) return;
|
|
35
|
+
this.sectionItems = testPart.sections.flatMap((section) => section.items);
|
|
36
|
+
this.itemIndex = this.sectionItems.findIndex((item) => item.active);
|
|
37
|
+
this.checkDisabled();
|
|
38
|
+
}
|
|
39
|
+
checkDisabled() {
|
|
40
|
+
const shouldBeDisabled = !this.computedContext || this.itemIndex < 0 || this.itemIndex >= this.sectionItems?.length - 1;
|
|
41
|
+
console.log(shouldBeDisabled);
|
|
42
|
+
if (this.disabled) {
|
|
43
|
+
this.disabled = true;
|
|
44
|
+
}
|
|
45
|
+
if (!this.disabled && shouldBeDisabled) {
|
|
46
|
+
this.disabled = true;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
_requestItem(identifier) {
|
|
50
|
+
this.dispatchEvent(
|
|
51
|
+
new CustomEvent("qti-request-navigation", {
|
|
52
|
+
composed: true,
|
|
53
|
+
bubbles: true,
|
|
54
|
+
detail: {
|
|
55
|
+
type: "item",
|
|
56
|
+
id: identifier
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
render() {
|
|
62
|
+
return html`<slot></slot>`;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
// @watch('computedContext')
|
|
66
|
+
// _handleTestElementChange(_oldValue: ComputedContext, newValue: ComputedContext) {
|
|
67
|
+
// if (newValue) {
|
|
68
|
+
// this.disabled = false;
|
|
69
|
+
// }
|
|
70
|
+
// }
|
|
71
|
+
TestNext.styles = css`
|
|
72
|
+
:host {
|
|
73
|
+
${btn};
|
|
74
|
+
}
|
|
75
|
+
:host([disabled]) {
|
|
76
|
+
${dis};
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
__decorateClass([
|
|
80
|
+
property({ type: Boolean, reflect: true })
|
|
81
|
+
], TestNext.prototype, "disabled", 2);
|
|
82
|
+
__decorateClass([
|
|
83
|
+
consume({ context: computedContext, subscribe: true })
|
|
84
|
+
], TestNext.prototype, "computedContext", 2);
|
|
85
|
+
TestNext = __decorateClass([
|
|
86
|
+
customElement("test-next")
|
|
87
|
+
], TestNext);
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
TestNext
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=chunk-4YWF7QTH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-test/components/test-next.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\n\nimport * as styles from './styles';\n// import { watch } from '../../decorators';\nimport { computedContext } from '../../exports/computed.context';\n\nimport type { ComputedContext, ComputedItem } from '../../exports/computed.context';\n\n/**\n * Represents a custom element for navigating to the next test item.\n *\n * @remarks\n * This element provides functionality for navigating to the next test item.\n *\n * @example\n * ```html\n * <test-next></test-next>\n * ```\n */\n@customElement('test-next')\nexport class TestNext extends LitElement {\n @property({ type: Boolean, reflect: true })\n public disabled = false;\n\n @consume({ context: computedContext, subscribe: true })\n protected computedContext: ComputedContext;\n\n sectionItems: ComputedItem[];\n itemIndex: number;\n\n // @watch('computedContext')\n // _handleTestElementChange(_oldValue: ComputedContext, newValue: ComputedContext) {\n // if (newValue) {\n // this.disabled = false;\n // }\n // }\n\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n private _internals: ElementInternals;\n\n constructor() {\n super();\n\n this._internals = this.attachInternals();\n this._internals.role = 'button';\n this._internals.ariaLabel = 'Next item';\n\n this.addEventListener('click', e => {\n e.preventDefault();\n if (!this.disabled) this._requestItem(this.sectionItems[this.itemIndex + 1].identifier);\n });\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n }\n\n willUpdate(_changedProperties: Map<string | number | symbol, unknown>) {\n if (!this.computedContext) return;\n const testPart = this.computedContext?.testParts.find(testPart => testPart.active);\n if (!testPart) return;\n this.sectionItems = testPart.sections.flatMap(section => section.items);\n this.itemIndex = this.sectionItems.findIndex(item => item.active);\n this.checkDisabled();\n }\n\n checkDisabled() {\n const shouldBeDisabled =\n !this.computedContext || this.itemIndex < 0 || this.itemIndex >= this.sectionItems?.length - 1;\n console.log(shouldBeDisabled);\n if (this.disabled) {\n this.disabled = true;\n }\n if (!this.disabled && shouldBeDisabled) {\n this.disabled = true;\n }\n }\n\n protected _requestItem(identifier: string): void {\n this.dispatchEvent(\n new CustomEvent('qti-request-navigation', {\n composed: true,\n bubbles: true,\n detail: {\n type: 'item',\n id: identifier\n }\n })\n );\n }\n\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-next': TestNext;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,MAAM,kBAAkB;AACtC,SAAS,eAAe,gBAAgB;AACxC,SAAS,eAAe;AAoBjB,IAAM,WAAN,cAAuB,WAAW;AAAA,EA2BvC,cAAc;AACZ,UAAM;AA1BR,SAAO,WAAW;AA4BhB,SAAK,aAAa,KAAK,gBAAgB;AACvC,SAAK,WAAW,OAAO;AACvB,SAAK,WAAW,YAAY;AAE5B,SAAK,iBAAiB,SAAS,OAAK;AAClC,QAAE,eAAe;AACjB,UAAI,CAAC,KAAK,SAAU,MAAK,aAAa,KAAK,aAAa,KAAK,YAAY,CAAC,EAAE,UAAU;AAAA,IACxF,CAAC;AAAA,EACH;AAAA,EAEA,oBAA0B;AACxB,UAAM,kBAAkB;AAAA,EAC1B;AAAA,EAEA,WAAW,oBAA4D;AACrE,QAAI,CAAC,KAAK,gBAAiB;AAC3B,UAAM,WAAW,KAAK,iBAAiB,UAAU,KAAK,CAAAA,cAAYA,UAAS,MAAM;AACjF,QAAI,CAAC,SAAU;AACf,SAAK,eAAe,SAAS,SAAS,QAAQ,aAAW,QAAQ,KAAK;AACtE,SAAK,YAAY,KAAK,aAAa,UAAU,UAAQ,KAAK,MAAM;AAChE,SAAK,cAAc;AAAA,EACrB;AAAA,EAEA,gBAAgB;AACd,UAAM,mBACJ,CAAC,KAAK,mBAAmB,KAAK,YAAY,KAAK,KAAK,aAAa,KAAK,cAAc,SAAS;AAC/F,YAAQ,IAAI,gBAAgB;AAC5B,QAAI,KAAK,UAAU;AACjB,WAAK,WAAW;AAAA,IAClB;AACA,QAAI,CAAC,KAAK,YAAY,kBAAkB;AACtC,WAAK,WAAW;AAAA,IAClB;AAAA,EACF;AAAA,EAEU,aAAa,YAA0B;AAC/C,SAAK;AAAA,MACH,IAAI,YAAY,0BAA0B;AAAA,QACxC,UAAU;AAAA,QACV,SAAS;AAAA,QACT,QAAQ;AAAA,UACN,MAAM;AAAA,UACN,IAAI;AAAA,QACN;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAjFa,SAiBJ,SAAS;AAAA;AAAA,QAEH,GAAG;AAAA;AAAA;AAAA,QAGH,GAAG;AAAA;AAAA;AApBT;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAD/B,SAEJ;AAGG;AAAA,EADT,QAAQ,EAAE,SAAS,iBAAiB,WAAW,KAAK,CAAC;AAAA,GAJ3C,SAKD;AALC,WAAN;AAAA,EADN,cAAc,WAAW;AAAA,GACb;","names":["testPart"]}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computedContext
|
|
3
|
+
} from "./chunk-AZIKAG7K.js";
|
|
4
|
+
import {
|
|
5
|
+
__decorateClass
|
|
6
|
+
} from "./chunk-H2JE6IVU.js";
|
|
7
|
+
|
|
8
|
+
// src/lib/qti-test/components/test-stamp.ts
|
|
9
|
+
import { html, LitElement, nothing } from "lit";
|
|
10
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
11
|
+
import { prepareTemplate } from "stampino";
|
|
12
|
+
import { consume } from "@lit/context";
|
|
13
|
+
var TestStamp = class extends LitElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.debug = false;
|
|
17
|
+
this.stampContext = {
|
|
18
|
+
view: "candidate",
|
|
19
|
+
activeItem: {},
|
|
20
|
+
activeSection: {
|
|
21
|
+
items: []
|
|
22
|
+
},
|
|
23
|
+
activeTestpart: {
|
|
24
|
+
items: []
|
|
25
|
+
},
|
|
26
|
+
test: {}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
createRenderRoot() {
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
connectedCallback() {
|
|
33
|
+
super.connectedCallback();
|
|
34
|
+
const templateElement = this.querySelector("template");
|
|
35
|
+
if (!templateElement) {
|
|
36
|
+
this.myTemplate = null;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
this.myTemplate = prepareTemplate(templateElement);
|
|
40
|
+
}
|
|
41
|
+
willUpdate(_changedProperties) {
|
|
42
|
+
const activeTestPart = this.computedContext.testParts.find((testPart) => testPart.active);
|
|
43
|
+
const activeSection = activeTestPart?.sections.find((section) => section.active);
|
|
44
|
+
const activeItem = activeSection?.items.find((item) => item.active);
|
|
45
|
+
const { variables, ...augmentedItem } = activeItem || {};
|
|
46
|
+
const augmentedTestPart = {
|
|
47
|
+
...activeTestPart,
|
|
48
|
+
items: activeTestPart.sections.flatMap((section) => section.items.map(({ variables: variables2, ...rest }) => rest)),
|
|
49
|
+
sections: activeTestPart.sections.map((section) => ({
|
|
50
|
+
...section,
|
|
51
|
+
items: section.items.map(({ variables: variables2, ...rest }) => rest)
|
|
52
|
+
}))
|
|
53
|
+
};
|
|
54
|
+
const augmentedSection = { ...activeSection, items: activeSection.items.map(({ variables: variables2, ...rest }) => rest) };
|
|
55
|
+
const { testParts, ...activeTest } = this.computedContext;
|
|
56
|
+
this.stampContext = {
|
|
57
|
+
view: this.computedContext.view,
|
|
58
|
+
activeItem: augmentedItem,
|
|
59
|
+
activeSection: augmentedSection,
|
|
60
|
+
activeTestpart: augmentedTestPart,
|
|
61
|
+
test: activeTest
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
render() {
|
|
65
|
+
if (!this.stampContext) return nothing;
|
|
66
|
+
return html` ${this.debug ? html`<small><pre>${JSON.stringify(this.stampContext, null, 2)}</pre></small>` : nothing}
|
|
67
|
+
${this.myTemplate ? this.myTemplate(this.stampContext) : nothing}`;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
__decorateClass([
|
|
71
|
+
property({ type: Boolean, reflect: true })
|
|
72
|
+
], TestStamp.prototype, "debug", 2);
|
|
73
|
+
__decorateClass([
|
|
74
|
+
state(),
|
|
75
|
+
consume({ context: computedContext, subscribe: true })
|
|
76
|
+
], TestStamp.prototype, "computedContext", 2);
|
|
77
|
+
__decorateClass([
|
|
78
|
+
state()
|
|
79
|
+
], TestStamp.prototype, "stampContext", 2);
|
|
80
|
+
TestStamp = __decorateClass([
|
|
81
|
+
customElement("test-stamp")
|
|
82
|
+
], TestStamp);
|
|
83
|
+
|
|
84
|
+
export {
|
|
85
|
+
TestStamp
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=chunk-5AZFPSD4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-test/components/test-stamp.ts"],"sourcesContent":["import { html, LitElement, nothing } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { prepareTemplate } from 'stampino';\nimport { consume } from '@lit/context';\n\nimport { computedContext } from '../../exports/computed.context';\n\nimport type { View } from '../core/mixins/test-view.mixin';\nimport type { PropertyValues } from 'lit';\nimport type { ComputedContext } from '../../exports/computed.context';\nimport type { TemplateFunction } from 'stampino';\n\n/**\n * A custom web component that renders a test stamp using the Lit framework.\n * This component is deprecated and will be removed in the future.\n * @customElement\n * @extends {LitElement}\n */\n@customElement('test-stamp')\nexport class TestStamp extends LitElement {\n /**\n * Indicates whether the component is in debug mode.\n * When set to `true`, the available objects and properties (i.e.: stampContext) is displayed.\n */\n @property({ type: Boolean, reflect: true })\n public debug = false;\n\n @state()\n @consume({ context: computedContext, subscribe: true })\n private computedContext: ComputedContext;\n\n @state()\n private stampContext: {\n view?: View;\n test?: unknown;\n activeTestpart?: unknown;\n activeSection?: unknown;\n activeItem?: unknown;\n } = {\n view: 'candidate',\n activeItem: {},\n activeSection: {\n items: []\n },\n activeTestpart: {\n items: []\n },\n test: {}\n };\n\n myTemplate: TemplateFunction;\n\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n const templateElement = this.querySelector<HTMLTemplateElement>('template');\n if (!templateElement) {\n this.myTemplate = null;\n return;\n }\n this.myTemplate = prepareTemplate(templateElement);\n }\n\n protected willUpdate(_changedProperties: PropertyValues): void {\n // if (!this.computedContext) {\n // this.stampContext = null;\n // return;\n // }\n const activeTestPart = this.computedContext.testParts.find(testPart => testPart.active);\n const activeSection = activeTestPart?.sections.find(section => section.active);\n const activeItem = activeSection?.items.find(item => item.active);\n const { variables, ...augmentedItem } = activeItem || {};\n\n // if (!activeTestPart || !activeSection || !activeItem) {\n // this.stampContext = null;\n // return;\n // }\n\n const augmentedTestPart = {\n ...activeTestPart,\n items: activeTestPart.sections.flatMap(section => section.items.map(({ variables, ...rest }) => rest)),\n sections: activeTestPart.sections.map(section => ({\n ...section,\n items: section.items.map(({ variables, ...rest }) => rest)\n }))\n };\n\n const augmentedSection = { ...activeSection, items: activeSection.items.map(({ variables, ...rest }) => rest) };\n const { testParts, ...activeTest } = this.computedContext;\n\n this.stampContext = {\n view: this.computedContext.view,\n activeItem: augmentedItem,\n activeSection: augmentedSection,\n activeTestpart: augmentedTestPart,\n test: activeTest\n };\n }\n\n render() {\n if (!this.stampContext) return nothing;\n return html` ${this.debug ? html`<small><pre>${JSON.stringify(this.stampContext, null, 2)}</pre></small>` : nothing}\n ${this.myTemplate ? this.myTemplate(this.stampContext) : nothing}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-stamp': TestStamp;\n }\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