@citolab/qti-components 7.3.2 → 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-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-5DVOEPIP.js +8 -0
- package/cdn/chunks/chunk-7JO3EE5V.js +5 -0
- package/cdn/chunks/chunk-AMH674XL.js +1450 -0
- package/cdn/chunks/chunk-C55DPNSW.js +8 -0
- package/cdn/chunks/chunk-E7FZUPJ2.js +8 -0
- package/cdn/chunks/chunk-LGSTDI7O.js +8 -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-QT25DBDO.js +8 -0
- package/cdn/chunks/chunk-SSBR2KEX.js +8 -0
- package/cdn/chunks/chunk-TB7NCJUL.js +8 -0
- package/cdn/chunks/chunk-V6LLE3H4.js +8 -0
- package/cdn/chunks/chunk-X5K7LBUM.js +8 -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/core/index.js +1 -1
- 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-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-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-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-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-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-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-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-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 +5 -6
- 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 +3 -4
- 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/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 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-
|
|
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 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-
|
|
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 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,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 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,EAoBvC,cAAc;AACZ,UAAM;AAnBR,SAAO,WAAW;AAqBhB,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,QAAI,kBAAkB;AACpB,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;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,KA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N,cAAc,WAAW;AAAA,GACb;","names":["testPart"]}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import {
|
|
2
|
+
btn,
|
|
3
|
+
dis
|
|
4
|
+
} from "./chunk-5ZHHNEDA.js";
|
|
5
|
+
import {
|
|
6
|
+
watch
|
|
7
|
+
} from "./chunk-ELDMXTUQ.js";
|
|
8
|
+
import {
|
|
9
|
+
computedContext
|
|
10
|
+
} from "./chunk-AZIKAG7K.js";
|
|
11
|
+
import {
|
|
12
|
+
__decorateClass
|
|
13
|
+
} from "./chunk-H2JE6IVU.js";
|
|
14
|
+
|
|
15
|
+
// src/lib/qti-test/components/test-prev.ts
|
|
16
|
+
import { css, html, LitElement } from "lit";
|
|
17
|
+
import { customElement, property as property2, state } from "lit/decorators.js";
|
|
18
|
+
import { consume } from "@lit/context";
|
|
19
|
+
|
|
20
|
+
// src/lib/decorators/prop-internal-state.ts
|
|
21
|
+
import { property } from "lit/decorators.js";
|
|
22
|
+
|
|
23
|
+
// src/lib/qti-test/components/test-prev.ts
|
|
24
|
+
var TestPrev = class extends LitElement {
|
|
25
|
+
constructor() {
|
|
26
|
+
super();
|
|
27
|
+
this.disabled = true;
|
|
28
|
+
this._internallyDisabled = true;
|
|
29
|
+
this._internals = this.attachInternals();
|
|
30
|
+
this._internals.role = "button";
|
|
31
|
+
this._internals.ariaLabel = "Previous item";
|
|
32
|
+
this.addEventListener("click", (e) => {
|
|
33
|
+
e.preventDefault();
|
|
34
|
+
if (!this.effectiveDisabled) {
|
|
35
|
+
this._requestItem(this.sectionItems[this.itemIndex - 1].identifier);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
// Computed effective state
|
|
40
|
+
get effectiveDisabled() {
|
|
41
|
+
return this._internallyDisabled || this.disabled;
|
|
42
|
+
}
|
|
43
|
+
updated() {
|
|
44
|
+
if (this.effectiveDisabled) {
|
|
45
|
+
this.setAttribute("effective-disabled", "");
|
|
46
|
+
} else {
|
|
47
|
+
this.removeAttribute("effective-disabled");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
_handleTestElementChange(_oldValue, newValue) {
|
|
51
|
+
if (newValue) {
|
|
52
|
+
this.disabled = false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
willUpdate(_changedProperties) {
|
|
56
|
+
if (!this.computedContext) return;
|
|
57
|
+
const testPart = this.computedContext?.testParts.find((testPart2) => testPart2.active);
|
|
58
|
+
if (!testPart) return;
|
|
59
|
+
this.sectionItems = testPart.sections.flatMap((section) => section.items);
|
|
60
|
+
this.itemIndex = this.sectionItems.findIndex((item) => item.active);
|
|
61
|
+
this.checkDisabled();
|
|
62
|
+
}
|
|
63
|
+
checkDisabled() {
|
|
64
|
+
this._internallyDisabled = !this.computedContext || this.itemIndex <= 0 || this.itemIndex === -1;
|
|
65
|
+
}
|
|
66
|
+
_requestItem(identifier) {
|
|
67
|
+
this.dispatchEvent(
|
|
68
|
+
new CustomEvent("qti-request-navigation", {
|
|
69
|
+
composed: true,
|
|
70
|
+
bubbles: true,
|
|
71
|
+
detail: {
|
|
72
|
+
type: "item",
|
|
73
|
+
id: identifier
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
render() {
|
|
79
|
+
return html`<slot></slot>`;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
TestPrev.styles = css`
|
|
83
|
+
:host {
|
|
84
|
+
${btn};
|
|
85
|
+
}
|
|
86
|
+
:host([effective-disabled]) {
|
|
87
|
+
${dis};
|
|
88
|
+
}
|
|
89
|
+
`;
|
|
90
|
+
__decorateClass([
|
|
91
|
+
property2({ type: Boolean, reflect: true })
|
|
92
|
+
], TestPrev.prototype, "disabled", 2);
|
|
93
|
+
__decorateClass([
|
|
94
|
+
state()
|
|
95
|
+
], TestPrev.prototype, "_internallyDisabled", 2);
|
|
96
|
+
__decorateClass([
|
|
97
|
+
consume({ context: computedContext, subscribe: true })
|
|
98
|
+
], TestPrev.prototype, "computedContext", 2);
|
|
99
|
+
__decorateClass([
|
|
100
|
+
watch("computedContext")
|
|
101
|
+
], TestPrev.prototype, "_handleTestElementChange", 1);
|
|
102
|
+
TestPrev = __decorateClass([
|
|
103
|
+
customElement("test-prev")
|
|
104
|
+
], TestPrev);
|
|
105
|
+
|
|
106
|
+
export {
|
|
107
|
+
TestPrev
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=chunk-7RFWGVJR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/lib/qti-test/components/test-prev.ts","../../src/lib/decorators/prop-internal-state.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { consume } from '@lit/context';\n\nimport * as styles from './styles';\nimport { watch } from '../../decorators';\nimport { computedContext } from '../../exports/computed.context';\n\nimport type { ComputedContext, ComputedItem } from '../../exports/computed.context';\n\n@customElement('test-prev')\nexport class TestPrev extends LitElement {\n // External control\n @property({ type: Boolean, reflect: true })\n public disabled = true;\n\n // Internal logic override\n @state()\n private _internallyDisabled = true;\n\n @consume({ context: computedContext, subscribe: true })\n private computedContext: ComputedContext;\n\n sectionItems: ComputedItem[];\n itemIndex: number;\n\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([effective-disabled]) {\n ${styles.dis};\n }\n `;\n\n private _internals: ElementInternals;\n\n constructor() {\n super();\n this._internals = this.attachInternals();\n this._internals.role = 'button';\n this._internals.ariaLabel = 'Previous item';\n\n this.addEventListener('click', e => {\n e.preventDefault();\n if (!this.effectiveDisabled) {\n this._requestItem(this.sectionItems[this.itemIndex - 1].identifier);\n }\n });\n }\n\n // Computed effective state\n get effectiveDisabled() {\n return this._internallyDisabled || this.disabled;\n }\n\n updated() {\n // Reflect effective state as attribute for styling\n if (this.effectiveDisabled) {\n this.setAttribute('effective-disabled', '');\n } else {\n this.removeAttribute('effective-disabled');\n }\n }\n\n @watch('computedContext')\n _handleTestElementChange(_oldValue: ComputedContext, newValue: ComputedContext) {\n if (newValue) {\n this.disabled = false;\n }\n }\n\n willUpdate(_changedProperties: Map<string | number | symbol, unknown>) {\n if (!this.computedContext) return;\n\n const testPart = this.computedContext?.testParts.find(testPart => testPart.active);\n if (!testPart) return;\n\n this.sectionItems = testPart.sections.flatMap(section => section.items);\n this.itemIndex = this.sectionItems.findIndex(item => item.active);\n\n this.checkDisabled();\n }\n\n checkDisabled() {\n this._internallyDisabled = !this.computedContext || this.itemIndex <= 0 || this.itemIndex === -1;\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-prev': TestPrev;\n }\n}\n","import { property } from 'lit/decorators.js';\n\nimport type { ReactiveElement } from 'lit';\nimport type { PropertyDeclaration } from 'lit';\n\n// Extended decorator options\ninterface InternalStateOptions extends PropertyDeclaration {\n aria?: string; // Corresponding ARIA attribute, e.g., 'aria-disabled'\n}\n\nexport function propInternalState(options: InternalStateOptions) {\n return (protoOrDescriptor: any, name: string) => {\n // Apply the default Lit `@property` decorator\n property(options)(protoOrDescriptor, name);\n\n // Intercept the property descriptor to enhance functionality\n const key = `__${name}`; // Internal backing field\n\n Object.defineProperty(protoOrDescriptor, name, {\n get() {\n return this[key];\n },\n set(value: any) {\n const oldValue = this[key];\n this[key] = value;\n\n // Trigger updates if value changes\n if (oldValue !== value) {\n // Update internals state\n if (this._internals?.states) {\n const stateName = name.toLowerCase();\n if (value) {\n this._internals.states.add(`--${stateName}`);\n } else {\n this._internals.states.delete(`--${stateName}`);\n }\n }\n\n // Update ARIA attributes if specified\n if (options.aria && this._internals) {\n const ariaAttribute = options.aria;\n if (value) {\n this._internals[ariaAttribute] = 'true';\n } else {\n this._internals[ariaAttribute] = null;\n }\n }\n\n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