@citolab/qti-components 7.0.6-beta.5 → 7.0.6-beta.6

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/index.js CHANGED
@@ -1 +1 @@
1
- import{a as Io,b as Lo,c as Mo,d as No,e as Oo,f as Po}from"./chunks/chunk-J3JSSCM6.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,F as I,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-U2TE6TOV.js";import{a as _o,b as $o}from"./chunks/chunk-4UJBK6JO.js";import{a as Yo,b as Zo}from"./chunks/chunk-YWH4TGMA.js";import"./chunks/chunk-4ILXLVT5.js";import"./chunks/chunk-5BR5CJFH.js";import{a as r,b as e,c as f}from"./chunks/chunk-5FCXUJAG.js";import"./chunks/chunk-6PW2L463.js";import{a as Vo}from"./chunks/chunk-EFU4L43Q.js";import{a as Uo}from"./chunks/chunk-ROZIP5LG.js";import{a as Ro}from"./chunks/chunk-RPZVSBLM.js";import{a as Xo}from"./chunks/chunk-YHWMZAZD.js";import{a as So}from"./chunks/chunk-TEYXRLTI.js";import{a as Wo}from"./chunks/chunk-RIXTWE2H.js";import{a as To}from"./chunks/chunk-H2V2RXUW.js";import"./chunks/chunk-L4CUWIE6.js";import{a as Qo}from"./chunks/chunk-PPWEIKLT.js";import{a as Jo,b as Ko}from"./chunks/chunk-6MCYE7P5.js";import"./chunks/chunk-EHK76KRT.js";import"./chunks/chunk-XUJ7TXHW.js";import"./chunks/chunk-UJP4TGD3.js";import"./chunks/chunk-KWPDTFYH.js";import"./chunks/chunk-RXKI3AO4.js";import"./chunks/chunk-X2KBNXRO.js";import"./chunks/chunk-5GCSZ3CH.js";import"./chunks/chunk-LZZB4VGC.js";import"./chunks/chunk-QQCGUVEV.js";import"./chunks/chunk-FRS2J3OS.js";import"./chunks/chunk-IAP2CEE7.js";export{Yo as ItemContainer,oo as QtiAnd,o as QtiAssessmentItem,Mo as QtiAssessmentItemRef,No as QtiAssessmentSection,m as QtiAssessmentStimulusRef,Oo as QtiAssessmentTest,c as QtiAssociableHotspot,d as QtiAssociateInteraction,eo as QtiBaseValue,g as QtiChoiceInteraction,p as QtiCompanionMaterialsInfo,fo as QtiContains,Do as QtiContentBody,mo as QtiCorrect,h as QtiCustomInteraction,t as QtiCustomOperator,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,Zo as QtiItem,P as QtiItemBody,V as QtiLookupOutcomeValue,co as QtiLt,go as QtiLte,ho as QtiMapResponse,io as QtiMapping,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,Go 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,W as QtiResponseCondition,Ho as QtiResponseDeclaration,Z as QtiResponseElse,$ as QtiResponseElseIf,_ as QtiResponseIf,T as QtiResponseProcessing,Eo 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,Fo as QtiStylesheet,wo as QtiSubtract,Ao as QtiSum,Bo as QtiSumExpression,Lo as QtiTest,Po as QtiTestPart,N as QtiTextEntryInteraction,O as QtiUploadInteraction,Co as QtiVariable,Qo as TestComponent,Io as TestContainer,Vo as TestEndAttempt,Uo as TestItemLink,Ro as TestNext,Xo as TestPagingButtonsStamp,So as TestPrev,Wo as TestShowCorrectResponse,To as TestView,$o as getItemByUri,_o as getManifestInfo,ro as qtiAndMixin,yo as qtiSubtractMixin,r as qtiTransformItem,e as qtiTransformManifest,f as qtiTransformTest,Jo as testContext,Ko as testElement};
1
+ import{a as Io,b as Lo,c as Mo,d as No,e as Oo,f as Po}from"./chunks/chunk-J3JSSCM6.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,F as I,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-T2KKTMAT.js";import{a as _o,b as $o}from"./chunks/chunk-4UJBK6JO.js";import{a as Yo,b as Zo}from"./chunks/chunk-YWH4TGMA.js";import"./chunks/chunk-4ILXLVT5.js";import"./chunks/chunk-5BR5CJFH.js";import{a as r,b as e,c as f}from"./chunks/chunk-5FCXUJAG.js";import"./chunks/chunk-6PW2L463.js";import{a as Vo}from"./chunks/chunk-EFU4L43Q.js";import{a as Uo}from"./chunks/chunk-ROZIP5LG.js";import{a as Ro}from"./chunks/chunk-RPZVSBLM.js";import{a as Xo}from"./chunks/chunk-YHWMZAZD.js";import{a as So}from"./chunks/chunk-TEYXRLTI.js";import{a as Wo}from"./chunks/chunk-RIXTWE2H.js";import{a as To}from"./chunks/chunk-H2V2RXUW.js";import"./chunks/chunk-L4CUWIE6.js";import{a as Qo}from"./chunks/chunk-PPWEIKLT.js";import{a as Jo,b as Ko}from"./chunks/chunk-6MCYE7P5.js";import"./chunks/chunk-EHK76KRT.js";import"./chunks/chunk-XUJ7TXHW.js";import"./chunks/chunk-UJP4TGD3.js";import"./chunks/chunk-KWPDTFYH.js";import"./chunks/chunk-RXKI3AO4.js";import"./chunks/chunk-X2KBNXRO.js";import"./chunks/chunk-5GCSZ3CH.js";import"./chunks/chunk-LZZB4VGC.js";import"./chunks/chunk-QQCGUVEV.js";import"./chunks/chunk-FRS2J3OS.js";import"./chunks/chunk-IAP2CEE7.js";export{Yo as ItemContainer,oo as QtiAnd,o as QtiAssessmentItem,Mo as QtiAssessmentItemRef,No as QtiAssessmentSection,m as QtiAssessmentStimulusRef,Oo as QtiAssessmentTest,c as QtiAssociableHotspot,d as QtiAssociateInteraction,eo as QtiBaseValue,g as QtiChoiceInteraction,p as QtiCompanionMaterialsInfo,fo as QtiContains,Do as QtiContentBody,mo as QtiCorrect,h as QtiCustomInteraction,t as QtiCustomOperator,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,Zo as QtiItem,P as QtiItemBody,V as QtiLookupOutcomeValue,co as QtiLt,go as QtiLte,ho as QtiMapResponse,io as QtiMapping,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,Go 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,W as QtiResponseCondition,Ho as QtiResponseDeclaration,Z as QtiResponseElse,$ as QtiResponseElseIf,_ as QtiResponseIf,T as QtiResponseProcessing,Eo 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,Fo as QtiStylesheet,wo as QtiSubtract,Ao as QtiSum,Bo as QtiSumExpression,Lo as QtiTest,Po as QtiTestPart,N as QtiTextEntryInteraction,O as QtiUploadInteraction,Co as QtiVariable,Qo as TestComponent,Io as TestContainer,Vo as TestEndAttempt,Uo as TestItemLink,Ro as TestNext,Xo as TestPagingButtonsStamp,So as TestPrev,Wo as TestShowCorrectResponse,To as TestView,$o as getItemByUri,_o as getManifestInfo,ro as qtiAndMixin,yo as qtiSubtractMixin,r as qtiTransformItem,e as qtiTransformManifest,f as qtiTransformTest,Jo as testContext,Ko as testElement};
@@ -1 +1 @@
1
- import{$,A,Aa,B,Ba,C,Ca,D,Da,E,F,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-U2TE6TOV.js";import"../chunks/chunk-5BR5CJFH.js";import"../chunks/chunk-5FCXUJAG.js";import"../chunks/chunk-EHK76KRT.js";import"../chunks/chunk-XUJ7TXHW.js";import"../chunks/chunk-UJP4TGD3.js";import"../chunks/chunk-KWPDTFYH.js";import"../chunks/chunk-RXKI3AO4.js";import"../chunks/chunk-X2KBNXRO.js";import"../chunks/chunk-5GCSZ3CH.js";import"../chunks/chunk-LZZB4VGC.js";import"../chunks/chunk-QQCGUVEV.js";import"../chunks/chunk-FRS2J3OS.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,za as QtiContentBody,ba as QtiCorrect,k as QtiCustomInteraction,d as QtiCustomOperator,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 QtiMapping,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,Ca 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,T as QtiResponseCondition,Da as QtiResponseDeclaration,W as QtiResponseElse,Y as QtiResponseElseIf,X as QtiResponseIf,Q as QtiResponseProcessing,Aa 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,Ba 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
+ import{$,A,Aa,B,Ba,C,Ca,D,Da,E,F,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-T2KKTMAT.js";import"../chunks/chunk-5BR5CJFH.js";import"../chunks/chunk-5FCXUJAG.js";import"../chunks/chunk-EHK76KRT.js";import"../chunks/chunk-XUJ7TXHW.js";import"../chunks/chunk-UJP4TGD3.js";import"../chunks/chunk-KWPDTFYH.js";import"../chunks/chunk-RXKI3AO4.js";import"../chunks/chunk-X2KBNXRO.js";import"../chunks/chunk-5GCSZ3CH.js";import"../chunks/chunk-LZZB4VGC.js";import"../chunks/chunk-QQCGUVEV.js";import"../chunks/chunk-FRS2J3OS.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,za as QtiContentBody,ba as QtiCorrect,k as QtiCustomInteraction,d as QtiCustomOperator,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 QtiMapping,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,Ca 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,T as QtiResponseCondition,Da as QtiResponseDeclaration,W as QtiResponseElse,Y as QtiResponseElseIf,X as QtiResponseIf,Q as QtiResponseProcessing,Aa 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,Ba 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};
@@ -0,0 +1,59 @@
1
+ import {
2
+ btn,
3
+ dis
4
+ } from "./chunk-4O5F7WV7.js";
5
+ import {
6
+ TestComponent
7
+ } from "./chunk-MLT7V47R.js";
8
+ import {
9
+ __decorateClass
10
+ } from "./chunk-H2JE6IVU.js";
11
+
12
+ // src/lib/qti-test/components/test-prev.ts
13
+ import { css, html } from "lit";
14
+ import { customElement } from "lit/decorators.js";
15
+ var TestPrev = class extends TestComponent {
16
+ constructor() {
17
+ super();
18
+ this._internals.role = "button";
19
+ this._internals.ariaLabel = "Next item";
20
+ this.addEventListener("click", (e) => {
21
+ e.preventDefault();
22
+ if (!this.disabled) this._requestItem(this.items[this.itemIndex - 1].identifier);
23
+ });
24
+ }
25
+ _requestItem(identifier) {
26
+ this.dispatchEvent(
27
+ new CustomEvent("qti-request-test-item", {
28
+ composed: true,
29
+ bubbles: true,
30
+ detail: identifier
31
+ })
32
+ );
33
+ }
34
+ willUpdate(changedProperties) {
35
+ super.willUpdate(changedProperties);
36
+ if (changedProperties.has("_testContext")) {
37
+ this.disabled = !this._testElement || this.itemIndex === 0 || this.itemIndex === -1;
38
+ }
39
+ }
40
+ render() {
41
+ return html`<slot></slot>`;
42
+ }
43
+ };
44
+ TestPrev.styles = css`
45
+ :host {
46
+ ${btn};
47
+ }
48
+ :host([disabled]) {
49
+ ${dis};
50
+ }
51
+ `;
52
+ TestPrev = __decorateClass([
53
+ customElement("test-prev")
54
+ ], TestPrev);
55
+
56
+ export {
57
+ TestPrev
58
+ };
59
+ //# sourceMappingURL=chunk-4MQV5IRV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/qti-test/components/test-prev.ts"],"sourcesContent":["import { css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport { TestComponent } from './test-component.abstract';\nimport * as styles from './styles';\n\n/**\n * Represents a custom element for navigating to the previous test item.\n *\n * @remarks\n * This element provides functionality for navigating to the previous test item.\n *\n * @example\n * ```html\n * <test-prev></test-prev>\n * ```\n */\n@customElement('test-prev')\nexport class TestPrev extends TestComponent {\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n constructor() {\n super();\n this._internals.role = 'button';\n this._internals.ariaLabel = 'Next item';\n\n this.addEventListener('click', e => {\n e.preventDefault();\n if (!this.disabled) this._requestItem(this.items[this.itemIndex - 1].identifier);\n });\n }\n\n protected _requestItem(identifier: string): void {\n this.dispatchEvent(\n new CustomEvent('qti-request-test-item', {\n composed: true,\n bubbles: true,\n detail: identifier\n })\n );\n }\n\n willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n super.willUpdate(changedProperties);\n if (changedProperties.has('_testContext')) {\n this.disabled = !this._testElement || this.itemIndex === 0 || this.itemIndex === -1;\n }\n }\n\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-previous': TestPrev;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,YAAY;AAC1B,SAAS,qBAAqB;AAgBvB,IAAM,WAAN,cAAuB,cAAc;AAAA,EAU1C,cAAc;AACZ,UAAM;AACN,SAAK,WAAW,OAAO;AACvB,SAAK,WAAW,YAAY;AAE5B,SAAK,iBAAiB,SAAS,OAAK;AAClC,QAAE,eAAe;AACjB,UAAI,CAAC,KAAK,SAAU,MAAK,aAAa,KAAK,MAAM,KAAK,YAAY,CAAC,EAAE,UAAU;AAAA,IACjF,CAAC;AAAA,EACH;AAAA,EAEU,aAAa,YAA0B;AAC/C,SAAK;AAAA,MACH,IAAI,YAAY,yBAAyB;AAAA,QACvC,UAAU;AAAA,QACV,SAAS;AAAA,QACT,QAAQ;AAAA,MACV,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,WAAW,mBAA2D;AACpE,UAAM,WAAW,iBAAiB;AAClC,QAAI,kBAAkB,IAAI,cAAc,GAAG;AACzC,WAAK,WAAW,CAAC,KAAK,gBAAgB,KAAK,cAAc,KAAK,KAAK,cAAc;AAAA,IACnF;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AAzCa,SACJ,SAAS;AAAA;AAAA,QAEH,GAAG;AAAA;AAAA;AAAA,QAGH,GAAG;AAAA;AAAA;AANL,WAAN;AAAA,EADN,cAAc,WAAW;AAAA,GACb;","names":[]}
@@ -0,0 +1,59 @@
1
+ import {
2
+ btn,
3
+ dis
4
+ } from "./chunk-4O5F7WV7.js";
5
+ import {
6
+ TestComponent
7
+ } from "./chunk-MLT7V47R.js";
8
+ import {
9
+ __decorateClass
10
+ } from "./chunk-H2JE6IVU.js";
11
+
12
+ // src/lib/qti-test/components/test-next.ts
13
+ import { css, html } from "lit";
14
+ import { customElement } from "lit/decorators.js";
15
+ var TestNext = class extends TestComponent {
16
+ constructor() {
17
+ super();
18
+ this._internals.role = "button";
19
+ this._internals.ariaLabel = "Next item";
20
+ this.addEventListener("click", (e) => {
21
+ e.preventDefault();
22
+ if (!this.disabled) this._requestItem(this.items[this.itemIndex + 1].identifier);
23
+ });
24
+ }
25
+ willUpdate(changedProperties) {
26
+ super.willUpdate(changedProperties);
27
+ if (changedProperties.has("_testContext")) {
28
+ this.disabled = !this._testElement || this.itemIndex < 0 || this.itemIndex >= this.items.length - 1;
29
+ }
30
+ }
31
+ _requestItem(identifier) {
32
+ this.dispatchEvent(
33
+ new CustomEvent("qti-request-test-item", {
34
+ composed: true,
35
+ bubbles: true,
36
+ detail: identifier
37
+ })
38
+ );
39
+ }
40
+ render() {
41
+ return html`<slot></slot>`;
42
+ }
43
+ };
44
+ TestNext.styles = css`
45
+ :host {
46
+ ${btn};
47
+ }
48
+ :host([disabled]) {
49
+ ${dis};
50
+ }
51
+ `;
52
+ TestNext = __decorateClass([
53
+ customElement("test-next")
54
+ ], TestNext);
55
+
56
+ export {
57
+ TestNext
58
+ };
59
+ //# sourceMappingURL=chunk-5RTLOB3Q.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/qti-test/components/test-next.ts"],"sourcesContent":["import { css, html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport * as styles from './styles';\nimport { TestComponent } from './test-component.abstract';\n\n/**\n * Represents a custom element for navigating to the next test item.\n *\n * @remarks\n * This element provides functionality for navigating to the next test item.\n *\n * @example\n * ```html\n * <test-next></test-next>\n * ```\n */\n@customElement('test-next')\nexport class TestNext extends TestComponent {\n static styles = css`\n :host {\n ${styles.btn};\n }\n :host([disabled]) {\n ${styles.dis};\n }\n `;\n\n constructor() {\n super();\n this._internals.role = 'button';\n this._internals.ariaLabel = 'Next item';\n\n this.addEventListener('click', e => {\n e.preventDefault();\n if (!this.disabled) this._requestItem(this.items[this.itemIndex + 1].identifier);\n });\n }\n\n willUpdate(changedProperties: Map<string | number | symbol, unknown>) {\n super.willUpdate(changedProperties);\n if (changedProperties.has('_testContext')) {\n this.disabled = !this._testElement || this.itemIndex < 0 || this.itemIndex >= this.items.length - 1;\n }\n }\n\n protected _requestItem(identifier: string): void {\n this.dispatchEvent(\n new CustomEvent('qti-request-test-item', {\n composed: true,\n bubbles: true,\n detail: identifier\n })\n );\n }\n\n render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'test-next': TestNext;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,KAAK,YAAY;AAC1B,SAAS,qBAAqB;AAgBvB,IAAM,WAAN,cAAuB,cAAc;AAAA,EAU1C,cAAc;AACZ,UAAM;AACN,SAAK,WAAW,OAAO;AACvB,SAAK,WAAW,YAAY;AAE5B,SAAK,iBAAiB,SAAS,OAAK;AAClC,QAAE,eAAe;AACjB,UAAI,CAAC,KAAK,SAAU,MAAK,aAAa,KAAK,MAAM,KAAK,YAAY,CAAC,EAAE,UAAU;AAAA,IACjF,CAAC;AAAA,EACH;AAAA,EAEA,WAAW,mBAA2D;AACpE,UAAM,WAAW,iBAAiB;AAClC,QAAI,kBAAkB,IAAI,cAAc,GAAG;AACzC,WAAK,WAAW,CAAC,KAAK,gBAAgB,KAAK,YAAY,KAAK,KAAK,aAAa,KAAK,MAAM,SAAS;AAAA,IACpG;AAAA,EACF;AAAA,EAEU,aAAa,YAA0B;AAC/C,SAAK;AAAA,MACH,IAAI,YAAY,yBAAyB;AAAA,QACvC,UAAU;AAAA,QACV,SAAS;AAAA,QACT,QAAQ;AAAA,MACV,CAAC;AAAA,IACH;AAAA,EACF;AAAA,EAEA,SAAS;AACP,WAAO;AAAA,EACT;AACF;AAzCa,SACJ,SAAS;AAAA;AAAA,QAEH,GAAG;AAAA;AAAA;AAAA,QAGH,GAAG;AAAA;AAAA;AANL,WAAN;AAAA,EADN,cAAc,WAAW;AAAA,GACb;","names":[]}
@@ -1128,6 +1128,7 @@ var DragDropInteractionMixin = (superClass, draggablesSelector, droppablesSelect
1128
1128
  this.dragSource.style.display = "block";
1129
1129
  this.dragSource.style.position = "static";
1130
1130
  this.dragSource.style.pointerEvents = "auto";
1131
+ this.saveResponse();
1131
1132
  }
1132
1133
  this.dragClone.remove();
1133
1134
  this.draggablesModified([], [this.dragClone]);
@@ -1167,6 +1168,7 @@ var DragDropInteractionMixin = (superClass, draggablesSelector, droppablesSelect
1167
1168
  set value(value) {
1168
1169
  if (this.isMatchTabular()) return;
1169
1170
  if (Array.isArray(value)) {
1171
+ this.reset();
1170
1172
  value?.forEach((entry) => this.placeResponse(entry));
1171
1173
  const formData = new FormData();
1172
1174
  value.forEach((response) => {
@@ -1179,9 +1181,11 @@ var DragDropInteractionMixin = (superClass, draggablesSelector, droppablesSelect
1179
1181
  }
1180
1182
  placeResponse(response) {
1181
1183
  const [dropId, ...dragIds] = response.split(" ").reverse();
1184
+ const draggableArray = Array.from(this.draggables);
1185
+ const droppableArray = Array.from(this.droppables);
1182
1186
  dragIds.forEach((dragId) => {
1183
- const draggable = this.querySelector(`[identifier=${dragId}]`);
1184
- const droppable = this.querySelector(`[identifier=${dropId}]`);
1187
+ const draggable = draggableArray.find((d) => d.getAttribute("identifier") === dragId);
1188
+ const droppable = droppableArray.find((d) => d.getAttribute("identifier") === dropId);
1185
1189
  this.dropDraggableInDroppable(draggable, droppable);
1186
1190
  });
1187
1191
  }
@@ -1203,15 +1207,41 @@ var DragDropInteractionMixin = (superClass, draggablesSelector, droppablesSelect
1203
1207
  }
1204
1208
  collectResponseData() {
1205
1209
  const response = this.droppables.map((droppable) => {
1206
- const draggablesInDroppable = droppable.querySelectorAll('[qti-draggable="true"]');
1207
- const identifiers = Array.from(draggablesInDroppable).map((d) => d.getAttribute("identifier"));
1210
+ const draggablesInDroppable = this.getDraggablesFromDroppable(droppable);
1211
+ const identifiers = draggablesInDroppable.map((d) => d.getAttribute("identifier"));
1208
1212
  const droppableIdentifier = droppable.getAttribute("identifier");
1209
1213
  return identifiers.map((id) => `${id} ${droppableIdentifier}`);
1210
1214
  }).flat();
1211
1215
  return response;
1212
1216
  }
1213
- reset(save = true) {
1214
- if (save) this.saveResponse();
1217
+ getDraggablesFromDroppable(droppable) {
1218
+ const uniqueDraggableIds = this.draggables.map((d) => d.getAttribute("identifier")).filter((v, i, a) => a.indexOf(v) === i);
1219
+ const draggables = uniqueDraggableIds.flatMap((d) => Array.from(droppable.querySelectorAll(`[identifier='${d}']`))).filter((d) => !!d).map((d) => d);
1220
+ return draggables;
1221
+ }
1222
+ reset(save = false) {
1223
+ this.droppables.forEach((droppable) => {
1224
+ const draggables = this.getDraggablesFromDroppable(droppable);
1225
+ draggables.forEach((draggable) => {
1226
+ draggable.remove();
1227
+ this.draggablesModified([], [draggable]);
1228
+ });
1229
+ });
1230
+ this.dragContainers.forEach((dragContainer) => {
1231
+ const draggables = Array.from(dragContainer.querySelectorAll('[qti-draggable="true"]'));
1232
+ draggables.forEach((draggable) => {
1233
+ draggable.style.opacity = "1.0";
1234
+ });
1235
+ });
1236
+ this.dragClone = null;
1237
+ this.dragSource = null;
1238
+ this.isDragging = false;
1239
+ this.isDraggable = false;
1240
+ this.currentDropTarget = null;
1241
+ this.lastTarget = null;
1242
+ if (save) {
1243
+ this.saveResponse();
1244
+ }
1215
1245
  }
1216
1246
  updateDragClonePosition(touch) {
1217
1247
  if (!this.isDragging || !this.dragClone) return;
@@ -6055,4 +6085,4 @@ export {
6055
6085
  QtiOutcomeDeclaration,
6056
6086
  QtiResponseDeclaration
6057
6087
  };
6058
- //# sourceMappingURL=chunk-6PAEJQSQ.js.map
6088
+ //# sourceMappingURL=chunk-E4TWZ2DL.js.map