lido-player 0.0.2-beta-17 → 0.0.2-beta-17-dev
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/LICENSE +21 -21
- package/dist/cjs/{decode-BPWgujpW.js → decode-DUZYNXIv.js} +1 -1
- package/dist/cjs/{index-BnfJD-Dp.js → index-BEjUmVtH.js} +185 -86
- package/dist/cjs/{index-CACb9dlg.js → index-DnqQXD5x.js} +53 -12
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/lido-avatar_22.cjs.entry.js +61 -68
- package/dist/cjs/lido-player.cjs.js +3 -3
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/avatar/lido-avatar.css +4 -4
- package/dist/collection/components/avatar/lido-avatar.js +1 -1
- package/dist/collection/components/avatar/lido-avatar.tsx +207 -207
- package/dist/collection/components/avatar/readme.md +49 -49
- package/dist/collection/components/calculator/lido-calculator.css +89 -89
- package/dist/collection/components/calculator/lido-calculator.js +2 -2
- package/dist/collection/components/canvas/lido-canvas.css +33 -33
- package/dist/collection/components/canvas/lido-canvas.js +1 -1
- package/dist/collection/components/cell/lido-cell.css +100 -100
- package/dist/collection/components/cell/lido-cell.js +12 -12
- package/dist/collection/components/column/lido-col.css +19 -19
- package/dist/collection/components/column/lido-col.js +6 -6
- package/dist/collection/components/container/lido-container.css +10 -10
- package/dist/collection/components/container/lido-container.js +8 -8
- package/dist/collection/components/flashCard/lido-flash-card.css +28 -28
- package/dist/collection/components/flashCard/lido-flash-card.js +4 -4
- package/dist/collection/components/float/lido-float.css +30 -30
- package/dist/collection/components/float/lido-float.js +2 -2
- package/dist/collection/components/home/lido-home.css +309 -309
- package/dist/collection/components/home/lido-home.js +5 -5
- package/dist/collection/components/image/lido-image.css +17 -17
- package/dist/collection/components/image/lido-image.js +6 -6
- package/dist/collection/components/keyboard/lido-keyboard.css +38 -38
- package/dist/collection/components/keyboard/lido-keyboard.js +3 -3
- package/dist/collection/components/mathMatrix/lido-math-matrix.css +56 -56
- package/dist/collection/components/mathMatrix/lido-math-matrix.js +1 -1
- package/dist/collection/components/position/lido-pos.css +16 -16
- package/dist/collection/components/position/lido-pos.js +2 -2
- package/dist/collection/components/random/lido-random.css +8 -8
- package/dist/collection/components/random/lido-random.js +2 -2
- package/dist/collection/components/root/lido-root.js +5 -5
- package/dist/collection/components/row/lido-row.css +10 -10
- package/dist/collection/components/row/lido-row.js +6 -6
- package/dist/collection/components/scale/assets/Shadow.svg +9 -9
- package/dist/collection/components/scale/lido-balance.css +145 -145
- package/dist/collection/components/scale/lido-balance.js +13 -13
- package/dist/collection/components/shape/lido-shape.css +216 -216
- package/dist/collection/components/shape/lido-shape.js +6 -6
- package/dist/collection/components/slideFill/lido-slide-fill.css +3 -3
- package/dist/collection/components/slideFill/lido-slide-fill.js +13 -13
- package/dist/collection/components/text/lido-text.css +53 -53
- package/dist/collection/components/text/lido-text.js +31 -6
- package/dist/collection/components/trace/assets/Tracing-hand.svg +8 -8
- package/dist/collection/components/trace/lido-trace.css +97 -97
- package/dist/collection/components/trace/lido-trace.js +22 -35
- package/dist/collection/components/wrap/lido-wrap.css +18 -18
- package/dist/collection/components/wrap/lido-wrap.js +6 -6
- package/dist/collection/css/animation.css +211 -211
- package/dist/collection/css/index.css +315 -315
- package/dist/collection/stories/Templates/Fill-Up/fill-up.stories.js +61 -61
- package/dist/collection/stories/Templates/LetterPairing/LetterPairing.stories.js +123 -123
- package/dist/collection/stories/Templates/RocketGame/rocketGame.stories.js +48 -48
- package/dist/collection/stories/Templates/Tag/tagGame.stories.js +39 -39
- package/dist/collection/stories/Templates/arrangeLetters/arrangeLetters.stories.js +44 -44
- package/dist/collection/stories/Templates/balancing/balancing.stories.js +35 -35
- package/dist/collection/stories/Templates/balloonPop/balloonPop.stories.js +38 -38
- package/dist/collection/stories/Templates/blender/blender.stories.js +63 -59
- package/dist/collection/stories/Templates/bubbleType/bubbleType.stories.js +42 -42
- package/dist/collection/stories/Templates/calculator/calculator.stories.js +28 -28
- package/dist/collection/stories/Templates/categorize/categorize.stories.js +37 -37
- package/dist/collection/stories/Templates/categorize2/categorize2.stories.js +67 -67
- package/dist/collection/stories/Templates/checker-block/checkerBlock.stories.js +29 -29
- package/dist/collection/stories/Templates/checkerBlock/checkerBlock.stories.js +13 -13
- package/dist/collection/stories/Templates/create-sentence/createSentence.stories.js +74 -74
- package/dist/collection/stories/Templates/dragAndDrop/drag-drop.stories.js +69 -69
- package/dist/collection/stories/Templates/fillAnswer/fill-answer.stories.js +43 -43
- package/dist/collection/stories/Templates/fillBlank/fill-blank.stories.js +282 -282
- package/dist/collection/stories/Templates/foodJar/food-jar.stories.js +35 -35
- package/dist/collection/stories/Templates/grid/grid.stories.js +118 -118
- package/dist/collection/stories/Templates/gridGame/grid-game.stories.js +57 -57
- package/dist/collection/stories/Templates/imageMatch/imageMatch.stories.js +44 -44
- package/dist/collection/stories/Templates/jumpSentence/jumpSentence.stories.js +41 -41
- package/dist/collection/stories/Templates/letterboard/letterboard.stories.js +183 -183
- package/dist/collection/stories/Templates/makeSentence/make-sentence.stories.js +36 -36
- package/dist/collection/stories/Templates/matchBox/matchBox.stories.js +69 -69
- package/dist/collection/stories/Templates/matchBox/matchBox2.stories.js +84 -84
- package/dist/collection/stories/Templates/matchingCard/matching-card.stories.js +31 -31
- package/dist/collection/stories/Templates/multipleOption/mcqWithQuestionImage.stories.js +112 -112
- package/dist/collection/stories/Templates/multipleOption/multiple-option.stories.js +47 -47
- package/dist/collection/stories/Templates/multiplyBeeds/multiplyBeeds.stories.js +57 -57
- package/dist/collection/stories/Templates/nimbleTable/nimbleTable.stories.js +53 -53
- package/dist/collection/stories/Templates/numberBoard/numberBoard.stories.js +46 -46
- package/dist/collection/stories/Templates/numberBoardTwo/numberBoardTwo.stories.js +45 -45
- package/dist/collection/stories/Templates/numberIdentification/numberIdentificationimageTotext.stories.js +56 -56
- package/dist/collection/stories/Templates/numberIdentification/numberIdentificationtextTotext.stories.js +53 -53
- package/dist/collection/stories/Templates/numberPair/numberPair.stories.js +127 -127
- package/dist/collection/stories/Templates/openwindow/openwindow.stories.js +47 -47
- package/dist/collection/stories/Templates/openwindow/openwindow2.stories.js +38 -38
- package/dist/collection/stories/Templates/order-tractor/order-tractor-ascending-order.stories.js +97 -97
- package/dist/collection/stories/Templates/order-tractor/order-tractor.stories.js +90 -90
- package/dist/collection/stories/Templates/palEgmaCalculateSum/palEgmaMultiOption.stories.js +63 -63
- package/dist/collection/stories/Templates/palEgmaCalculateSum/palEgmaSumTogether.stories.js +45 -45
- package/dist/collection/stories/Templates/palEgmaPatternMatching/palEgmaPatternMatching.stories.js +63 -63
- package/dist/collection/stories/Templates/palEgmaWordProblem/palEgmaWordProblem.stories.js +79 -79
- package/dist/collection/stories/Templates/palEgraInventedSpelling/pal_egra_invented_spelling_schema.stories.js +32 -32
- package/dist/collection/stories/Templates/palEgraMCQWithImage/palEgraMCQWithImage.stories.js +42 -42
- package/dist/collection/stories/Templates/palEgraOptionWithAudio/palEgraOptionWithAudio.stories.js +63 -63
- package/dist/collection/stories/Templates/palEgraStoryMaking/pal_egra_story_making.stories.js +44 -44
- package/dist/collection/stories/Templates/palEgraTemplate1/palEgraLetterIdentification.stories.js +34 -34
- package/dist/collection/stories/Templates/palEgraWordMatch/palEgraWordMatch.stories.js +52 -52
- package/dist/collection/stories/Templates/palEgra_OddOneOut/palEgra_oddOneOut.stories.js +33 -33
- package/dist/collection/stories/Templates/palEgra_arrange_pictures/palEgra_arrange_pictures.stories.js +40 -40
- package/dist/collection/stories/Templates/palEgra_build_word/palEgra_build_word.stories.js +48 -48
- package/dist/collection/stories/Templates/palEgra_word_formation/palEgra_WordFormation.stories.js +48 -48
- package/dist/collection/stories/Templates/palStorytale/palStorytale.stories.js +18 -18
- package/dist/collection/stories/Templates/phonic-tractor/phonic-tractor.stories.js +44 -44
- package/dist/collection/stories/Templates/pictureClues/pictureClues.stories.js +34 -34
- package/dist/collection/stories/Templates/pictureWordMatch/pictureWordMatch1.stories.js +36 -36
- package/dist/collection/stories/Templates/pictureWordMatch/pictureWordMatch2.stories.js +30 -30
- package/dist/collection/stories/Templates/picturemeaning/pictureMeaningCocos.stories.js +20 -20
- package/dist/collection/stories/Templates/puzzleGame/puzzleGame.stories.js +17 -17
- package/dist/collection/stories/Templates/questionBoard/questionBoard.stories.js +58 -58
- package/dist/collection/stories/Templates/quizLiteracy/quizLiteracy.stories.js +50 -50
- package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWithText.stories.js +36 -36
- package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWord.stories.js +43 -43
- package/dist/collection/stories/Templates/quizMaths/quizMaths.stories.js +631 -631
- package/dist/collection/stories/Templates/reorder/reorder.stories.js +63 -63
- package/dist/collection/stories/Templates/rowBlocks/rowBlocks.stories.js +47 -47
- package/dist/collection/stories/Templates/sentenceMatch/sentenceMatch.stories.js +29 -29
- package/dist/collection/stories/Templates/sequenceBox/sequenceBox1.stories.js +64 -64
- package/dist/collection/stories/Templates/sequenceBox/sequenceBox2.stories.js +62 -62
- package/dist/collection/stories/Templates/shapePair/shape-pair.stories.js +106 -106
- package/dist/collection/stories/Templates/shapeTractor/shape-tractor.stories.js +50 -50
- package/dist/collection/stories/Templates/spellDoor/spellDoor.stories.js +41 -41
- package/dist/collection/stories/Templates/storyTale/storyTale.stories.js +39 -39
- package/dist/collection/stories/Templates/substraction/substractionWithimg.stories.js +62 -62
- package/dist/collection/stories/Templates/substraction/substractionWithoutImg.stories.js +42 -42
- package/dist/collection/stories/Templates/sumTogether/sumTogether.stories.js +50 -50
- package/dist/collection/stories/Templates/tenBox/tenBox.stories.js +88 -88
- package/dist/collection/stories/Templates/total/total.stories.js +28 -28
- package/dist/collection/stories/Templates/wordBuilding/wordBuildingwithimg.stories.js +35 -35
- package/dist/collection/stories/Templates/wordBuilding/wordBuildingwithoutimg.stories.js +34 -34
- package/dist/collection/stories/Templates/writeCard/writeCard.stories.js +31 -31
- package/dist/collection/stories/Templates/writeLetter/writeLetter.stories.js +58 -58
- package/dist/collection/stories/Templates/writeNumber/writeNumber.stories.js +44 -44
- package/dist/collection/stories/Templates/writeSet/writeSet.stories.js +31 -31
- package/dist/collection/stories/Templates/writeWord/writeWord.stories.js +34 -34
- package/dist/collection/stories/components/flash-card.stories.js +48 -48
- package/dist/collection/stories/components/keyboard.stories.js +10 -10
- package/dist/collection/stories/components/slider.stories.js +4 -4
- package/dist/collection/stories/components/trace.stories.js +5 -5
- package/dist/collection/utils/utils.js +26 -17
- package/dist/collection/utils/utilsHandlers/dragDropHandler.js +36 -16
- package/dist/collection/utils/utilsHandlers/highlightHandler.js +54 -54
- package/dist/collection/utils/utilsHandlers/slideHandler.js +80 -23
- package/dist/collection/utils/utilsHandlers/sortHandler.js +10 -10
- package/dist/components/index.js +1 -1
- package/dist/components/lido-avatar.js +1 -1
- package/dist/components/lido-balance.js +1 -1
- package/dist/components/lido-calculator.js +1 -1
- package/dist/components/lido-canvas.js +1 -1
- package/dist/components/lido-cell.js +1 -1
- package/dist/components/lido-col.js +1 -1
- package/dist/components/lido-container.js +1 -1
- package/dist/components/lido-flash-card.js +1 -1
- package/dist/components/lido-float.js +1 -1
- package/dist/components/lido-home.js +1 -1
- package/dist/components/lido-keyboard.js +1 -1
- package/dist/components/lido-math-matrix.js +1 -1
- package/dist/components/lido-pos.js +1 -1
- package/dist/components/lido-random.js +1 -1
- package/dist/components/lido-root.js +1 -1
- package/dist/components/lido-row.js +1 -1
- package/dist/components/lido-shape.js +1 -1
- package/dist/components/lido-slide-fill.js +1 -1
- package/dist/components/lido-text.js +1 -1
- package/dist/components/lido-trace.js +1 -1
- package/dist/components/lido-wrap.js +1 -1
- package/dist/components/{p-CCR42e0i.js → p-BE25wHoo.js} +1 -1
- package/dist/components/p-BNNX1Pew.js +12 -0
- package/dist/components/p-BSV5U72F.js +1 -0
- package/dist/components/{p-CTlcpv4a.js → p-BfwUqpXc.js} +1 -1
- package/dist/components/{p-CgsPIpg0.js → p-Bw-OC9iR.js} +1 -1
- package/dist/components/{p-C5WmmkI6.js → p-CPYnt0P-.js} +1 -1
- package/dist/components/p-CTlwn9r7.js +1 -0
- package/dist/components/{p-CIbBOu51.js → p-Cj-6tqzU.js} +1 -1
- package/dist/components/{p-BfqihbR6.js → p-CjdDpXfk.js} +1 -1
- package/dist/components/{p-BeRr8u5m.js → p-CwDTdXe5.js} +1 -1
- package/dist/components/{p-CXHPZN3m.js → p-CyGxEcn7.js} +1 -1
- package/dist/components/p-D-B1groh.js +1 -0
- package/dist/components/{p-DuvxecDX.js → p-D54c-ybm.js} +1 -1
- package/dist/components/p-DbR5sNOj.js +1 -0
- package/dist/components/{p-B8nzzM8c.js → p-DdQ1eqJr.js} +1 -1
- package/dist/components/{p-CxkH5UIf.js → p-SPZTb5fI.js} +1 -1
- package/dist/components/{p-BBHM059l.js → p-Sl9R-E6h.js} +1 -1
- package/dist/components/p-leIEepjl.js +1 -0
- package/dist/components/{p-C70ykycD.js → p-useuhkjH.js} +1 -1
- package/dist/components/{p-BXvoOUIv.js → p-yT7udDfd.js} +1 -1
- package/dist/esm/{decode-To5V_Qqp.js → decode-BgBfbPZu.js} +1 -1
- package/dist/esm/{index-Dnvog_Mm.js → index-BeHFCsWf.js} +53 -12
- package/dist/esm/{index-CEJsA_x_.js → index-D-29PaRa.js} +185 -86
- package/dist/esm/index.js +2 -2
- package/dist/esm/lido-avatar_22.entry.js +61 -68
- package/dist/esm/lido-player.js +4 -4
- package/dist/esm/loader.js +3 -3
- package/dist/lido-player/assets/Shadow.svg +9 -9
- package/dist/lido-player/assets/Tracing-hand.svg +8 -8
- package/dist/lido-player/index.esm.js +1 -1
- package/dist/lido-player/lido-avatar.css +4 -4
- package/dist/lido-player/lido-avatar.tsx +207 -207
- package/dist/lido-player/lido-player.css +7 -7
- package/dist/lido-player/lido-player.esm.js +1 -1
- package/dist/lido-player/{p-3b6e3b51.entry.js → p-856e1956.entry.js} +3 -3
- package/dist/lido-player/{p-DUx4nii8.js → p-BA2X6O7O.js} +1 -1
- package/dist/lido-player/p-BeHFCsWf.js +3 -0
- package/dist/lido-player/p-TuBmCgtK.js +1 -0
- package/dist/lido-player/readme.md +49 -49
- package/dist/types/components/text/lido-text.d.ts +6 -1
- package/dist/types/components/trace/lido-trace.d.ts +1 -1
- package/dist/types/components.d.ts +11 -0
- package/dist/types/stencil-public-runtime.d.ts +12 -0
- package/dist/types/types/json.d.ts +3 -3
- package/dist/types/utils/utilsHandlers/slideHandler.d.ts +5 -0
- package/loader/index.d.ts +1 -1
- package/package.json +74 -73
- package/readme.md +113 -113
- package/dist/components/p-CwIlwnQk.js +0 -1
- package/dist/components/p-DBbLGy4y.js +0 -12
- package/dist/components/p-DLyacZap.js +0 -1
- package/dist/components/p-DONbWJGn.js +0 -1
- package/dist/components/p-DVTigdH_.js +0 -1
- package/dist/components/p-Dv1cIsyS.js +0 -1
- package/dist/lido-player/p-Dnvog_Mm.js +0 -2
- package/dist/lido-player/p-gkKsw3a6.js +0 -1
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2018
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index$1 = require('./index-
|
|
3
|
+
var index$1 = require('./index-DnqQXD5x.js');
|
|
4
4
|
|
|
5
5
|
const DragMapKey = 'lidoDragMap';
|
|
6
6
|
const SelectedValuesKey = 'lidoSelectedValues';
|
|
@@ -340,6 +340,7 @@ function dragDropAnimation(container, dragElement, dropElement) {
|
|
|
340
340
|
}, 250);
|
|
341
341
|
}
|
|
342
342
|
|
|
343
|
+
const isBlenderTemplate = (container) => (container === null || container === void 0 ? void 0 : container.getAttribute('template-id')) === 'blender';
|
|
343
344
|
function buildDropHasDragFromDOM() {
|
|
344
345
|
const dropHasDrag = {};
|
|
345
346
|
const dropElements = document.querySelectorAll("[type='drop']");
|
|
@@ -397,7 +398,6 @@ function enableDraggingWithScaling(element) {
|
|
|
397
398
|
let mutationFlag = false;
|
|
398
399
|
// Fetch the container element
|
|
399
400
|
const container = document.getElementById(LidoContainer);
|
|
400
|
-
const templateId = container.getAttribute("template-id");
|
|
401
401
|
if (!container) {
|
|
402
402
|
console.error(`Container with ID "container" not found.`);
|
|
403
403
|
return;
|
|
@@ -558,7 +558,7 @@ function enableDraggingWithScaling(element) {
|
|
|
558
558
|
allElements.forEach(otherElement => {
|
|
559
559
|
var _a;
|
|
560
560
|
if (storedTabIndexes.includes(JSON.parse(otherElement.getAttribute('tab-index')))) {
|
|
561
|
-
if (!(((_a = element.getAttribute('dropAttr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.Diagonal) && container
|
|
561
|
+
if (!(((_a = element.getAttribute('dropAttr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.Diagonal) && !isBlenderTemplate(container)) {
|
|
562
562
|
if (otherElement) {
|
|
563
563
|
setOpacityIfChanged(otherElement, "0.3");
|
|
564
564
|
}
|
|
@@ -646,7 +646,7 @@ function enableDraggingWithScaling(element) {
|
|
|
646
646
|
else {
|
|
647
647
|
onElementDropComplete(element, mostOverlappedElement);
|
|
648
648
|
}
|
|
649
|
-
if (
|
|
649
|
+
if (isBlenderTemplate(container) && element && mostOverlappedElement) {
|
|
650
650
|
const allElements = document.querySelectorAll(`*`);
|
|
651
651
|
allElements.forEach(el => {
|
|
652
652
|
removeHighlight(el);
|
|
@@ -874,7 +874,7 @@ async function handleResetDragElement(dragElement, dropElement, dropHasDrag, sel
|
|
|
874
874
|
highlightElement();
|
|
875
875
|
}
|
|
876
876
|
async function onElementDropComplete(dragElement, dropElement) {
|
|
877
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
877
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
878
878
|
const container = document.getElementById(LidoContainer);
|
|
879
879
|
const selectedValueData = (_a = container.getAttribute(SelectedValuesKey)) !== null && _a !== void 0 ? _a : "[]";
|
|
880
880
|
const dragSelectedData = JSON.stringify(buildDragSelectedMapFromDOM());
|
|
@@ -1096,28 +1096,48 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
1096
1096
|
// Add pulse and highlight effect for a successful match
|
|
1097
1097
|
const isCorrect = dropElement['value'].toLowerCase().includes(dragElement['value'].toLowerCase());
|
|
1098
1098
|
dispatchElementDropEvent(dragElement, dropElement, isCorrect);
|
|
1099
|
-
if (container
|
|
1099
|
+
if (!isBlenderTemplate(container)) {
|
|
1100
1100
|
storingEachActivityScore(isCorrect);
|
|
1101
1101
|
}
|
|
1102
1102
|
dragElement.style.opacity = '1';
|
|
1103
1103
|
const allDropElements = document.querySelectorAll('.drop-element');
|
|
1104
1104
|
allDropElements.forEach(el => updateDropBorder(el));
|
|
1105
|
+
if (isBlenderTemplate(container)) {
|
|
1106
|
+
const requiredDrops = Number((_j = dropElement.getAttribute('required-drops')) !== null && _j !== void 0 ? _j : 0);
|
|
1107
|
+
const placedDrops = document.querySelectorAll(`[${DropToAttr}="${dropElement.id}"]`).length;
|
|
1108
|
+
const action = placedDrops > 0 && placedDrops <= requiredDrops
|
|
1109
|
+
? dropElement.getAttribute('onCorrect')
|
|
1110
|
+
: dropElement.getAttribute('onInCorrect');
|
|
1111
|
+
if (action) {
|
|
1112
|
+
await executeActions(action, dropElement, dragElement);
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1105
1115
|
highlightElement();
|
|
1106
1116
|
await onActivityComplete(dragElement, dropElement);
|
|
1107
1117
|
}
|
|
1108
1118
|
function updateDropBorder(element) {
|
|
1119
|
+
var _a;
|
|
1109
1120
|
if (!element || !element.classList.contains('drop-element'))
|
|
1110
1121
|
return;
|
|
1111
1122
|
const container = document.getElementById(LidoContainer);
|
|
1112
1123
|
if (!container)
|
|
1113
1124
|
return;
|
|
1114
1125
|
const showBorder = container.getAttribute('show-drop-border');
|
|
1115
|
-
if (showBorder !== 'true') {
|
|
1126
|
+
if (showBorder !== 'true' && !isBlenderTemplate(container)) {
|
|
1116
1127
|
return;
|
|
1117
1128
|
}
|
|
1118
1129
|
const dropId = element.id;
|
|
1119
1130
|
const dragSelectedElements = document.querySelectorAll(`[${DropToAttr}="${dropId}"]`);
|
|
1120
|
-
if (
|
|
1131
|
+
if (isBlenderTemplate(container)) {
|
|
1132
|
+
const requiredDrops = Number((_a = element.getAttribute('required-drops')) !== null && _a !== void 0 ? _a : 0);
|
|
1133
|
+
const placedDrops = dragSelectedElements.length;
|
|
1134
|
+
const showCorrectBorder = placedDrops > 0 && placedDrops <= requiredDrops;
|
|
1135
|
+
element.classList.toggle('empty', !showCorrectBorder);
|
|
1136
|
+
element.classList.remove('filled');
|
|
1137
|
+
element.style.setProperty('border', showCorrectBorder ? '5px dashed green' : '5px dashed #f34d08', 'important');
|
|
1138
|
+
return;
|
|
1139
|
+
}
|
|
1140
|
+
if (dragSelectedElements.length > 0 && !isBlenderTemplate(container)) {
|
|
1121
1141
|
element.classList.add('filled');
|
|
1122
1142
|
element.classList.remove('empty');
|
|
1123
1143
|
element.classList.remove('highlight-element');
|
|
@@ -1159,14 +1179,14 @@ async function onClickDropOrDragElement(element, type) {
|
|
|
1159
1179
|
if (!document.querySelector('#dynamic-highlight-style')) {
|
|
1160
1180
|
const style = document.createElement('style');
|
|
1161
1181
|
style.id = 'dynamic-highlight-style';
|
|
1162
|
-
style.innerHTML = `
|
|
1163
|
-
.highlight {
|
|
1164
|
-
// border: 4px solid #e74c3c; /* Thicker red border for more visibility */
|
|
1165
|
-
// border-radius: 12px; /* Larger rounded corners */
|
|
1166
|
-
// background-color: rgba(231, 76, 60, 0.3); /* Stronger, more noticeable background */
|
|
1167
|
-
// box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 12px 40px rgba(0, 0, 0, 0.2); /* Stronger shadow */
|
|
1168
|
-
// outline: 4px solid rgba(231, 76, 60, 0.6); /* Glow effect */
|
|
1169
|
-
}
|
|
1182
|
+
style.innerHTML = `
|
|
1183
|
+
.highlight {
|
|
1184
|
+
// border: 4px solid #e74c3c; /* Thicker red border for more visibility */
|
|
1185
|
+
// border-radius: 12px; /* Larger rounded corners */
|
|
1186
|
+
// background-color: rgba(231, 76, 60, 0.3); /* Stronger, more noticeable background */
|
|
1187
|
+
// box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 12px 40px rgba(0, 0, 0, 0.2); /* Stronger shadow */
|
|
1188
|
+
// outline: 4px solid rgba(231, 76, 60, 0.6); /* Glow effect */
|
|
1189
|
+
}
|
|
1170
1190
|
`;
|
|
1171
1191
|
document.head.appendChild(style);
|
|
1172
1192
|
}
|
|
@@ -1204,7 +1224,7 @@ async function onClickDropOrDragElement(element, type) {
|
|
|
1204
1224
|
// Move the drag element to the drop position
|
|
1205
1225
|
selectedDragElement.style.transform = `translate(${translateX}px, ${translateY}px)`;
|
|
1206
1226
|
// Remove highlights after moving the element
|
|
1207
|
-
if (container
|
|
1227
|
+
if (!isBlenderTemplate(container)) {
|
|
1208
1228
|
const allElements = document.querySelectorAll(`*`);
|
|
1209
1229
|
allElements.forEach(el => {
|
|
1210
1230
|
removeHighlight(el);
|
|
@@ -1354,34 +1374,34 @@ function highlightSpeakingElement(element) {
|
|
|
1354
1374
|
if (!document.getElementById(styleId)) {
|
|
1355
1375
|
const style = document.createElement('style');
|
|
1356
1376
|
style.id = styleId;
|
|
1357
|
-
style.innerHTML = `
|
|
1358
|
-
.speaking-highlight {
|
|
1359
|
-
--base-transform: ${element.style.transform};
|
|
1360
|
-
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9) !important; /* Stronger orange glow effect */
|
|
1361
|
-
// border: 3px solid green !important;
|
|
1362
|
-
// transition: box-shadow 0.5s ease-in-out, transform 0.5s ease-in-out;
|
|
1363
|
-
// transform: scale(1.05); /* Subtle scale effect to pop the element */
|
|
1364
|
-
// animation: pulseEffect 1.5s infinite; /* Pulsing animation */
|
|
1365
|
-
|
|
1366
|
-
}
|
|
1367
|
-
|
|
1368
|
-
@keyframes pulseEffect {
|
|
1369
|
-
0% {
|
|
1370
|
-
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
1371
|
-
// transform: var(--base-transform) scale(1.05);
|
|
1372
|
-
// background-color: #FFFF0B;
|
|
1373
|
-
}
|
|
1374
|
-
50% {
|
|
1375
|
-
box-shadow: 0 0 30px 15px rgba(255, 165, 0, 1);
|
|
1376
|
-
// transform: var(--base-transform) scale(1.1);
|
|
1377
|
-
// background-color: #FFFF0B;
|
|
1378
|
-
}
|
|
1379
|
-
100% {
|
|
1380
|
-
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
1381
|
-
// transform: var(--base-transform) scale(1.05);
|
|
1382
|
-
// background-color: #FFFF0B;
|
|
1383
|
-
}
|
|
1384
|
-
}
|
|
1377
|
+
style.innerHTML = `
|
|
1378
|
+
.speaking-highlight {
|
|
1379
|
+
--base-transform: ${element.style.transform};
|
|
1380
|
+
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9) !important; /* Stronger orange glow effect */
|
|
1381
|
+
// border: 3px solid green !important;
|
|
1382
|
+
// transition: box-shadow 0.5s ease-in-out, transform 0.5s ease-in-out;
|
|
1383
|
+
// transform: scale(1.05); /* Subtle scale effect to pop the element */
|
|
1384
|
+
// animation: pulseEffect 1.5s infinite; /* Pulsing animation */
|
|
1385
|
+
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
@keyframes pulseEffect {
|
|
1389
|
+
0% {
|
|
1390
|
+
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
1391
|
+
// transform: var(--base-transform) scale(1.05);
|
|
1392
|
+
// background-color: #FFFF0B;
|
|
1393
|
+
}
|
|
1394
|
+
50% {
|
|
1395
|
+
box-shadow: 0 0 30px 15px rgba(255, 165, 0, 1);
|
|
1396
|
+
// transform: var(--base-transform) scale(1.1);
|
|
1397
|
+
// background-color: #FFFF0B;
|
|
1398
|
+
}
|
|
1399
|
+
100% {
|
|
1400
|
+
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
1401
|
+
// transform: var(--base-transform) scale(1.05);
|
|
1402
|
+
// background-color: #FFFF0B;
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1385
1405
|
`;
|
|
1386
1406
|
document.head.appendChild(style);
|
|
1387
1407
|
}
|
|
@@ -2093,11 +2113,11 @@ function enableReorderDrag(element) {
|
|
|
2093
2113
|
onDropToCategory(element, category);
|
|
2094
2114
|
}
|
|
2095
2115
|
if (divEl) {
|
|
2096
|
-
const keyframes = `
|
|
2097
|
-
@keyframes widthDecrease {
|
|
2098
|
-
0% { width: ${divEl.offsetWidth}px; height: ${divEl.offsetHeight}px; }
|
|
2099
|
-
100% { width: 0px; height: 0px;}
|
|
2100
|
-
}
|
|
2116
|
+
const keyframes = `
|
|
2117
|
+
@keyframes widthDecrease {
|
|
2118
|
+
0% { width: ${divEl.offsetWidth}px; height: ${divEl.offsetHeight}px; }
|
|
2119
|
+
100% { width: 0px; height: 0px;}
|
|
2120
|
+
}
|
|
2101
2121
|
`;
|
|
2102
2122
|
const styleSheet = document.styleSheets[0];
|
|
2103
2123
|
styleSheet.insertRule(keyframes, styleSheet.cssRules.length);
|
|
@@ -2310,11 +2330,11 @@ function moveWithAnimation(target, overlapped) {
|
|
|
2310
2330
|
const dummy = createDummyElement(target);
|
|
2311
2331
|
dummy.style.visibility = 'hidden';
|
|
2312
2332
|
dummy.setAttribute('type', 'dummy');
|
|
2313
|
-
const keyframes = `
|
|
2314
|
-
@keyframes widthIncrease {
|
|
2315
|
-
0% { width: 0px; height: 0px; }
|
|
2316
|
-
100% { width: ${target.offsetWidth}px; height: ${target.offsetHeight}px;}
|
|
2317
|
-
}
|
|
2333
|
+
const keyframes = `
|
|
2334
|
+
@keyframes widthIncrease {
|
|
2335
|
+
0% { width: 0px; height: 0px; }
|
|
2336
|
+
100% { width: ${target.offsetWidth}px; height: ${target.offsetHeight}px;}
|
|
2337
|
+
}
|
|
2318
2338
|
`;
|
|
2319
2339
|
if (!overlapped) {
|
|
2320
2340
|
const overlapCategory = findMostoverlappedElement(target, 'category');
|
|
@@ -2381,12 +2401,6 @@ async function onDropToCategory(dragElement, categoryElement) {
|
|
|
2381
2401
|
}
|
|
2382
2402
|
|
|
2383
2403
|
const delay = (ms) => new Promise(res => setTimeout(res, ms));
|
|
2384
|
-
const syncSlideOrder = (container) => {
|
|
2385
|
-
const slideOrder = Array.from(container.querySelectorAll("[type='slide']"))
|
|
2386
|
-
.map(item => item['value']);
|
|
2387
|
-
container.setAttribute(SelectedValuesKey, JSON.stringify(slideOrder));
|
|
2388
|
-
return slideOrder;
|
|
2389
|
-
};
|
|
2390
2404
|
const slideAnimation = async () => {
|
|
2391
2405
|
const container = document.getElementById(LidoContainer);
|
|
2392
2406
|
if (!container)
|
|
@@ -2447,10 +2461,10 @@ function slidingWithScaling(element) {
|
|
|
2447
2461
|
const container = document.getElementById(LidoContainer);
|
|
2448
2462
|
if (container.getAttribute('canplay') === 'false')
|
|
2449
2463
|
return;
|
|
2450
|
-
// Slide activities can start in the correct order. Keep their initial DOM
|
|
2451
|
-
// order available to the Next/check validation before the first swap occurs.
|
|
2452
|
-
syncSlideOrder(container);
|
|
2453
2464
|
const onStart = (event) => {
|
|
2465
|
+
const templateId = container.getAttribute('template-id');
|
|
2466
|
+
if ((templateId === 'arrangeLetters' || templateId === 'reorder') && container.getAttribute('game-completed') === 'true')
|
|
2467
|
+
return;
|
|
2454
2468
|
removeHighlight(element);
|
|
2455
2469
|
isDragging = true;
|
|
2456
2470
|
elementRect = element.getBoundingClientRect();
|
|
@@ -2598,7 +2612,7 @@ function slidingWithScaling(element) {
|
|
|
2598
2612
|
element.style.transform = 'translate(0, 0)';
|
|
2599
2613
|
setTimeout(() => {
|
|
2600
2614
|
if (overlapElement) {
|
|
2601
|
-
slideCompleted(element);
|
|
2615
|
+
void slideCompleted(element);
|
|
2602
2616
|
overlapElement = false;
|
|
2603
2617
|
}
|
|
2604
2618
|
}, 300);
|
|
@@ -2622,20 +2636,95 @@ function slidingWithScaling(element) {
|
|
|
2622
2636
|
element.addEventListener('touchstart', onStart);
|
|
2623
2637
|
element.addEventListener(LIDO_INTERACTION_CLEANUP_EVENT, cleanup);
|
|
2624
2638
|
}
|
|
2625
|
-
const
|
|
2639
|
+
const isArrangeLettersContainer = (container) => container.getAttribute('template-id') === 'arrangeLetters';
|
|
2640
|
+
const isReorderContainer = (container) => container.getAttribute('template-id') === 'reorder';
|
|
2641
|
+
const getSlideValuesForValidation = (container, slideElements) => {
|
|
2642
|
+
if (isReorderContainer(container)) {
|
|
2643
|
+
return slideElements.map(element => element.id);
|
|
2644
|
+
}
|
|
2645
|
+
return slideElements.map(element => element['value']);
|
|
2646
|
+
};
|
|
2647
|
+
const updateArrangeLettersCorrectness = (container, slideValues, objectiveValues) => {
|
|
2648
|
+
const slideElements = Array.from(container.querySelectorAll('[type="slide"]'));
|
|
2649
|
+
slideElements.forEach((element, index) => {
|
|
2650
|
+
const isCorrect = index < objectiveValues.length && slideValues[index] === objectiveValues[index].trim();
|
|
2651
|
+
if (isCorrect) {
|
|
2652
|
+
applyBorderToClickableCell(element, '#65BC46');
|
|
2653
|
+
}
|
|
2654
|
+
else {
|
|
2655
|
+
element.style.removeProperty('box-shadow');
|
|
2656
|
+
}
|
|
2657
|
+
});
|
|
2658
|
+
};
|
|
2659
|
+
const isArrangeLettersComplete = (slideValues, objectiveString) => {
|
|
2660
|
+
if (!objectiveString)
|
|
2661
|
+
return false;
|
|
2662
|
+
const objectiveValues = objectiveString.split(',').map(value => value.trim());
|
|
2663
|
+
return slideValues.length === objectiveValues.length
|
|
2664
|
+
&& slideValues.every((value, index) => value === objectiveValues[index]);
|
|
2665
|
+
};
|
|
2666
|
+
const updateReorderCorrectness = (container, slideValues, objectiveValues) => {
|
|
2667
|
+
const slideElements = Array.from(container.querySelectorAll('[type="slide"]'));
|
|
2668
|
+
slideElements.forEach((element, index) => {
|
|
2669
|
+
const isCorrect = index < objectiveValues.length && slideValues[index] === objectiveValues[index].trim();
|
|
2670
|
+
if (isCorrect) {
|
|
2671
|
+
applyBorderToClickableCell(element, '#65BC46');
|
|
2672
|
+
}
|
|
2673
|
+
else {
|
|
2674
|
+
element.style.removeProperty('box-shadow');
|
|
2675
|
+
}
|
|
2676
|
+
});
|
|
2677
|
+
};
|
|
2678
|
+
const isReorderComplete = (slideValues, objectiveString) => {
|
|
2679
|
+
if (!objectiveString)
|
|
2680
|
+
return false;
|
|
2681
|
+
const objectiveValues = objectiveString.split(',').map(value => value.trim());
|
|
2682
|
+
return slideValues.length === objectiveValues.length
|
|
2683
|
+
&& slideValues.every((value, index) => value === objectiveValues[index]);
|
|
2684
|
+
};
|
|
2685
|
+
const slideCompleted = async (slideElement) => {
|
|
2686
|
+
var _a;
|
|
2626
2687
|
const container = document.getElementById(LidoContainer);
|
|
2627
|
-
const slideArr =
|
|
2688
|
+
const slideArr = JSON.parse((_a = container.getAttribute(SelectedValuesKey)) !== null && _a !== void 0 ? _a : '[]');
|
|
2689
|
+
const allSlideElements = Array.from(document.querySelectorAll("[type='slide']"));
|
|
2690
|
+
const slideValues = getSlideValuesForValidation(container, allSlideElements);
|
|
2691
|
+
slideValues.forEach((value, index) => {
|
|
2692
|
+
slideArr[index] = value;
|
|
2693
|
+
});
|
|
2694
|
+
container.setAttribute(SelectedValuesKey, JSON.stringify(slideArr));
|
|
2628
2695
|
const objectiveString = document.getElementById(LidoContainer)['objective'];
|
|
2629
2696
|
const objectiveArray = objectiveString.split(',');
|
|
2630
|
-
const elementIndex =
|
|
2631
|
-
const isCorrect =
|
|
2697
|
+
const elementIndex = allSlideElements.indexOf(slideElement);
|
|
2698
|
+
const isCorrect = elementIndex >= 0 && elementIndex < objectiveArray.length
|
|
2699
|
+
? matchStringPattern(slideValues[elementIndex], [objectiveArray[elementIndex].trim()])
|
|
2700
|
+
: false;
|
|
2701
|
+
if (isArrangeLettersContainer(container)) {
|
|
2702
|
+
updateArrangeLettersCorrectness(container, slideValues, objectiveArray);
|
|
2703
|
+
}
|
|
2704
|
+
else if (isReorderContainer(container)) {
|
|
2705
|
+
updateReorderCorrectness(container, slideValues, objectiveArray);
|
|
2706
|
+
}
|
|
2632
2707
|
if (container.getAttribute('is-continue-on-correct') === 'true') {
|
|
2633
2708
|
storingEachActivityScore(true);
|
|
2634
|
-
// validationForSlideHandler();
|
|
2635
2709
|
}
|
|
2636
2710
|
else {
|
|
2637
2711
|
storingEachActivityScore(isCorrect);
|
|
2638
2712
|
}
|
|
2713
|
+
if (isArrangeLettersContainer(container) || isReorderContainer(container)) {
|
|
2714
|
+
await validationForSlideHandler(slideValues);
|
|
2715
|
+
}
|
|
2716
|
+
};
|
|
2717
|
+
const validationForSlideHandler = async (slideValues) => {
|
|
2718
|
+
const container = document.getElementById(LidoContainer);
|
|
2719
|
+
if (!container || (!isArrangeLettersContainer(container) && !isReorderContainer(container)) || container.getAttribute('game-completed') === 'true')
|
|
2720
|
+
return;
|
|
2721
|
+
const objectiveString = document.getElementById(LidoContainer)['objective'];
|
|
2722
|
+
const isComplete = isArrangeLettersContainer(container)
|
|
2723
|
+
? isArrangeLettersComplete(slideValues, objectiveString)
|
|
2724
|
+
: isReorderComplete(slideValues, objectiveString);
|
|
2725
|
+
if (isComplete) {
|
|
2726
|
+
await validateObjectiveStatus();
|
|
2727
|
+
}
|
|
2639
2728
|
};
|
|
2640
2729
|
|
|
2641
2730
|
const getContainerScale = (container) => {
|
|
@@ -72855,9 +72944,11 @@ const executeActions = async (actionsString, thisElement, element) => {
|
|
|
72855
72944
|
if (dropTo === "hundredsDrop")
|
|
72856
72945
|
hundreds++;
|
|
72857
72946
|
});
|
|
72858
|
-
|
|
72859
|
-
|
|
72860
|
-
const
|
|
72947
|
+
// Blender displays the number of blocks placed in each column.
|
|
72948
|
+
// Blender's drag/drop values are also the required block counts.
|
|
72949
|
+
const unitsValue = units;
|
|
72950
|
+
const tensValue = tens;
|
|
72951
|
+
const hundredsValue = hundreds;
|
|
72861
72952
|
// ✅ Update Lido Text Boxes
|
|
72862
72953
|
const unitsBox = document.getElementById("units");
|
|
72863
72954
|
const tensBox = document.getElementById("tens");
|
|
@@ -72915,11 +73006,11 @@ const afterDropDragHandling = (dragElement, dropElement) => {
|
|
|
72915
73006
|
}
|
|
72916
73007
|
dummyElement.setAttribute('id', dragElement.getAttribute('id'));
|
|
72917
73008
|
dragElement.replaceWith(dummyElement);
|
|
72918
|
-
const keyframes = `
|
|
72919
|
-
@keyframes widthDecrease {
|
|
72920
|
-
0% { width: ${dragElement.style.width}; height: ${dragElement.style.height}; margin: ${dragElement.style.margin}; }
|
|
72921
|
-
100% { width: 0px; height: 0px; margin: 0px;}
|
|
72922
|
-
}
|
|
73009
|
+
const keyframes = `
|
|
73010
|
+
@keyframes widthDecrease {
|
|
73011
|
+
0% { width: ${dragElement.style.width}; height: ${dragElement.style.height}; margin: ${dragElement.style.margin}; }
|
|
73012
|
+
100% { width: 0px; height: 0px; margin: 0px;}
|
|
73013
|
+
}
|
|
72923
73014
|
`;
|
|
72924
73015
|
if (!isInfinite) {
|
|
72925
73016
|
dummyElement.style.width = element.style.width;
|
|
@@ -73124,13 +73215,21 @@ const calculateScore = () => {
|
|
|
73124
73215
|
gameScore.wrongMoves = 0;
|
|
73125
73216
|
};
|
|
73126
73217
|
async function onActivityComplete(dragElement, dropElement) {
|
|
73127
|
-
var _a, _b;
|
|
73218
|
+
var _a, _b, _c;
|
|
73128
73219
|
const container = document.getElementById(LidoContainer);
|
|
73129
73220
|
if (!container)
|
|
73130
73221
|
return;
|
|
73222
|
+
const isBlender = container.getAttribute('template-id') === 'blender';
|
|
73131
73223
|
await executeActions("this.alignMatch='true'", dropElement, dragElement);
|
|
73132
73224
|
if (dragElement && dropElement) {
|
|
73133
|
-
|
|
73225
|
+
let isCorrect = dropElement['value'].toLowerCase().includes(dragElement['value'].toLowerCase());
|
|
73226
|
+
if (isBlender) {
|
|
73227
|
+
const requiredDrops = Number((_a = dropElement.getAttribute('required-drops')) !== null && _a !== void 0 ? _a : 0);
|
|
73228
|
+
const placedDrops = document.querySelectorAll(`[drop-to="${dropElement.id}"]`).length;
|
|
73229
|
+
// Blender accepts every count from 1 through the required count.
|
|
73230
|
+
// Zero or an overfilled drop zone uses the incorrect action.
|
|
73231
|
+
isCorrect = placedDrops > 0 && placedDrops <= requiredDrops;
|
|
73232
|
+
}
|
|
73134
73233
|
// storing each activity score based on isCorrect for (all drag-drop events)
|
|
73135
73234
|
// storingEachActivityScore(isCorrect);
|
|
73136
73235
|
if (isCorrect) {
|
|
@@ -73139,10 +73238,10 @@ async function onActivityComplete(dragElement, dropElement) {
|
|
|
73139
73238
|
console.log("Right Moves : ", gameScore.rightMoves);
|
|
73140
73239
|
console.log("Wrong Moves : ", gameScore.wrongMoves);
|
|
73141
73240
|
}
|
|
73142
|
-
const onCorrect = ((
|
|
73241
|
+
const onCorrect = ((_b = container.getAttribute('dropAttr')) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === DropMode.EnableAnimation.toLowerCase()
|
|
73143
73242
|
? ''
|
|
73144
73243
|
: dropElement.getAttribute('onCorrect');
|
|
73145
|
-
if (onCorrect) {
|
|
73244
|
+
if (onCorrect && !isBlender) {
|
|
73146
73245
|
await executeActions(onCorrect, dropElement, dragElement);
|
|
73147
73246
|
}
|
|
73148
73247
|
//for multiply beeds
|
|
@@ -73157,7 +73256,7 @@ async function onActivityComplete(dragElement, dropElement) {
|
|
|
73157
73256
|
console.log("Wrong Moves : ", gameScore.wrongMoves);
|
|
73158
73257
|
}
|
|
73159
73258
|
const onInCorrect = dropElement.getAttribute('onInCorrect');
|
|
73160
|
-
if (onInCorrect) {
|
|
73259
|
+
if (onInCorrect && !isBlender) {
|
|
73161
73260
|
await executeActions(onInCorrect, dropElement, dragElement);
|
|
73162
73261
|
}
|
|
73163
73262
|
}
|
|
@@ -73166,7 +73265,7 @@ async function onActivityComplete(dragElement, dropElement) {
|
|
|
73166
73265
|
const sortedValues = getSortedValuesArrayFromMap(dragScore);
|
|
73167
73266
|
container.setAttribute(SelectedValuesKey, JSON.stringify(sortedValues));
|
|
73168
73267
|
//localStorage
|
|
73169
|
-
let drag = JSON.parse((
|
|
73268
|
+
let drag = JSON.parse((_c = localStorage.getItem(DragMapKey)) !== null && _c !== void 0 ? _c : '{}');
|
|
73170
73269
|
const index = dropElement.getAttribute('tab-index');
|
|
73171
73270
|
if (!drag[index]) {
|
|
73172
73271
|
drag[index] = [];
|
|
@@ -73227,7 +73326,7 @@ const storeActivityScore = (score) => {
|
|
|
73227
73326
|
activityScore[activityScoreKey] = score;
|
|
73228
73327
|
//send Custom Event to parent
|
|
73229
73328
|
// window.dispatchEvent(new CustomEvent(ActivityEndKey, { detail: { index: index, totalIndex: totalIndex, score: score } }));
|
|
73230
|
-
const actualActivitySeconds =
|
|
73329
|
+
const actualActivitySeconds = Math.ceil(Timer.getI().getElapsed() / 1000);
|
|
73231
73330
|
ACTIVYTY_TIME_SPEND_ARRAY.push(actualActivitySeconds);
|
|
73232
73331
|
console.log(`[Utils][Activity Time] Activity ${index + 1}/${totalIndex} - Time spent: ${actualActivitySeconds}s`);
|
|
73233
73332
|
const lessonTrackingParams = getLessonTrackingParams();
|
|
@@ -73239,7 +73338,7 @@ const storeActivityScore = (score) => {
|
|
|
73239
73338
|
gameScore.finalScore = Math.floor(finalScore);
|
|
73240
73339
|
console.log('Total Score : ', gameScore.finalScore);
|
|
73241
73340
|
// window.dispatchEvent(new CustomEvent(LessonEndKey, { detail: { score: finalScore } }));
|
|
73242
|
-
const timeSpendForLesson =
|
|
73341
|
+
const timeSpendForLesson = ACTIVYTY_TIME_SPEND_ARRAY.reduce((sum, current) => sum + current, 0);
|
|
73243
73342
|
console.log(`[Utils][Lesson Time] Total lesson time spent: ${timeSpendForLesson}s`);
|
|
73244
73343
|
dispatchLessonEndEvent(totalIndex, gameScore.totalRightMovesCount, gameScore.totalWrongMovesCount, finalScore, timeSpendForLesson, lessonTrackingParams);
|
|
73245
73344
|
gameScore.totalRightMovesCount = 0;
|