lido-player 0.0.2-beta-17 → 0.0.2-beta-18-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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as getAssetPath } from './index-
|
|
1
|
+
import { c as getAssetPath } from './index-BeHFCsWf.js';
|
|
2
2
|
|
|
3
3
|
const DragMapKey = 'lidoDragMap';
|
|
4
4
|
const SelectedValuesKey = 'lidoSelectedValues';
|
|
@@ -338,6 +338,7 @@ function dragDropAnimation(container, dragElement, dropElement) {
|
|
|
338
338
|
}, 250);
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
+
const isBlenderTemplate = (container) => (container === null || container === void 0 ? void 0 : container.getAttribute('template-id')) === 'blender';
|
|
341
342
|
function buildDropHasDragFromDOM() {
|
|
342
343
|
const dropHasDrag = {};
|
|
343
344
|
const dropElements = document.querySelectorAll("[type='drop']");
|
|
@@ -395,7 +396,6 @@ function enableDraggingWithScaling(element) {
|
|
|
395
396
|
let mutationFlag = false;
|
|
396
397
|
// Fetch the container element
|
|
397
398
|
const container = document.getElementById(LidoContainer);
|
|
398
|
-
const templateId = container.getAttribute("template-id");
|
|
399
399
|
if (!container) {
|
|
400
400
|
console.error(`Container with ID "container" not found.`);
|
|
401
401
|
return;
|
|
@@ -556,7 +556,7 @@ function enableDraggingWithScaling(element) {
|
|
|
556
556
|
allElements.forEach(otherElement => {
|
|
557
557
|
var _a;
|
|
558
558
|
if (storedTabIndexes.includes(JSON.parse(otherElement.getAttribute('tab-index')))) {
|
|
559
|
-
if (!(((_a = element.getAttribute('dropAttr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.Diagonal) && container
|
|
559
|
+
if (!(((_a = element.getAttribute('dropAttr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.Diagonal) && !isBlenderTemplate(container)) {
|
|
560
560
|
if (otherElement) {
|
|
561
561
|
setOpacityIfChanged(otherElement, "0.3");
|
|
562
562
|
}
|
|
@@ -644,7 +644,7 @@ function enableDraggingWithScaling(element) {
|
|
|
644
644
|
else {
|
|
645
645
|
onElementDropComplete(element, mostOverlappedElement);
|
|
646
646
|
}
|
|
647
|
-
if (
|
|
647
|
+
if (isBlenderTemplate(container) && element && mostOverlappedElement) {
|
|
648
648
|
const allElements = document.querySelectorAll(`*`);
|
|
649
649
|
allElements.forEach(el => {
|
|
650
650
|
removeHighlight(el);
|
|
@@ -872,7 +872,7 @@ async function handleResetDragElement(dragElement, dropElement, dropHasDrag, sel
|
|
|
872
872
|
highlightElement();
|
|
873
873
|
}
|
|
874
874
|
async function onElementDropComplete(dragElement, dropElement) {
|
|
875
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
875
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
876
876
|
const container = document.getElementById(LidoContainer);
|
|
877
877
|
const selectedValueData = (_a = container.getAttribute(SelectedValuesKey)) !== null && _a !== void 0 ? _a : "[]";
|
|
878
878
|
const dragSelectedData = JSON.stringify(buildDragSelectedMapFromDOM());
|
|
@@ -1094,28 +1094,48 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
1094
1094
|
// Add pulse and highlight effect for a successful match
|
|
1095
1095
|
const isCorrect = dropElement['value'].toLowerCase().includes(dragElement['value'].toLowerCase());
|
|
1096
1096
|
dispatchElementDropEvent(dragElement, dropElement, isCorrect);
|
|
1097
|
-
if (container
|
|
1097
|
+
if (!isBlenderTemplate(container)) {
|
|
1098
1098
|
storingEachActivityScore(isCorrect);
|
|
1099
1099
|
}
|
|
1100
1100
|
dragElement.style.opacity = '1';
|
|
1101
1101
|
const allDropElements = document.querySelectorAll('.drop-element');
|
|
1102
1102
|
allDropElements.forEach(el => updateDropBorder(el));
|
|
1103
|
+
if (isBlenderTemplate(container)) {
|
|
1104
|
+
const requiredDrops = Number((_j = dropElement.getAttribute('required-drops')) !== null && _j !== void 0 ? _j : 0);
|
|
1105
|
+
const placedDrops = document.querySelectorAll(`[${DropToAttr}="${dropElement.id}"]`).length;
|
|
1106
|
+
const action = placedDrops > 0 && placedDrops <= requiredDrops
|
|
1107
|
+
? dropElement.getAttribute('onCorrect')
|
|
1108
|
+
: dropElement.getAttribute('onInCorrect');
|
|
1109
|
+
if (action) {
|
|
1110
|
+
await executeActions(action, dropElement, dragElement);
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1103
1113
|
highlightElement();
|
|
1104
1114
|
await onActivityComplete(dragElement, dropElement);
|
|
1105
1115
|
}
|
|
1106
1116
|
function updateDropBorder(element) {
|
|
1117
|
+
var _a;
|
|
1107
1118
|
if (!element || !element.classList.contains('drop-element'))
|
|
1108
1119
|
return;
|
|
1109
1120
|
const container = document.getElementById(LidoContainer);
|
|
1110
1121
|
if (!container)
|
|
1111
1122
|
return;
|
|
1112
1123
|
const showBorder = container.getAttribute('show-drop-border');
|
|
1113
|
-
if (showBorder !== 'true') {
|
|
1124
|
+
if (showBorder !== 'true' && !isBlenderTemplate(container)) {
|
|
1114
1125
|
return;
|
|
1115
1126
|
}
|
|
1116
1127
|
const dropId = element.id;
|
|
1117
1128
|
const dragSelectedElements = document.querySelectorAll(`[${DropToAttr}="${dropId}"]`);
|
|
1118
|
-
if (
|
|
1129
|
+
if (isBlenderTemplate(container)) {
|
|
1130
|
+
const requiredDrops = Number((_a = element.getAttribute('required-drops')) !== null && _a !== void 0 ? _a : 0);
|
|
1131
|
+
const placedDrops = dragSelectedElements.length;
|
|
1132
|
+
const showCorrectBorder = placedDrops > 0 && placedDrops <= requiredDrops;
|
|
1133
|
+
element.classList.toggle('empty', !showCorrectBorder);
|
|
1134
|
+
element.classList.remove('filled');
|
|
1135
|
+
element.style.setProperty('border', showCorrectBorder ? '5px dashed green' : '5px dashed #f34d08', 'important');
|
|
1136
|
+
return;
|
|
1137
|
+
}
|
|
1138
|
+
if (dragSelectedElements.length > 0 && !isBlenderTemplate(container)) {
|
|
1119
1139
|
element.classList.add('filled');
|
|
1120
1140
|
element.classList.remove('empty');
|
|
1121
1141
|
element.classList.remove('highlight-element');
|
|
@@ -1157,14 +1177,14 @@ async function onClickDropOrDragElement(element, type) {
|
|
|
1157
1177
|
if (!document.querySelector('#dynamic-highlight-style')) {
|
|
1158
1178
|
const style = document.createElement('style');
|
|
1159
1179
|
style.id = 'dynamic-highlight-style';
|
|
1160
|
-
style.innerHTML = `
|
|
1161
|
-
.highlight {
|
|
1162
|
-
// border: 4px solid #e74c3c; /* Thicker red border for more visibility */
|
|
1163
|
-
// border-radius: 12px; /* Larger rounded corners */
|
|
1164
|
-
// background-color: rgba(231, 76, 60, 0.3); /* Stronger, more noticeable background */
|
|
1165
|
-
// box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 12px 40px rgba(0, 0, 0, 0.2); /* Stronger shadow */
|
|
1166
|
-
// outline: 4px solid rgba(231, 76, 60, 0.6); /* Glow effect */
|
|
1167
|
-
}
|
|
1180
|
+
style.innerHTML = `
|
|
1181
|
+
.highlight {
|
|
1182
|
+
// border: 4px solid #e74c3c; /* Thicker red border for more visibility */
|
|
1183
|
+
// border-radius: 12px; /* Larger rounded corners */
|
|
1184
|
+
// background-color: rgba(231, 76, 60, 0.3); /* Stronger, more noticeable background */
|
|
1185
|
+
// box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 12px 40px rgba(0, 0, 0, 0.2); /* Stronger shadow */
|
|
1186
|
+
// outline: 4px solid rgba(231, 76, 60, 0.6); /* Glow effect */
|
|
1187
|
+
}
|
|
1168
1188
|
`;
|
|
1169
1189
|
document.head.appendChild(style);
|
|
1170
1190
|
}
|
|
@@ -1202,7 +1222,7 @@ async function onClickDropOrDragElement(element, type) {
|
|
|
1202
1222
|
// Move the drag element to the drop position
|
|
1203
1223
|
selectedDragElement.style.transform = `translate(${translateX}px, ${translateY}px)`;
|
|
1204
1224
|
// Remove highlights after moving the element
|
|
1205
|
-
if (container
|
|
1225
|
+
if (!isBlenderTemplate(container)) {
|
|
1206
1226
|
const allElements = document.querySelectorAll(`*`);
|
|
1207
1227
|
allElements.forEach(el => {
|
|
1208
1228
|
removeHighlight(el);
|
|
@@ -1352,34 +1372,34 @@ function highlightSpeakingElement(element) {
|
|
|
1352
1372
|
if (!document.getElementById(styleId)) {
|
|
1353
1373
|
const style = document.createElement('style');
|
|
1354
1374
|
style.id = styleId;
|
|
1355
|
-
style.innerHTML = `
|
|
1356
|
-
.speaking-highlight {
|
|
1357
|
-
--base-transform: ${element.style.transform};
|
|
1358
|
-
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9) !important; /* Stronger orange glow effect */
|
|
1359
|
-
// border: 3px solid green !important;
|
|
1360
|
-
// transition: box-shadow 0.5s ease-in-out, transform 0.5s ease-in-out;
|
|
1361
|
-
// transform: scale(1.05); /* Subtle scale effect to pop the element */
|
|
1362
|
-
// animation: pulseEffect 1.5s infinite; /* Pulsing animation */
|
|
1363
|
-
|
|
1364
|
-
}
|
|
1365
|
-
|
|
1366
|
-
@keyframes pulseEffect {
|
|
1367
|
-
0% {
|
|
1368
|
-
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
1369
|
-
// transform: var(--base-transform) scale(1.05);
|
|
1370
|
-
// background-color: #FFFF0B;
|
|
1371
|
-
}
|
|
1372
|
-
50% {
|
|
1373
|
-
box-shadow: 0 0 30px 15px rgba(255, 165, 0, 1);
|
|
1374
|
-
// transform: var(--base-transform) scale(1.1);
|
|
1375
|
-
// background-color: #FFFF0B;
|
|
1376
|
-
}
|
|
1377
|
-
100% {
|
|
1378
|
-
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
1379
|
-
// transform: var(--base-transform) scale(1.05);
|
|
1380
|
-
// background-color: #FFFF0B;
|
|
1381
|
-
}
|
|
1382
|
-
}
|
|
1375
|
+
style.innerHTML = `
|
|
1376
|
+
.speaking-highlight {
|
|
1377
|
+
--base-transform: ${element.style.transform};
|
|
1378
|
+
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9) !important; /* Stronger orange glow effect */
|
|
1379
|
+
// border: 3px solid green !important;
|
|
1380
|
+
// transition: box-shadow 0.5s ease-in-out, transform 0.5s ease-in-out;
|
|
1381
|
+
// transform: scale(1.05); /* Subtle scale effect to pop the element */
|
|
1382
|
+
// animation: pulseEffect 1.5s infinite; /* Pulsing animation */
|
|
1383
|
+
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
@keyframes pulseEffect {
|
|
1387
|
+
0% {
|
|
1388
|
+
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
1389
|
+
// transform: var(--base-transform) scale(1.05);
|
|
1390
|
+
// background-color: #FFFF0B;
|
|
1391
|
+
}
|
|
1392
|
+
50% {
|
|
1393
|
+
box-shadow: 0 0 30px 15px rgba(255, 165, 0, 1);
|
|
1394
|
+
// transform: var(--base-transform) scale(1.1);
|
|
1395
|
+
// background-color: #FFFF0B;
|
|
1396
|
+
}
|
|
1397
|
+
100% {
|
|
1398
|
+
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
1399
|
+
// transform: var(--base-transform) scale(1.05);
|
|
1400
|
+
// background-color: #FFFF0B;
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1383
1403
|
`;
|
|
1384
1404
|
document.head.appendChild(style);
|
|
1385
1405
|
}
|
|
@@ -2091,11 +2111,11 @@ function enableReorderDrag(element) {
|
|
|
2091
2111
|
onDropToCategory(element, category);
|
|
2092
2112
|
}
|
|
2093
2113
|
if (divEl) {
|
|
2094
|
-
const keyframes = `
|
|
2095
|
-
@keyframes widthDecrease {
|
|
2096
|
-
0% { width: ${divEl.offsetWidth}px; height: ${divEl.offsetHeight}px; }
|
|
2097
|
-
100% { width: 0px; height: 0px;}
|
|
2098
|
-
}
|
|
2114
|
+
const keyframes = `
|
|
2115
|
+
@keyframes widthDecrease {
|
|
2116
|
+
0% { width: ${divEl.offsetWidth}px; height: ${divEl.offsetHeight}px; }
|
|
2117
|
+
100% { width: 0px; height: 0px;}
|
|
2118
|
+
}
|
|
2099
2119
|
`;
|
|
2100
2120
|
const styleSheet = document.styleSheets[0];
|
|
2101
2121
|
styleSheet.insertRule(keyframes, styleSheet.cssRules.length);
|
|
@@ -2308,11 +2328,11 @@ function moveWithAnimation(target, overlapped) {
|
|
|
2308
2328
|
const dummy = createDummyElement(target);
|
|
2309
2329
|
dummy.style.visibility = 'hidden';
|
|
2310
2330
|
dummy.setAttribute('type', 'dummy');
|
|
2311
|
-
const keyframes = `
|
|
2312
|
-
@keyframes widthIncrease {
|
|
2313
|
-
0% { width: 0px; height: 0px; }
|
|
2314
|
-
100% { width: ${target.offsetWidth}px; height: ${target.offsetHeight}px;}
|
|
2315
|
-
}
|
|
2331
|
+
const keyframes = `
|
|
2332
|
+
@keyframes widthIncrease {
|
|
2333
|
+
0% { width: 0px; height: 0px; }
|
|
2334
|
+
100% { width: ${target.offsetWidth}px; height: ${target.offsetHeight}px;}
|
|
2335
|
+
}
|
|
2316
2336
|
`;
|
|
2317
2337
|
if (!overlapped) {
|
|
2318
2338
|
const overlapCategory = findMostoverlappedElement(target, 'category');
|
|
@@ -2379,12 +2399,6 @@ async function onDropToCategory(dragElement, categoryElement) {
|
|
|
2379
2399
|
}
|
|
2380
2400
|
|
|
2381
2401
|
const delay = (ms) => new Promise(res => setTimeout(res, ms));
|
|
2382
|
-
const syncSlideOrder = (container) => {
|
|
2383
|
-
const slideOrder = Array.from(container.querySelectorAll("[type='slide']"))
|
|
2384
|
-
.map(item => item['value']);
|
|
2385
|
-
container.setAttribute(SelectedValuesKey, JSON.stringify(slideOrder));
|
|
2386
|
-
return slideOrder;
|
|
2387
|
-
};
|
|
2388
2402
|
const slideAnimation = async () => {
|
|
2389
2403
|
const container = document.getElementById(LidoContainer);
|
|
2390
2404
|
if (!container)
|
|
@@ -2445,10 +2459,10 @@ function slidingWithScaling(element) {
|
|
|
2445
2459
|
const container = document.getElementById(LidoContainer);
|
|
2446
2460
|
if (container.getAttribute('canplay') === 'false')
|
|
2447
2461
|
return;
|
|
2448
|
-
// Slide activities can start in the correct order. Keep their initial DOM
|
|
2449
|
-
// order available to the Next/check validation before the first swap occurs.
|
|
2450
|
-
syncSlideOrder(container);
|
|
2451
2462
|
const onStart = (event) => {
|
|
2463
|
+
const templateId = container.getAttribute('template-id');
|
|
2464
|
+
if ((templateId === 'arrangeLetters' || templateId === 'reorder') && container.getAttribute('game-completed') === 'true')
|
|
2465
|
+
return;
|
|
2452
2466
|
removeHighlight(element);
|
|
2453
2467
|
isDragging = true;
|
|
2454
2468
|
elementRect = element.getBoundingClientRect();
|
|
@@ -2596,7 +2610,7 @@ function slidingWithScaling(element) {
|
|
|
2596
2610
|
element.style.transform = 'translate(0, 0)';
|
|
2597
2611
|
setTimeout(() => {
|
|
2598
2612
|
if (overlapElement) {
|
|
2599
|
-
slideCompleted(element);
|
|
2613
|
+
void slideCompleted(element);
|
|
2600
2614
|
overlapElement = false;
|
|
2601
2615
|
}
|
|
2602
2616
|
}, 300);
|
|
@@ -2620,20 +2634,95 @@ function slidingWithScaling(element) {
|
|
|
2620
2634
|
element.addEventListener('touchstart', onStart);
|
|
2621
2635
|
element.addEventListener(LIDO_INTERACTION_CLEANUP_EVENT, cleanup);
|
|
2622
2636
|
}
|
|
2623
|
-
const
|
|
2637
|
+
const isArrangeLettersContainer = (container) => container.getAttribute('template-id') === 'arrangeLetters';
|
|
2638
|
+
const isReorderContainer = (container) => container.getAttribute('template-id') === 'reorder';
|
|
2639
|
+
const getSlideValuesForValidation = (container, slideElements) => {
|
|
2640
|
+
if (isReorderContainer(container)) {
|
|
2641
|
+
return slideElements.map(element => element.id);
|
|
2642
|
+
}
|
|
2643
|
+
return slideElements.map(element => element['value']);
|
|
2644
|
+
};
|
|
2645
|
+
const updateArrangeLettersCorrectness = (container, slideValues, objectiveValues) => {
|
|
2646
|
+
const slideElements = Array.from(container.querySelectorAll('[type="slide"]'));
|
|
2647
|
+
slideElements.forEach((element, index) => {
|
|
2648
|
+
const isCorrect = index < objectiveValues.length && slideValues[index] === objectiveValues[index].trim();
|
|
2649
|
+
if (isCorrect) {
|
|
2650
|
+
applyBorderToClickableCell(element, '#65BC46');
|
|
2651
|
+
}
|
|
2652
|
+
else {
|
|
2653
|
+
element.style.removeProperty('box-shadow');
|
|
2654
|
+
}
|
|
2655
|
+
});
|
|
2656
|
+
};
|
|
2657
|
+
const isArrangeLettersComplete = (slideValues, objectiveString) => {
|
|
2658
|
+
if (!objectiveString)
|
|
2659
|
+
return false;
|
|
2660
|
+
const objectiveValues = objectiveString.split(',').map(value => value.trim());
|
|
2661
|
+
return slideValues.length === objectiveValues.length
|
|
2662
|
+
&& slideValues.every((value, index) => value === objectiveValues[index]);
|
|
2663
|
+
};
|
|
2664
|
+
const updateReorderCorrectness = (container, slideValues, objectiveValues) => {
|
|
2665
|
+
const slideElements = Array.from(container.querySelectorAll('[type="slide"]'));
|
|
2666
|
+
slideElements.forEach((element, index) => {
|
|
2667
|
+
const isCorrect = index < objectiveValues.length && slideValues[index] === objectiveValues[index].trim();
|
|
2668
|
+
if (isCorrect) {
|
|
2669
|
+
applyBorderToClickableCell(element, '#65BC46');
|
|
2670
|
+
}
|
|
2671
|
+
else {
|
|
2672
|
+
element.style.removeProperty('box-shadow');
|
|
2673
|
+
}
|
|
2674
|
+
});
|
|
2675
|
+
};
|
|
2676
|
+
const isReorderComplete = (slideValues, objectiveString) => {
|
|
2677
|
+
if (!objectiveString)
|
|
2678
|
+
return false;
|
|
2679
|
+
const objectiveValues = objectiveString.split(',').map(value => value.trim());
|
|
2680
|
+
return slideValues.length === objectiveValues.length
|
|
2681
|
+
&& slideValues.every((value, index) => value === objectiveValues[index]);
|
|
2682
|
+
};
|
|
2683
|
+
const slideCompleted = async (slideElement) => {
|
|
2684
|
+
var _a;
|
|
2624
2685
|
const container = document.getElementById(LidoContainer);
|
|
2625
|
-
const slideArr =
|
|
2686
|
+
const slideArr = JSON.parse((_a = container.getAttribute(SelectedValuesKey)) !== null && _a !== void 0 ? _a : '[]');
|
|
2687
|
+
const allSlideElements = Array.from(document.querySelectorAll("[type='slide']"));
|
|
2688
|
+
const slideValues = getSlideValuesForValidation(container, allSlideElements);
|
|
2689
|
+
slideValues.forEach((value, index) => {
|
|
2690
|
+
slideArr[index] = value;
|
|
2691
|
+
});
|
|
2692
|
+
container.setAttribute(SelectedValuesKey, JSON.stringify(slideArr));
|
|
2626
2693
|
const objectiveString = document.getElementById(LidoContainer)['objective'];
|
|
2627
2694
|
const objectiveArray = objectiveString.split(',');
|
|
2628
|
-
const elementIndex =
|
|
2629
|
-
const isCorrect =
|
|
2695
|
+
const elementIndex = allSlideElements.indexOf(slideElement);
|
|
2696
|
+
const isCorrect = elementIndex >= 0 && elementIndex < objectiveArray.length
|
|
2697
|
+
? matchStringPattern(slideValues[elementIndex], [objectiveArray[elementIndex].trim()])
|
|
2698
|
+
: false;
|
|
2699
|
+
if (isArrangeLettersContainer(container)) {
|
|
2700
|
+
updateArrangeLettersCorrectness(container, slideValues, objectiveArray);
|
|
2701
|
+
}
|
|
2702
|
+
else if (isReorderContainer(container)) {
|
|
2703
|
+
updateReorderCorrectness(container, slideValues, objectiveArray);
|
|
2704
|
+
}
|
|
2630
2705
|
if (container.getAttribute('is-continue-on-correct') === 'true') {
|
|
2631
2706
|
storingEachActivityScore(true);
|
|
2632
|
-
// validationForSlideHandler();
|
|
2633
2707
|
}
|
|
2634
2708
|
else {
|
|
2635
2709
|
storingEachActivityScore(isCorrect);
|
|
2636
2710
|
}
|
|
2711
|
+
if (isArrangeLettersContainer(container) || isReorderContainer(container)) {
|
|
2712
|
+
await validationForSlideHandler(slideValues);
|
|
2713
|
+
}
|
|
2714
|
+
};
|
|
2715
|
+
const validationForSlideHandler = async (slideValues) => {
|
|
2716
|
+
const container = document.getElementById(LidoContainer);
|
|
2717
|
+
if (!container || (!isArrangeLettersContainer(container) && !isReorderContainer(container)) || container.getAttribute('game-completed') === 'true')
|
|
2718
|
+
return;
|
|
2719
|
+
const objectiveString = document.getElementById(LidoContainer)['objective'];
|
|
2720
|
+
const isComplete = isArrangeLettersContainer(container)
|
|
2721
|
+
? isArrangeLettersComplete(slideValues, objectiveString)
|
|
2722
|
+
: isReorderComplete(slideValues, objectiveString);
|
|
2723
|
+
if (isComplete) {
|
|
2724
|
+
await validateObjectiveStatus();
|
|
2725
|
+
}
|
|
2637
2726
|
};
|
|
2638
2727
|
|
|
2639
2728
|
const getContainerScale = (container) => {
|
|
@@ -72853,9 +72942,11 @@ const executeActions = async (actionsString, thisElement, element) => {
|
|
|
72853
72942
|
if (dropTo === "hundredsDrop")
|
|
72854
72943
|
hundreds++;
|
|
72855
72944
|
});
|
|
72856
|
-
|
|
72857
|
-
|
|
72858
|
-
const
|
|
72945
|
+
// Blender displays the number of blocks placed in each column.
|
|
72946
|
+
// Blender's drag/drop values are also the required block counts.
|
|
72947
|
+
const unitsValue = units;
|
|
72948
|
+
const tensValue = tens;
|
|
72949
|
+
const hundredsValue = hundreds;
|
|
72859
72950
|
// ✅ Update Lido Text Boxes
|
|
72860
72951
|
const unitsBox = document.getElementById("units");
|
|
72861
72952
|
const tensBox = document.getElementById("tens");
|
|
@@ -72913,11 +73004,11 @@ const afterDropDragHandling = (dragElement, dropElement) => {
|
|
|
72913
73004
|
}
|
|
72914
73005
|
dummyElement.setAttribute('id', dragElement.getAttribute('id'));
|
|
72915
73006
|
dragElement.replaceWith(dummyElement);
|
|
72916
|
-
const keyframes = `
|
|
72917
|
-
@keyframes widthDecrease {
|
|
72918
|
-
0% { width: ${dragElement.style.width}; height: ${dragElement.style.height}; margin: ${dragElement.style.margin}; }
|
|
72919
|
-
100% { width: 0px; height: 0px; margin: 0px;}
|
|
72920
|
-
}
|
|
73007
|
+
const keyframes = `
|
|
73008
|
+
@keyframes widthDecrease {
|
|
73009
|
+
0% { width: ${dragElement.style.width}; height: ${dragElement.style.height}; margin: ${dragElement.style.margin}; }
|
|
73010
|
+
100% { width: 0px; height: 0px; margin: 0px;}
|
|
73011
|
+
}
|
|
72921
73012
|
`;
|
|
72922
73013
|
if (!isInfinite) {
|
|
72923
73014
|
dummyElement.style.width = element.style.width;
|
|
@@ -73122,13 +73213,21 @@ const calculateScore = () => {
|
|
|
73122
73213
|
gameScore.wrongMoves = 0;
|
|
73123
73214
|
};
|
|
73124
73215
|
async function onActivityComplete(dragElement, dropElement) {
|
|
73125
|
-
var _a, _b;
|
|
73216
|
+
var _a, _b, _c;
|
|
73126
73217
|
const container = document.getElementById(LidoContainer);
|
|
73127
73218
|
if (!container)
|
|
73128
73219
|
return;
|
|
73220
|
+
const isBlender = container.getAttribute('template-id') === 'blender';
|
|
73129
73221
|
await executeActions("this.alignMatch='true'", dropElement, dragElement);
|
|
73130
73222
|
if (dragElement && dropElement) {
|
|
73131
|
-
|
|
73223
|
+
let isCorrect = dropElement['value'].toLowerCase().includes(dragElement['value'].toLowerCase());
|
|
73224
|
+
if (isBlender) {
|
|
73225
|
+
const requiredDrops = Number((_a = dropElement.getAttribute('required-drops')) !== null && _a !== void 0 ? _a : 0);
|
|
73226
|
+
const placedDrops = document.querySelectorAll(`[drop-to="${dropElement.id}"]`).length;
|
|
73227
|
+
// Blender accepts every count from 1 through the required count.
|
|
73228
|
+
// Zero or an overfilled drop zone uses the incorrect action.
|
|
73229
|
+
isCorrect = placedDrops > 0 && placedDrops <= requiredDrops;
|
|
73230
|
+
}
|
|
73132
73231
|
// storing each activity score based on isCorrect for (all drag-drop events)
|
|
73133
73232
|
// storingEachActivityScore(isCorrect);
|
|
73134
73233
|
if (isCorrect) {
|
|
@@ -73137,10 +73236,10 @@ async function onActivityComplete(dragElement, dropElement) {
|
|
|
73137
73236
|
console.log("Right Moves : ", gameScore.rightMoves);
|
|
73138
73237
|
console.log("Wrong Moves : ", gameScore.wrongMoves);
|
|
73139
73238
|
}
|
|
73140
|
-
const onCorrect = ((
|
|
73239
|
+
const onCorrect = ((_b = container.getAttribute('dropAttr')) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === DropMode.EnableAnimation.toLowerCase()
|
|
73141
73240
|
? ''
|
|
73142
73241
|
: dropElement.getAttribute('onCorrect');
|
|
73143
|
-
if (onCorrect) {
|
|
73242
|
+
if (onCorrect && !isBlender) {
|
|
73144
73243
|
await executeActions(onCorrect, dropElement, dragElement);
|
|
73145
73244
|
}
|
|
73146
73245
|
//for multiply beeds
|
|
@@ -73155,7 +73254,7 @@ async function onActivityComplete(dragElement, dropElement) {
|
|
|
73155
73254
|
console.log("Wrong Moves : ", gameScore.wrongMoves);
|
|
73156
73255
|
}
|
|
73157
73256
|
const onInCorrect = dropElement.getAttribute('onInCorrect');
|
|
73158
|
-
if (onInCorrect) {
|
|
73257
|
+
if (onInCorrect && !isBlender) {
|
|
73159
73258
|
await executeActions(onInCorrect, dropElement, dragElement);
|
|
73160
73259
|
}
|
|
73161
73260
|
}
|
|
@@ -73164,7 +73263,7 @@ async function onActivityComplete(dragElement, dropElement) {
|
|
|
73164
73263
|
const sortedValues = getSortedValuesArrayFromMap(dragScore);
|
|
73165
73264
|
container.setAttribute(SelectedValuesKey, JSON.stringify(sortedValues));
|
|
73166
73265
|
//localStorage
|
|
73167
|
-
let drag = JSON.parse((
|
|
73266
|
+
let drag = JSON.parse((_c = localStorage.getItem(DragMapKey)) !== null && _c !== void 0 ? _c : '{}');
|
|
73168
73267
|
const index = dropElement.getAttribute('tab-index');
|
|
73169
73268
|
if (!drag[index]) {
|
|
73170
73269
|
drag[index] = [];
|
|
@@ -73225,7 +73324,7 @@ const storeActivityScore = (score) => {
|
|
|
73225
73324
|
activityScore[activityScoreKey] = score;
|
|
73226
73325
|
//send Custom Event to parent
|
|
73227
73326
|
// window.dispatchEvent(new CustomEvent(ActivityEndKey, { detail: { index: index, totalIndex: totalIndex, score: score } }));
|
|
73228
|
-
const actualActivitySeconds =
|
|
73327
|
+
const actualActivitySeconds = Math.ceil(Timer.getI().getElapsed() / 1000);
|
|
73229
73328
|
ACTIVYTY_TIME_SPEND_ARRAY.push(actualActivitySeconds);
|
|
73230
73329
|
console.log(`[Utils][Activity Time] Activity ${index + 1}/${totalIndex} - Time spent: ${actualActivitySeconds}s`);
|
|
73231
73330
|
const lessonTrackingParams = getLessonTrackingParams();
|
|
@@ -73237,7 +73336,7 @@ const storeActivityScore = (score) => {
|
|
|
73237
73336
|
gameScore.finalScore = Math.floor(finalScore);
|
|
73238
73337
|
console.log('Total Score : ', gameScore.finalScore);
|
|
73239
73338
|
// window.dispatchEvent(new CustomEvent(LessonEndKey, { detail: { score: finalScore } }));
|
|
73240
|
-
const timeSpendForLesson =
|
|
73339
|
+
const timeSpendForLesson = ACTIVYTY_TIME_SPEND_ARRAY.reduce((sum, current) => sum + current, 0);
|
|
73241
73340
|
console.log(`[Utils][Lesson Time] Total lesson time spent: ${timeSpendForLesson}s`);
|
|
73242
73341
|
dispatchLessonEndEvent(totalIndex, gameScore.totalRightMovesCount, gameScore.totalWrongMovesCount, finalScore, timeSpendForLesson, lessonTrackingParams);
|
|
73243
73342
|
gameScore.totalRightMovesCount = 0;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { $ as format } from './index-
|
|
2
|
-
import './index-
|
|
1
|
+
export { $ as format } from './index-D-29PaRa.js';
|
|
2
|
+
import './index-BeHFCsWf.js';
|