@citolab/qti-components 7.0.6-beta.4 → 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/chunks/{chunk-LARBLB7K.js → chunk-EFU4L43Q.js} +1 -1
- package/cdn/chunks/{chunk-IQZ7AOCQ.js → chunk-RIXTWE2H.js} +1 -1
- package/cdn/chunks/{chunk-PT523RSK.js → chunk-ROZIP5LG.js} +1 -1
- package/cdn/chunks/{chunk-4PEUIMDK.js → chunk-RPZVSBLM.js} +1 -1
- package/cdn/chunks/{chunk-SXM25YH3.js → chunk-T2KKTMAT.js} +69 -69
- package/cdn/chunks/{chunk-QTK4CPHP.js → chunk-TEYXRLTI.js} +1 -1
- package/cdn/index.global.js +1 -1
- package/cdn/index.js +1 -1
- package/cdn/qti-components/index.js +1 -1
- package/cdn/qti-test/components/index.js +1 -1
- package/cdn/qti-test/components/test-component.abstract.js +1 -1
- package/cdn/qti-test/components/test-end-attempt.js +1 -1
- package/cdn/qti-test/components/test-item-link.js +1 -1
- package/cdn/qti-test/components/test-next.js +1 -1
- package/cdn/qti-test/components/test-paging-buttons-stamp.js +1 -1
- package/cdn/qti-test/components/test-prev.js +1 -1
- package/cdn/qti-test/components/test-show-correct-response.js +1 -1
- package/cdn/qti-test/components/test-view.js +1 -1
- package/dist/chunks/{chunk-MEQM6M67.js → chunk-E4TWZ2DL.js} +57 -32
- package/dist/chunks/chunk-E4TWZ2DL.js.map +1 -0
- package/dist/index.js +16 -16
- package/dist/qti-components/index.js +1 -1
- package/dist/qti-test/components/index.js +7 -7
- package/dist/qti-test/components/test-component.abstract.js +1 -1
- package/dist/qti-test/components/test-end-attempt.js +3 -3
- package/dist/qti-test/components/test-item-link.js +3 -3
- package/dist/qti-test/components/test-next.js +3 -3
- package/dist/qti-test/components/test-paging-buttons-stamp.js +1 -1
- package/dist/qti-test/components/test-prev.js +3 -3
- package/dist/qti-test/components/test-show-correct-response.js +3 -3
- package/dist/qti-test/components/test-view.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/chunk-MEQM6M67.js.map +0 -1
package/cdn/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
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-
|
|
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-
|
|
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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../chunks/chunk-6PW2L463.js";import{a as f}from"../../chunks/chunk-
|
|
1
|
+
import"../../chunks/chunk-6PW2L463.js";import{a as f}from"../../chunks/chunk-EFU4L43Q.js";import{a as e}from"../../chunks/chunk-ROZIP5LG.js";import{a as b}from"../../chunks/chunk-RPZVSBLM.js";import{a as h}from"../../chunks/chunk-YHWMZAZD.js";import{a as c}from"../../chunks/chunk-TEYXRLTI.js";import{a as g}from"../../chunks/chunk-RIXTWE2H.js";import{a as d}from"../../chunks/chunk-H2V2RXUW.js";import"../../chunks/chunk-L4CUWIE6.js";import{a}from"../../chunks/chunk-PPWEIKLT.js";import"../../chunks/chunk-6MCYE7P5.js";import"../../chunks/chunk-EHK76KRT.js";import"../../chunks/chunk-XUJ7TXHW.js";import"../../chunks/chunk-5GCSZ3CH.js";import"../../chunks/chunk-LZZB4VGC.js";import"../../chunks/chunk-FRS2J3OS.js";import"../../chunks/chunk-IAP2CEE7.js";export{a as TestComponent,f as TestEndAttempt,e as TestItemLink,b as TestNext,h as TestPagingButtonsStamp,c as TestPrev,g as TestShowCorrectResponse,d as TestView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunks/chunk-PPWEIKLT.js";import"../../chunks/chunk-
|
|
1
|
+
import{a}from"../../chunks/chunk-PPWEIKLT.js";import"../../chunks/chunk-6MCYE7P5.js";import"../../chunks/chunk-EHK76KRT.js";import"../../chunks/chunk-XUJ7TXHW.js";import"../../chunks/chunk-5GCSZ3CH.js";import"../../chunks/chunk-LZZB4VGC.js";import"../../chunks/chunk-FRS2J3OS.js";import"../../chunks/chunk-IAP2CEE7.js";export{a as TestComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunks/chunk-
|
|
1
|
+
import{a}from"../../chunks/chunk-EFU4L43Q.js";import"../../chunks/chunk-L4CUWIE6.js";import"../../chunks/chunk-PPWEIKLT.js";import"../../chunks/chunk-6MCYE7P5.js";import"../../chunks/chunk-EHK76KRT.js";import"../../chunks/chunk-XUJ7TXHW.js";import"../../chunks/chunk-5GCSZ3CH.js";import"../../chunks/chunk-LZZB4VGC.js";import"../../chunks/chunk-FRS2J3OS.js";import"../../chunks/chunk-IAP2CEE7.js";export{a as TestEndAttempt};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunks/chunk-
|
|
1
|
+
import{a}from"../../chunks/chunk-ROZIP5LG.js";import"../../chunks/chunk-L4CUWIE6.js";import"../../chunks/chunk-PPWEIKLT.js";import"../../chunks/chunk-6MCYE7P5.js";import"../../chunks/chunk-EHK76KRT.js";import"../../chunks/chunk-XUJ7TXHW.js";import"../../chunks/chunk-5GCSZ3CH.js";import"../../chunks/chunk-LZZB4VGC.js";import"../../chunks/chunk-FRS2J3OS.js";import"../../chunks/chunk-IAP2CEE7.js";export{a as TestItemLink};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunks/chunk-
|
|
1
|
+
import{a}from"../../chunks/chunk-RPZVSBLM.js";import"../../chunks/chunk-L4CUWIE6.js";import"../../chunks/chunk-PPWEIKLT.js";import"../../chunks/chunk-6MCYE7P5.js";import"../../chunks/chunk-EHK76KRT.js";import"../../chunks/chunk-XUJ7TXHW.js";import"../../chunks/chunk-5GCSZ3CH.js";import"../../chunks/chunk-LZZB4VGC.js";import"../../chunks/chunk-FRS2J3OS.js";import"../../chunks/chunk-IAP2CEE7.js";export{a as TestNext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunks/chunk-YHWMZAZD.js";import"../../chunks/chunk-PPWEIKLT.js";import"../../chunks/chunk-
|
|
1
|
+
import{a}from"../../chunks/chunk-YHWMZAZD.js";import"../../chunks/chunk-PPWEIKLT.js";import"../../chunks/chunk-6MCYE7P5.js";import"../../chunks/chunk-EHK76KRT.js";import"../../chunks/chunk-XUJ7TXHW.js";import"../../chunks/chunk-5GCSZ3CH.js";import"../../chunks/chunk-LZZB4VGC.js";import"../../chunks/chunk-FRS2J3OS.js";import"../../chunks/chunk-IAP2CEE7.js";export{a as TestPagingButtonsStamp};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunks/chunk-
|
|
1
|
+
import{a}from"../../chunks/chunk-TEYXRLTI.js";import"../../chunks/chunk-L4CUWIE6.js";import"../../chunks/chunk-PPWEIKLT.js";import"../../chunks/chunk-6MCYE7P5.js";import"../../chunks/chunk-EHK76KRT.js";import"../../chunks/chunk-XUJ7TXHW.js";import"../../chunks/chunk-5GCSZ3CH.js";import"../../chunks/chunk-LZZB4VGC.js";import"../../chunks/chunk-FRS2J3OS.js";import"../../chunks/chunk-IAP2CEE7.js";export{a as TestPrev};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunks/chunk-
|
|
1
|
+
import{a}from"../../chunks/chunk-RIXTWE2H.js";import"../../chunks/chunk-L4CUWIE6.js";import"../../chunks/chunk-PPWEIKLT.js";import"../../chunks/chunk-6MCYE7P5.js";import"../../chunks/chunk-EHK76KRT.js";import"../../chunks/chunk-XUJ7TXHW.js";import"../../chunks/chunk-5GCSZ3CH.js";import"../../chunks/chunk-LZZB4VGC.js";import"../../chunks/chunk-FRS2J3OS.js";import"../../chunks/chunk-IAP2CEE7.js";export{a as TestShowCorrectResponse};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../../chunks/chunk-H2V2RXUW.js";import"../../chunks/chunk-PPWEIKLT.js";import"../../chunks/chunk-
|
|
1
|
+
import{a}from"../../chunks/chunk-H2V2RXUW.js";import"../../chunks/chunk-PPWEIKLT.js";import"../../chunks/chunk-6MCYE7P5.js";import"../../chunks/chunk-EHK76KRT.js";import"../../chunks/chunk-XUJ7TXHW.js";import"../../chunks/chunk-5GCSZ3CH.js";import"../../chunks/chunk-LZZB4VGC.js";import"../../chunks/chunk-FRS2J3OS.js";import"../../chunks/chunk-IAP2CEE7.js";export{a as TestView};
|
|
@@ -1100,21 +1100,35 @@ var DragDropInteractionMixin = (superClass, draggablesSelector, droppablesSelect
|
|
|
1100
1100
|
const unlimitedAssociations = maxMatch === 0;
|
|
1101
1101
|
return unlimitedAssociations || currentAssociations >= maxMatch;
|
|
1102
1102
|
}
|
|
1103
|
+
dropDraggableInDroppable(draggable, droppable) {
|
|
1104
|
+
const cleanClone = draggable.cloneNode(true);
|
|
1105
|
+
cleanClone.removeAttribute("style");
|
|
1106
|
+
this.moveDraggableToDroppable(cleanClone, droppable);
|
|
1107
|
+
this.draggablesModified([cleanClone], []);
|
|
1108
|
+
const matchMax = this.getMatchMaxValue(draggable);
|
|
1109
|
+
const currentDraggables = this.draggables.filter(
|
|
1110
|
+
(d) => d.getAttribute("identifier") === draggable.getAttribute("identifier")
|
|
1111
|
+
);
|
|
1112
|
+
if (matchMax !== 0 && currentDraggables.length >= matchMax) {
|
|
1113
|
+
draggable.style.opacity = "0.0";
|
|
1114
|
+
draggable.style.pointerEvents = "none";
|
|
1115
|
+
} else {
|
|
1116
|
+
draggable.style.opacity = "1.0";
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1103
1119
|
resetDragState() {
|
|
1104
1120
|
if (this.dragClone) {
|
|
1105
1121
|
const isDropped = this.currentDropTarget !== null;
|
|
1106
1122
|
const droppedInDragContainer = !isDropped || this.dragContainers.includes(this.currentDropTarget);
|
|
1107
1123
|
if (isDropped && this.currentDropTarget && !droppedInDragContainer) {
|
|
1108
|
-
|
|
1109
|
-
cleanClone.removeAttribute("style");
|
|
1110
|
-
this.currentDropTarget.appendChild(cleanClone);
|
|
1111
|
-
this.draggablesModified([cleanClone], []);
|
|
1124
|
+
this.dropDraggableInDroppable(this.dragSource, this.currentDropTarget);
|
|
1112
1125
|
}
|
|
1113
1126
|
if (droppedInDragContainer) {
|
|
1114
1127
|
this.dragSource.style.opacity = "1.0";
|
|
1115
1128
|
this.dragSource.style.display = "block";
|
|
1116
1129
|
this.dragSource.style.position = "static";
|
|
1117
1130
|
this.dragSource.style.pointerEvents = "auto";
|
|
1131
|
+
this.saveResponse();
|
|
1118
1132
|
}
|
|
1119
1133
|
this.dragClone.remove();
|
|
1120
1134
|
this.draggablesModified([], [this.dragClone]);
|
|
@@ -1154,6 +1168,7 @@ var DragDropInteractionMixin = (superClass, draggablesSelector, droppablesSelect
|
|
|
1154
1168
|
set value(value) {
|
|
1155
1169
|
if (this.isMatchTabular()) return;
|
|
1156
1170
|
if (Array.isArray(value)) {
|
|
1171
|
+
this.reset();
|
|
1157
1172
|
value?.forEach((entry) => this.placeResponse(entry));
|
|
1158
1173
|
const formData = new FormData();
|
|
1159
1174
|
value.forEach((response) => {
|
|
@@ -1166,29 +1181,13 @@ var DragDropInteractionMixin = (superClass, draggablesSelector, droppablesSelect
|
|
|
1166
1181
|
}
|
|
1167
1182
|
placeResponse(response) {
|
|
1168
1183
|
const [dropId, ...dragIds] = response.split(" ").reverse();
|
|
1169
|
-
const
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
const draggable = this.querySelector(`[identifier=${dragId}]`);
|
|
1177
|
-
if (!droppable || !draggable) {
|
|
1178
|
-
console.error(`Cannot find draggable or droppable with the given identifier: ${dragId}`);
|
|
1179
|
-
return;
|
|
1180
|
-
}
|
|
1181
|
-
const moveElement = () => {
|
|
1182
|
-
draggable.style.transform = "translate(0, 0)";
|
|
1183
|
-
droppable.appendChild(draggable);
|
|
1184
|
-
this.checkAllMaxAssociations();
|
|
1185
|
-
};
|
|
1186
|
-
if (!document.startViewTransition) {
|
|
1187
|
-
moveElement();
|
|
1188
|
-
} else {
|
|
1189
|
-
const transition = document.startViewTransition(moveElement);
|
|
1190
|
-
await transition.finished;
|
|
1191
|
-
}
|
|
1184
|
+
const draggableArray = Array.from(this.draggables);
|
|
1185
|
+
const droppableArray = Array.from(this.droppables);
|
|
1186
|
+
dragIds.forEach((dragId) => {
|
|
1187
|
+
const draggable = draggableArray.find((d) => d.getAttribute("identifier") === dragId);
|
|
1188
|
+
const droppable = droppableArray.find((d) => d.getAttribute("identifier") === dropId);
|
|
1189
|
+
this.dropDraggableInDroppable(draggable, droppable);
|
|
1190
|
+
});
|
|
1192
1191
|
}
|
|
1193
1192
|
getValidAssociations() {
|
|
1194
1193
|
return this.droppables.filter((d) => d.childElementCount > 0).length;
|
|
@@ -1208,15 +1207,41 @@ var DragDropInteractionMixin = (superClass, draggablesSelector, droppablesSelect
|
|
|
1208
1207
|
}
|
|
1209
1208
|
collectResponseData() {
|
|
1210
1209
|
const response = this.droppables.map((droppable) => {
|
|
1211
|
-
const draggablesInDroppable =
|
|
1212
|
-
const identifiers =
|
|
1210
|
+
const draggablesInDroppable = this.getDraggablesFromDroppable(droppable);
|
|
1211
|
+
const identifiers = draggablesInDroppable.map((d) => d.getAttribute("identifier"));
|
|
1213
1212
|
const droppableIdentifier = droppable.getAttribute("identifier");
|
|
1214
1213
|
return identifiers.map((id) => `${id} ${droppableIdentifier}`);
|
|
1215
1214
|
}).flat();
|
|
1216
1215
|
return response;
|
|
1217
1216
|
}
|
|
1218
|
-
|
|
1219
|
-
|
|
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
|
+
}
|
|
1220
1245
|
}
|
|
1221
1246
|
updateDragClonePosition(touch) {
|
|
1222
1247
|
if (!this.isDragging || !this.dragClone) return;
|
|
@@ -6060,4 +6085,4 @@ export {
|
|
|
6060
6085
|
QtiOutcomeDeclaration,
|
|
6061
6086
|
QtiResponseDeclaration
|
|
6062
6087
|
};
|
|
6063
|
-
//# sourceMappingURL=chunk-
|
|
6088
|
+
//# sourceMappingURL=chunk-E4TWZ2DL.js.map
|