lido-player 0.0.2-alpha-65 → 0.0.2-alpha-67
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/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/lido-avatar_22.cjs.entry.js +1 -1
- package/dist/cjs/{utils-6fbaf604.js → utils-a4d02b2b.js} +45 -28
- package/dist/collection/stories/Templates/LetterPairing/LetterPairing.stories.js +5 -5
- package/dist/collection/stories/Templates/balancing/balancing.stories.js +2 -2
- package/dist/collection/stories/Templates/create-sentence/createSentence.stories.js +8 -8
- package/dist/collection/stories/Templates/palEgra_build_word/palEgra_build_word.stories.js +1 -1
- package/dist/collection/utils/constants.js +5 -5
- package/dist/collection/utils/customEvents.js +4 -4
- package/dist/collection/utils/utils.js +17 -9
- package/dist/collection/utils/utilsHandlers/dragDropHandler.js +2 -2
- package/dist/collection/utils/utilsHandlers/lidoBalanceHandler.js +4 -5
- package/dist/collection/utils/utilsHandlers/slideHandler.js +14 -2
- 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-image.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 +22 -22
- 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-cf94b10e.js → p-01a666ff.js} +1 -1
- package/dist/components/{p-1238f648.js → p-1d55ba8d.js} +1 -1
- package/dist/components/{p-6b9fcb83.js → p-2c957cc9.js} +2 -2
- package/dist/components/{p-50a2d817.js → p-395ab663.js} +1 -1
- package/dist/components/{p-56a84433.js → p-41d68189.js} +2 -2
- package/dist/components/{p-50896aee.js → p-4a0e8cc7.js} +1 -1
- package/dist/components/{p-03e44e4a.js → p-4dc22f2d.js} +1 -1
- package/dist/components/{p-c682e9ff.js → p-63a5cb05.js} +3 -3
- package/dist/components/{p-4c026d99.js → p-6c567c84.js} +1 -1
- package/dist/components/{p-9f03a14c.js → p-70f6a19d.js} +1 -1
- package/dist/components/{p-bb46f8e2.js → p-748778ca.js} +1 -1
- package/dist/components/{p-dc616111.js → p-80a747ee.js} +1 -1
- package/dist/components/{p-f0a5d487.js → p-962c0e53.js} +21 -21
- package/dist/components/{p-80c422c2.js → p-9ce3df77.js} +1 -1
- package/dist/components/{p-342bed2e.js → p-a4156ea2.js} +1 -1
- package/dist/components/{p-09a49b19.js → p-b2a85579.js} +1 -1
- package/dist/components/{p-0f72edb4.js → p-d11fe4a9.js} +1 -1
- package/dist/components/{p-d764f75c.js → p-d123a5dd.js} +1 -1
- package/dist/components/{p-d0fc464d.js → p-d73b8e72.js} +1 -1
- package/dist/components/{p-4c870db5.js → p-f7212d52.js} +1 -1
- package/dist/components/{p-5aeef0cc.js → p-fa60ef00.js} +2 -2
- package/dist/components/{p-873471c6.js → p-ff8ce1fd.js} +45 -28
- package/dist/esm/index.js +1 -1
- package/dist/esm/lido-avatar_22.entry.js +1 -1
- package/dist/esm/{utils-db03cb43.js → utils-e1e56072.js} +45 -28
- package/dist/lido-player/index.esm.js +1 -1
- package/dist/lido-player/lido-player.esm.js +1 -1
- package/dist/lido-player/{p-5e0def71.js → p-4ea93194.js} +2 -2
- package/dist/lido-player/{p-6192dda7.entry.js → p-dc6813ed.entry.js} +1 -1
- package/dist/types/utils/constants.d.ts +5 -5
- package/dist/types/utils/customEvents.d.ts +2 -2
- package/package.json +1 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -49,11 +49,11 @@ exports.DropAction = void 0;
|
|
|
49
49
|
DropAction["Move"] = "move";
|
|
50
50
|
DropAction["Hide"] = "hide";
|
|
51
51
|
})(exports.DropAction || (exports.DropAction = {}));
|
|
52
|
-
const exitUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Close.
|
|
53
|
-
const prevUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Previous.
|
|
54
|
-
const nextUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Next.
|
|
55
|
-
const speakUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/
|
|
56
|
-
const fingerUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/trace/Tracing-hand.
|
|
52
|
+
const exitUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Close.png';
|
|
53
|
+
const prevUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Previous.png';
|
|
54
|
+
const nextUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Next.png';
|
|
55
|
+
const speakUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/NavAudio.png';
|
|
56
|
+
const fingerUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/trace/Tracing-hand.png';
|
|
57
57
|
|
|
58
58
|
class Timer {
|
|
59
59
|
constructor() {
|
|
@@ -114,11 +114,11 @@ function dispatchCustomEvent(eventName, detail) {
|
|
|
114
114
|
const event = new CustomEvent(eventName, { detail });
|
|
115
115
|
window.dispatchEvent(event);
|
|
116
116
|
}
|
|
117
|
-
function dispatchActivityEndEvent(
|
|
118
|
-
dispatchCustomEvent(ActivityEndKey, {
|
|
117
|
+
function dispatchActivityEndEvent(totalIndex, currentIndex, score, rightMoves, wrongMoves) {
|
|
118
|
+
dispatchCustomEvent(ActivityEndKey, { currentIndex, totalIndex, score, rightMoves, wrongMoves });
|
|
119
119
|
}
|
|
120
|
-
function dispatchLessonEndEvent(
|
|
121
|
-
dispatchCustomEvent(LessonEndKey, {
|
|
120
|
+
function dispatchLessonEndEvent(totalIndex, rightMoves, wrongMoves, finalScore) {
|
|
121
|
+
dispatchCustomEvent(LessonEndKey, { totalIndex, rightMoves, wrongMoves, finalScore, timeSpent: Math.floor(Timer.getI().getElapsed() / 1000) });
|
|
122
122
|
}
|
|
123
123
|
function dispatchNextContainerEvent() {
|
|
124
124
|
dispatchCustomEvent(NextContainerKey, {});
|
|
@@ -174,7 +174,7 @@ function updateBalanceOnDrop(dragElement, dropElement) {
|
|
|
174
174
|
}
|
|
175
175
|
function calculateValue(elements, operation) {
|
|
176
176
|
if (elements.length === 0)
|
|
177
|
-
return
|
|
177
|
+
return null;
|
|
178
178
|
if (operation === "count") {
|
|
179
179
|
return elements.length;
|
|
180
180
|
}
|
|
@@ -206,18 +206,15 @@ function calculateValue(elements, operation) {
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
function balanceResult(container, objectiveString) {
|
|
209
|
-
var _a, _b, _c, _d, _e, _f;
|
|
210
209
|
const additionalCheck = container.getAttribute('equationCheck');
|
|
211
210
|
if (!additionalCheck)
|
|
212
211
|
return false;
|
|
213
212
|
const balanceEl = document.querySelector('lido-balance');
|
|
214
213
|
if (!balanceEl)
|
|
215
214
|
return false;
|
|
216
|
-
const leftVal =
|
|
217
|
-
const rightVal =
|
|
218
|
-
|
|
219
|
-
const hasRight = !isNaN(rightVal);
|
|
220
|
-
if (!hasLeft || !hasRight) {
|
|
215
|
+
const leftVal = balanceEl.leftVal;
|
|
216
|
+
const rightVal = balanceEl.rightVal;
|
|
217
|
+
if (leftVal == null || rightVal == null) {
|
|
221
218
|
return false;
|
|
222
219
|
}
|
|
223
220
|
const symbol = leftVal > rightVal ? '>' : leftVal < rightVal ? '<' : '=';
|
|
@@ -800,7 +797,7 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
800
797
|
await executeActions(onInCorrect, dropElement, dragElement);
|
|
801
798
|
setTimeout(() => {
|
|
802
799
|
dragElement.style.transform = 'translate(0, 0)';
|
|
803
|
-
storingEachActivityScore(false);
|
|
800
|
+
// storingEachActivityScore(false);
|
|
804
801
|
// const oldDropIndex = dragToDropMap[dragElement.getAttribute('data-id')];
|
|
805
802
|
// if (oldDropIndex !== undefined && dropHasDrag[oldDropIndex]) {
|
|
806
803
|
// dropHasDrag[oldDropIndex].isFull = false;
|
|
@@ -963,7 +960,7 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
963
960
|
// Add pulse and highlight effect for a successful match
|
|
964
961
|
const isCorrect = dropElement['value'].toLowerCase().includes(dragElement['value'].toLowerCase());
|
|
965
962
|
dispatchElementDropEvent(dragElement, dropElement, isCorrect);
|
|
966
|
-
|
|
963
|
+
storingEachActivityScore(isCorrect);
|
|
967
964
|
dragElement.style.opacity = '1';
|
|
968
965
|
const allDropElements = document.querySelectorAll('.drop-element');
|
|
969
966
|
allDropElements.forEach(el => updateDropBorder(el));
|
|
@@ -2040,12 +2037,24 @@ const slideCompleted = (slideElement) => {
|
|
|
2040
2037
|
const isCorrect = matchStringPattern(slideElement['value'], [objectiveArray[elementIndex].trim()]);
|
|
2041
2038
|
if (container.getAttribute('is-continue-on-correct') === 'true') {
|
|
2042
2039
|
storingEachActivityScore(true);
|
|
2043
|
-
|
|
2040
|
+
validationForSlideHandler();
|
|
2044
2041
|
}
|
|
2045
2042
|
else {
|
|
2046
2043
|
storingEachActivityScore(isCorrect);
|
|
2047
2044
|
}
|
|
2048
2045
|
};
|
|
2046
|
+
const validationForSlideHandler = async () => {
|
|
2047
|
+
var _a, _b;
|
|
2048
|
+
const container = document.getElementById(LidoContainer);
|
|
2049
|
+
if (!container)
|
|
2050
|
+
return;
|
|
2051
|
+
const objectiveArray = (_b = JSON.parse((_a = container.getAttribute(SelectedValuesKey)) !== null && _a !== void 0 ? _a : '[]')) !== null && _b !== void 0 ? _b : [];
|
|
2052
|
+
const objectiveString = document.getElementById(LidoContainer)['objective'];
|
|
2053
|
+
const res = matchStringPattern(objectiveString, objectiveArray);
|
|
2054
|
+
if (res) {
|
|
2055
|
+
await executeActions(container.getAttribute('onCorrect'), container);
|
|
2056
|
+
}
|
|
2057
|
+
};
|
|
2049
2058
|
|
|
2050
2059
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
2051
2060
|
|
|
@@ -68809,6 +68818,7 @@ const executeActions = async (actionsString, thisElement, element) => {
|
|
|
68809
68818
|
AudioPlayer.getI().stop();
|
|
68810
68819
|
}
|
|
68811
68820
|
await validateObjectiveStatus();
|
|
68821
|
+
targetElement.style.pointerEvents = 'auto';
|
|
68812
68822
|
break;
|
|
68813
68823
|
}
|
|
68814
68824
|
case 'prevBtn': {
|
|
@@ -69206,7 +69216,7 @@ async function onActivityComplete(dragElement, dropElement) {
|
|
|
69206
69216
|
if (dragElement && dropElement) {
|
|
69207
69217
|
const isCorrect = dropElement['value'].toLowerCase().includes(dragElement['value'].toLowerCase());
|
|
69208
69218
|
// storing each activity score based on isCorrect for (all drag-drop events)
|
|
69209
|
-
storingEachActivityScore(isCorrect);
|
|
69219
|
+
// storingEachActivityScore(isCorrect);
|
|
69210
69220
|
if (isCorrect) {
|
|
69211
69221
|
const onCorrect = dropElement.getAttribute('onCorrect');
|
|
69212
69222
|
if (onCorrect) {
|
|
@@ -69231,7 +69241,13 @@ async function onActivityComplete(dragElement, dropElement) {
|
|
|
69231
69241
|
if (storedTabIndexes.includes(JSON.parse(otherElement.getAttribute('tab-index')))) {
|
|
69232
69242
|
if (!(((_a = otherElement.getAttribute('dropAttr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.Diagonal) && !(((_b = container.getAttribute('drop-action')) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === DropMode.InfiniteDrop)) {
|
|
69233
69243
|
if (otherElement) {
|
|
69234
|
-
|
|
69244
|
+
const append = container.getAttribute('appendToDropOnCompletion');
|
|
69245
|
+
if (append === 'true') {
|
|
69246
|
+
otherElement.style.opacity = "1";
|
|
69247
|
+
}
|
|
69248
|
+
else {
|
|
69249
|
+
otherElement.style.opacity = '0';
|
|
69250
|
+
}
|
|
69235
69251
|
}
|
|
69236
69252
|
}
|
|
69237
69253
|
}
|
|
@@ -69255,7 +69271,7 @@ const storeActivityScore = (score) => {
|
|
|
69255
69271
|
activityScore[activityScoreKey] = score;
|
|
69256
69272
|
//send Custom Event to parent
|
|
69257
69273
|
// window.dispatchEvent(new CustomEvent(ActivityEndKey, { detail: { index: index, totalIndex: totalIndex, score: score } }));
|
|
69258
|
-
dispatchActivityEndEvent(index,
|
|
69274
|
+
dispatchActivityEndEvent(totalIndex, index, score, gameScore.rightMoves, gameScore.wrongMoves);
|
|
69259
69275
|
localStorage.setItem(ActivityScoreKey, JSON.stringify(activityScore));
|
|
69260
69276
|
if (totalIndex - 1 == index) {
|
|
69261
69277
|
const scoresArray = Object.values(activityScore);
|
|
@@ -69263,7 +69279,7 @@ const storeActivityScore = (score) => {
|
|
|
69263
69279
|
gameScore.finalScore = Math.floor(finalScore);
|
|
69264
69280
|
console.log('Total Score : ', gameScore.finalScore);
|
|
69265
69281
|
// window.dispatchEvent(new CustomEvent(LessonEndKey, { detail: { score: finalScore } }));
|
|
69266
|
-
dispatchLessonEndEvent(finalScore);
|
|
69282
|
+
dispatchLessonEndEvent(totalIndex, gameScore.rightMoves, gameScore.wrongMoves, finalScore);
|
|
69267
69283
|
localStorage.removeItem(ActivityScoreKey);
|
|
69268
69284
|
}
|
|
69269
69285
|
};
|
|
@@ -69294,10 +69310,9 @@ const handleShowCheck = () => {
|
|
|
69294
69310
|
}
|
|
69295
69311
|
}
|
|
69296
69312
|
else {
|
|
69297
|
-
if (!container.getAttribute("game-completed")) {
|
|
69313
|
+
if (!container.getAttribute("game-completed") && !container.querySelector("[type='slide']")) {
|
|
69298
69314
|
validateObjectiveStatus();
|
|
69299
69315
|
}
|
|
69300
|
-
container.setAttribute("game-completed", "true");
|
|
69301
69316
|
}
|
|
69302
69317
|
};
|
|
69303
69318
|
let res;
|
|
@@ -69341,6 +69356,7 @@ const validateObjectiveStatus = async () => {
|
|
|
69341
69356
|
res = matchStringPattern(objectiveString, objectiveArray);
|
|
69342
69357
|
}
|
|
69343
69358
|
if (res) {
|
|
69359
|
+
container.setAttribute("game-completed", "true");
|
|
69344
69360
|
const attach = container.getAttribute('appendToDropOnCompletion');
|
|
69345
69361
|
const onCorrect = container.getAttribute('onCorrect');
|
|
69346
69362
|
if (onCorrect) {
|
|
@@ -69365,17 +69381,18 @@ const validateObjectiveStatus = async () => {
|
|
|
69365
69381
|
else {
|
|
69366
69382
|
const isContinueOnCorrect = container.getAttribute('is-continue-on-correct') === 'true';
|
|
69367
69383
|
const onCorrect = container.getAttribute('onCorrect');
|
|
69368
|
-
if (
|
|
69384
|
+
if (container.querySelectorAll("[type='click']").length > 0) {
|
|
69369
69385
|
storingEachActivityScore(false);
|
|
69386
|
+
}
|
|
69387
|
+
if (!isContinueOnCorrect) {
|
|
69388
|
+
container.setAttribute("game-completed", "true");
|
|
69370
69389
|
calculateScore();
|
|
69371
69390
|
await executeActions(onCorrect, container);
|
|
69372
69391
|
triggerNextContainer();
|
|
69373
69392
|
}
|
|
69374
69393
|
else {
|
|
69375
69394
|
const onInCorrect = container.getAttribute('onInCorrect');
|
|
69376
|
-
storingEachActivityScore(false);
|
|
69377
69395
|
await executeActions(onInCorrect, container);
|
|
69378
|
-
container.removeAttribute("game-completed");
|
|
69379
69396
|
}
|
|
69380
69397
|
}
|
|
69381
69398
|
};
|
|
@@ -148,7 +148,7 @@ function getContainerXml(args) {
|
|
|
148
148
|
<lido-cell visible="true" margin="20px 0px 0px 0px" bg-color="transparent" layout="landscape.row,portrait.col" height="landscape.50%,portrait.96%" width="landscape.100%,portrait.100%" onEntry="this.gap='10px';">
|
|
149
149
|
|
|
150
150
|
${(args.dropimg1.length === 0 && args.droptext1.length === 0) ? '' : `<lido-cell layout="row" visible="true" bg-color="transparent" height="landscape.100%,portrait.20%" width="landscape.20%,portrait.100%" onEntry="">
|
|
151
|
-
<lido-cell layout="
|
|
151
|
+
<lido-cell layout="row" visible="true" width="100%" height="100%" bg-color="transparent" onEntry="">
|
|
152
152
|
<lido-cell id="image1" show-speak-icon="true" audio="${args.drop1Audio}" value="${args.correct1}" tab-index="1" height="landscape.270px,portrait.240px" width="landscape.200px,portrait.180px" type="drop" layout="col" visible="true" bg-Color="white" onEntry="this.padding='0px'; this.borderRadius='8px';">
|
|
153
153
|
${!args.dropimg1 || args.dropimg1.length === 0 ? '' : `<lido-image border-radius="8px 8px 0px 0px" margin="0px 0px 0px 0px" visible="true" width="landscape.202px,portrait.180px" height="landscape.200px,portrait.180px" bg-color="transparent" src="${args.dropimg1}"></lido-image>`}
|
|
154
154
|
|
|
@@ -159,7 +159,7 @@ function getContainerXml(args) {
|
|
|
159
159
|
</lido-cell>`}
|
|
160
160
|
|
|
161
161
|
${(args.dropimg2.length === 0 && args.droptext2.length === 0) ? '' : `<lido-cell layout="row" visible="true" bg-color="transparent" height="landscape.100%,portrait.20%" width="landscape.20%,portrait.100%" onEntry="this.border-radius='6px';">
|
|
162
|
-
<lido-cell layout="
|
|
162
|
+
<lido-cell layout="row" visible="true" width="100%" height="100%" bg-color="transparent" onEntry="">
|
|
163
163
|
<lido-cell id="image2" show-speak-icon="true" audio="${args.drop2Audio}" value="${args.correct2}" tab-index="2" isAllowOnlyOneDrop="true" disable-edit="true" height="landscape.268px,portrait.240px" width="landscape.200px,portrait.178px" type="drop" layout="col" visible="true" bg-Color="white" onEntry="this.padding='0px';this.borderRadius='8px';">
|
|
164
164
|
${!args.dropimg2 || args.dropimg2.length === 0 ? '' : `<lido-image border-radius="8px 8px 0px 0px" margin="0px 0px 0px 0px" visible="true" width="landscape.202px,portrait.180px" height="landscape.200px,portrait.180px" bg-color="transparent" src="${args.dropimg2}"></lido-image>`}
|
|
165
165
|
|
|
@@ -169,7 +169,7 @@ function getContainerXml(args) {
|
|
|
169
169
|
</lido-cell>`}
|
|
170
170
|
|
|
171
171
|
${(args.dropimg3.length === 0 && args.droptext3.length === 0) ? '' : `<lido-cell layout="row" margin="landscape.50px 0px 0px 0px,portrait.0px 0px 0px 0px" visible="true" bg-color="transparent" height="landscape.100%,portrait.20%" width="landscape.20%,portrait.100%" onEntry="this.border-radius='5px';">
|
|
172
|
-
<lido-cell layout="
|
|
172
|
+
<lido-cell layout="row" visible="true" width="100%" height="100%" bg-color="transparent" onEntry="">
|
|
173
173
|
<lido-cell type="drop" show-speak-icon="true" audio="${args.drop3Audio}" id="image3" tab-index="3" isAllowOnlyOneDrop="true" disable-edit="true" value="${args.correct3}" height="landscape.268px,portrait.240px" width="landscape.200px,portrait.178px" layout="col" visible="true" bg-Color="white" onEntry="this.padding='0px';this.borderRadius='8px';">
|
|
174
174
|
${!args.dropimg3 || args.dropimg3.length === 0 ? '' : `<lido-image border-radius="8px 8px 0px 0px" margin="0px 0px 0px 0px" visible="true" width="landscape.202px,portrait.180px" height="landscape.200px,portrait.180px" bg-color="transparent" src="${args.dropimg3}"></lido-image>`}
|
|
175
175
|
|
|
@@ -180,7 +180,7 @@ function getContainerXml(args) {
|
|
|
180
180
|
|
|
181
181
|
|
|
182
182
|
${(args.dropimg4.length === 0 && args.droptext4.length === 0) ? '' : `<lido-cell layout="row" margin="landscape.0px 0px 0px 0px,portrait.0px 0px 0px 0px" visible="true" bg-color="transparent" height="landscape.100%,portrait.20%" width="landscape.20%,portrait.100%" onEntry="this.border-radius='6px';">
|
|
183
|
-
<lido-cell layout="
|
|
183
|
+
<lido-cell layout="row" visible="true" width="100%" height="100%" bg-color="transparent" onEntry="this.display='flex';">
|
|
184
184
|
<lido-cell id="image4" show-speak-icon="true" audio="${args.drop4Audio}" value="${args.correct4}" isAllowOnlyOneDrop="true" disable-edit="true" tab-index="4" height="landscape.270px,portrait.240px" width="landscape.200px,portrait.178px" type="drop" layout="col" visible="true" bg-Color="white" onEntry="this.padding='0px';this.borderRadius='8px';">
|
|
185
185
|
${!args.dropimg4 || args.dropimg4.length === 0 ? '' : `<lido-image border-radius="8px 8px 0px 0px" margin="0px 0px 0px 0px" visible="true" width="landscape.202px,portrait.180px" height="landscape.200px,portrait.180px" bg-color="transparent" src="${args.dropimg4}"></lido-image>`}
|
|
186
186
|
|
|
@@ -190,7 +190,7 @@ function getContainerXml(args) {
|
|
|
190
190
|
</lido-cell>`}
|
|
191
191
|
|
|
192
192
|
${(args.dropimg5.length === 0 && args.droptext5.length === 0) ? '' : `<lido-cell layout="row" margin="landscape.0px 0px 0px 0px,portrait.0px 0px 0px 0px" visible="true" bg-color="transparent" height="landscape.100%,portrait.20%" width="landscape.20%,portrait.100%" onEntry="this.border-radius='6px';">
|
|
193
|
-
<lido-cell layout="
|
|
193
|
+
<lido-cell layout="row" visible="true" width="100%" height="100%" bg-color="transparent" onEntry="this.display='flex';">
|
|
194
194
|
<lido-cell type="drop" show-speak-icon="true" audio="${args.drop5Audio}" id="image5" value="${args.correct5}" tab-index="5" isAllowOnlyOneDrop="true" disable-edit="true" width="landscape.200px,portrait.178px" height="landscape.268px,portrait.240px" layout="col" visible="true" bg-Color="white" onEntry="this.padding='0px';this.borderRadius='8px';">
|
|
195
195
|
${!args.dropimg5 || args.dropimg5.length === 0 ? '' : `<lido-image border-radius="8px 8px 0px 0px" margin="0px 0px 0px 0px" visible="true" width="landscape.202px,portrait.180px" height="landscape.200px,portrait.180px" bg-color="transparent" src="${args.dropimg5}"></lido-image>`}
|
|
196
196
|
|
|
@@ -34,7 +34,7 @@ function getContainerXml(args) {
|
|
|
34
34
|
const rightValue = escapeXml(args.rightValue);
|
|
35
35
|
return `
|
|
36
36
|
<main>
|
|
37
|
-
<lido-container visible="true" drop-action="move" objective="${objective}" equationCheck="$#lefthandle1,$#righthandle1" id="lido-container" onCorrect="lido-avatar.avatarAnimate='Success';this.sleep='2000';" show-Check="true" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/background-images/Balancing.png" is-continue-on-correct="true">
|
|
37
|
+
<lido-container visible="true" drop-action="move" objective="${objective}" equationCheck="$#lefthandle1,$#righthandle1" id="lido-container" onCorrect="lido-avatar.avatarAnimate='Success';this.sleep='2000';" show-Check="true" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/background-images/Balancing.png" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='2000';" is-continue-on-correct="true">
|
|
38
38
|
<!-- Chimple Avatar -->
|
|
39
39
|
<lido-cell layout="pos" id="pos1" disable-edit="true" value="pos2" height="landscape.396px,portrait.400px" width="landscape.298px,portrait.369px" x="landscape.82%, portrait.32%" y="landscape.63%, portrait.78%" aria-hidden="true" z="1" bg-color="transparent" visible="true" onEntry="">
|
|
40
40
|
<lido-avatar id="lido-avatar" disable-edit="true" visible="true" height="100%" width="100%" src="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/temp2/chimplecharacter.riv" alt-text="{chimpleCharacterRive}">
|
|
@@ -46,7 +46,7 @@ function getContainerXml(args) {
|
|
|
46
46
|
</lido-text>
|
|
47
47
|
</lido-pos>
|
|
48
48
|
<!-- question -->
|
|
49
|
-
<lido-text visible="true" tab-index="12" height="landscape.100px,portrait.175px" font-family="'Baloo Bhai 2'" font-size="60px" width="landscape.auto,portrait.86%" string="Drop the elements to match the given symbol '${objective}'" font-color="black" bg-color="white" y="landscape.0%,portrait.-12%" onEntry="this.font-weight='600'; this.position='relative';">
|
|
49
|
+
<lido-text visible="true" audio="" id="heading" tab-index="12" height="landscape.100px,portrait.175px" font-family="'Baloo Bhai 2'" font-size="60px" width="landscape.auto,portrait.86%" string="Drop the elements to match the given symbol '${objective}'" font-color="black" bg-color="white" y="landscape.0%,portrait.-12%" onEntry="this.speak='true';this.font-weight='600'; this.position='relative';">
|
|
50
50
|
</lido-text>
|
|
51
51
|
<lido-balance tilt="0" operation="add" visible="true" height="landscape.456px,portrait.500px" y="landscape.4%,portrait.0%" width="landscape.1136px,portrait.876px">
|
|
52
52
|
<!-- drop Element -->
|
|
@@ -136,22 +136,22 @@ function getContainerXml(args) {
|
|
|
136
136
|
<lido-cell layout="landscape.flex,portrait.wrap" delay-visible="2650" visible="true" width="landscape.86%, portrait.88%" y="landscape.65%, portrait.62%" x="landscape.4%,portrait.0px" z="2" onEntry="this.gridTemplateColumns = 'repeat(4, 1fr)'; this.gridTemplateRows = 'repeat(2, 1fr)';this.position='relative';this.gap='40px';">
|
|
137
137
|
|
|
138
138
|
|
|
139
|
-
<lido-text id="option1"
|
|
139
|
+
<lido-text id="option1" audio="${args.option1Audio}" value="${args.option1}" tab-index="10" visible="true" bg-color="#FCF3B1" onEntry="this.padding='0px 40px';this.borderRadius='25px'; this.boxShadow='unset'; this.fontWeight='800'; " width="auto" height="84px" string="${args.option1}" font-family="'Baloo 2', serif" font-size="24px" z="2" type="drag">
|
|
140
140
|
</lido-text>
|
|
141
|
-
<lido-text id="option2"
|
|
141
|
+
<lido-text id="option2" audio="${args.option2Audio}" value="${args.option2}" tab-index="11" visible="true" bg-color="#FCF3B1" onEntry="this.padding='0px 40px';this.borderRadius='25px'; this.boxShadow='unset'; this.fontWeight='800'; " width="auto" height="84px" string="${args.option2}" font-family="'Baloo 2', serif" font-size="24px" z="2" type="drag">
|
|
142
142
|
|
|
143
143
|
</lido-text>
|
|
144
|
-
<lido-text id="option3"
|
|
144
|
+
<lido-text id="option3" audio="${args.option3Audio}" value="${args.option3}" tab-index="12" visible="true" bg-color="#FCF3B1" onEntry="this.padding='0px 40px';this.borderRadius='25px'; this.boxShadow='unset'; this.fontWeight='800'; " width="auto" height="84px" string="${args.option3}" font-family="'Baloo 2', serif" font-size="24px" z="2" type="drag">
|
|
145
145
|
</lido-text>
|
|
146
|
-
<lido-text id="option4"
|
|
146
|
+
<lido-text id="option4" audio="${args.option4Audio}" value="${args.option4}" tab-index="13" visible="true" bg-color="#FCF3B1" onEntry="this.padding='0px 40px';this.borderRadius='25px'; this.boxShadow='unset'; this.fontWeight='800'; " width="auto" height="84px" string="${args.option4}" font-family="'Baloo 2', serif" font-size="24px" z="2" type="drag">
|
|
147
147
|
</lido-text>
|
|
148
|
-
<lido-text id="option5"
|
|
148
|
+
<lido-text id="option5" audio="${args.option5Audio}" value="${args.option5}" tab-index="14" visible="true" bg-color="#FCF3B1" onEntry="this.padding='0px 40px';this.borderRadius='25px'; this.boxShadow='unset'; this.fontWeight='800'; " width="auto" height="84px" string="${args.option5}" font-family="'Baloo 2', serif" font-size="24px" z="2" type="drag">
|
|
149
149
|
</lido-text>
|
|
150
|
-
<lido-text id="option6"
|
|
150
|
+
<lido-text id="option6" audio="${args.option6Audio}" value="${args.option6}" tab-index="15" visible="true" bg-color="#FCF3B1" onEntry="this.padding='0px 40px';this.borderRadius='25px'; this.boxShadow='unset'; this.fontWeight='800';" width="auto" height="84px" string="${args.option6}" font-family="'Baloo 2', serif" font-size="24px" z="2" type="drag">
|
|
151
151
|
</lido-text>
|
|
152
|
-
<lido-text id="option7"
|
|
152
|
+
<lido-text id="option7" audio="${args.option7Audio}" value="${args.option7}" tab-index="16" visible="true" bg-color="#FCF3B1" onEntry="this.padding='0px 40px';this.borderRadius='25px'; this.boxShadow='unset'; this.fontWeight='800'; " width="auto" height="84px" string="${args.option7}" font-family="'Baloo 2', serif" font-size="24px" z="2" type="drag">
|
|
153
153
|
</lido-text>
|
|
154
|
-
<lido-text id="option8"
|
|
154
|
+
<lido-text id="option8" audio="${args.option8Audio}" value="${args.option8}" tab-index="17" visible="true" bg-color="#FCF3B1" onEntry="this.padding='0px 40px';this.borderRadius='25px'; this.boxShadow='unset'; this.fontWeight='800'; " width="auto" height="84px" string="${args.option8}" font-family="'Baloo 2', serif" font-size="24px" z="2" type="drag">
|
|
155
155
|
|
|
156
156
|
</lido-text>
|
|
157
157
|
</lido-cell>
|
|
@@ -44,7 +44,7 @@ custom-style = "#audioCell:active {
|
|
|
44
44
|
}" >
|
|
45
45
|
<!-- Chimple Avatar -->
|
|
46
46
|
<lido-cell layout="pos" id="pos1" disable-edit="true" value="pos2" height="landscape.330px,portrait.378px" width="landscape.300px,portrait.382px"
|
|
47
|
-
x="landscape.
|
|
47
|
+
x="landscape.79%, portrait.30%" y="landscape.61%, portrait.78%" aria-hidden="true" z="1" bg-color="transparent" visible="true" onEntry="">
|
|
48
48
|
<lido-avatar id="lido-avatar" disable-edit="true" visible="true" height="100%" width="100%" src="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/temp2/chimplecharacter.riv" alt-text="{chimpleCharacterRive}">
|
|
49
49
|
</lido-avatar>
|
|
50
50
|
<lido-image id="image" disableEdit="true" value="image" visible="true" src="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/temp2/Shadow.png" bgColor="transparent" width="inherit" height="20px" x="landscape.-1px, portrait.-7px" y="landscape.280px, portrait.535px" altText="{shadowImage}"></lido-image>
|
|
@@ -48,8 +48,8 @@ export var DropAction;
|
|
|
48
48
|
DropAction["Move"] = "move";
|
|
49
49
|
DropAction["Hide"] = "hide";
|
|
50
50
|
})(DropAction || (DropAction = {}));
|
|
51
|
-
export const exitUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Close.
|
|
52
|
-
export const prevUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Previous.
|
|
53
|
-
export const nextUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Next.
|
|
54
|
-
export const speakUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/
|
|
55
|
-
export const fingerUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/trace/Tracing-hand.
|
|
51
|
+
export const exitUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Close.png';
|
|
52
|
+
export const prevUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Previous.png';
|
|
53
|
+
export const nextUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/Next.png';
|
|
54
|
+
export const speakUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/Navbar-buttons/NavAudio.png';
|
|
55
|
+
export const fingerUrl = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/trace/Tracing-hand.png';
|
|
@@ -5,11 +5,11 @@ function dispatchCustomEvent(eventName, detail) {
|
|
|
5
5
|
const event = new CustomEvent(eventName, { detail });
|
|
6
6
|
window.dispatchEvent(event);
|
|
7
7
|
}
|
|
8
|
-
export function dispatchActivityEndEvent(
|
|
9
|
-
dispatchCustomEvent(ActivityEndKey, {
|
|
8
|
+
export function dispatchActivityEndEvent(totalIndex, currentIndex, score, rightMoves, wrongMoves) {
|
|
9
|
+
dispatchCustomEvent(ActivityEndKey, { currentIndex, totalIndex, score, rightMoves, wrongMoves });
|
|
10
10
|
}
|
|
11
|
-
export function dispatchLessonEndEvent(
|
|
12
|
-
dispatchCustomEvent(LessonEndKey, {
|
|
11
|
+
export function dispatchLessonEndEvent(totalIndex, rightMoves, wrongMoves, finalScore) {
|
|
12
|
+
dispatchCustomEvent(LessonEndKey, { totalIndex, rightMoves, wrongMoves, finalScore, timeSpent: Math.floor(Timer.getI().getElapsed() / 1000) });
|
|
13
13
|
}
|
|
14
14
|
export function dispatchNextContainerEvent() {
|
|
15
15
|
dispatchCustomEvent(NextContainerKey, {});
|
|
@@ -192,6 +192,7 @@ export const executeActions = async (actionsString, thisElement, element) => {
|
|
|
192
192
|
AudioPlayer.getI().stop();
|
|
193
193
|
}
|
|
194
194
|
await validateObjectiveStatus();
|
|
195
|
+
targetElement.style.pointerEvents = 'auto';
|
|
195
196
|
break;
|
|
196
197
|
}
|
|
197
198
|
case 'prevBtn': {
|
|
@@ -589,7 +590,7 @@ export async function onActivityComplete(dragElement, dropElement) {
|
|
|
589
590
|
if (dragElement && dropElement) {
|
|
590
591
|
const isCorrect = dropElement['value'].toLowerCase().includes(dragElement['value'].toLowerCase());
|
|
591
592
|
// storing each activity score based on isCorrect for (all drag-drop events)
|
|
592
|
-
storingEachActivityScore(isCorrect);
|
|
593
|
+
// storingEachActivityScore(isCorrect);
|
|
593
594
|
if (isCorrect) {
|
|
594
595
|
const onCorrect = dropElement.getAttribute('onCorrect');
|
|
595
596
|
if (onCorrect) {
|
|
@@ -614,7 +615,13 @@ export async function onActivityComplete(dragElement, dropElement) {
|
|
|
614
615
|
if (storedTabIndexes.includes(JSON.parse(otherElement.getAttribute('tab-index')))) {
|
|
615
616
|
if (!(((_a = otherElement.getAttribute('dropAttr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.Diagonal) && !(((_b = container.getAttribute('drop-action')) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === DropMode.InfiniteDrop)) {
|
|
616
617
|
if (otherElement) {
|
|
617
|
-
|
|
618
|
+
const append = container.getAttribute('appendToDropOnCompletion');
|
|
619
|
+
if (append === 'true') {
|
|
620
|
+
otherElement.style.opacity = "1";
|
|
621
|
+
}
|
|
622
|
+
else {
|
|
623
|
+
otherElement.style.opacity = '0';
|
|
624
|
+
}
|
|
618
625
|
}
|
|
619
626
|
}
|
|
620
627
|
}
|
|
@@ -638,7 +645,7 @@ const storeActivityScore = (score) => {
|
|
|
638
645
|
activityScore[activityScoreKey] = score;
|
|
639
646
|
//send Custom Event to parent
|
|
640
647
|
// window.dispatchEvent(new CustomEvent(ActivityEndKey, { detail: { index: index, totalIndex: totalIndex, score: score } }));
|
|
641
|
-
dispatchActivityEndEvent(index,
|
|
648
|
+
dispatchActivityEndEvent(totalIndex, index, score, gameScore.rightMoves, gameScore.wrongMoves);
|
|
642
649
|
localStorage.setItem(ActivityScoreKey, JSON.stringify(activityScore));
|
|
643
650
|
if (totalIndex - 1 == index) {
|
|
644
651
|
const scoresArray = Object.values(activityScore);
|
|
@@ -646,7 +653,7 @@ const storeActivityScore = (score) => {
|
|
|
646
653
|
gameScore.finalScore = Math.floor(finalScore);
|
|
647
654
|
console.log('Total Score : ', gameScore.finalScore);
|
|
648
655
|
// window.dispatchEvent(new CustomEvent(LessonEndKey, { detail: { score: finalScore } }));
|
|
649
|
-
dispatchLessonEndEvent(finalScore);
|
|
656
|
+
dispatchLessonEndEvent(totalIndex, gameScore.rightMoves, gameScore.wrongMoves, finalScore);
|
|
650
657
|
localStorage.removeItem(ActivityScoreKey);
|
|
651
658
|
}
|
|
652
659
|
};
|
|
@@ -677,10 +684,9 @@ export const handleShowCheck = () => {
|
|
|
677
684
|
}
|
|
678
685
|
}
|
|
679
686
|
else {
|
|
680
|
-
if (!container.getAttribute("game-completed")) {
|
|
687
|
+
if (!container.getAttribute("game-completed") && !container.querySelector("[type='slide']")) {
|
|
681
688
|
validateObjectiveStatus();
|
|
682
689
|
}
|
|
683
|
-
container.setAttribute("game-completed", "true");
|
|
684
690
|
}
|
|
685
691
|
};
|
|
686
692
|
const body = document.body;
|
|
@@ -725,6 +731,7 @@ export const validateObjectiveStatus = async () => {
|
|
|
725
731
|
res = matchStringPattern(objectiveString, objectiveArray);
|
|
726
732
|
}
|
|
727
733
|
if (res) {
|
|
734
|
+
container.setAttribute("game-completed", "true");
|
|
728
735
|
const attach = container.getAttribute('appendToDropOnCompletion');
|
|
729
736
|
const onCorrect = container.getAttribute('onCorrect');
|
|
730
737
|
if (onCorrect) {
|
|
@@ -749,17 +756,18 @@ export const validateObjectiveStatus = async () => {
|
|
|
749
756
|
else {
|
|
750
757
|
const isContinueOnCorrect = container.getAttribute('is-continue-on-correct') === 'true';
|
|
751
758
|
const onCorrect = container.getAttribute('onCorrect');
|
|
752
|
-
if (
|
|
759
|
+
if (container.querySelectorAll("[type='click']").length > 0) {
|
|
753
760
|
storingEachActivityScore(false);
|
|
761
|
+
}
|
|
762
|
+
if (!isContinueOnCorrect) {
|
|
763
|
+
container.setAttribute("game-completed", "true");
|
|
754
764
|
calculateScore();
|
|
755
765
|
await executeActions(onCorrect, container);
|
|
756
766
|
triggerNextContainer();
|
|
757
767
|
}
|
|
758
768
|
else {
|
|
759
769
|
const onInCorrect = container.getAttribute('onInCorrect');
|
|
760
|
-
storingEachActivityScore(false);
|
|
761
770
|
await executeActions(onInCorrect, container);
|
|
762
|
-
container.removeAttribute("game-completed");
|
|
763
771
|
}
|
|
764
772
|
}
|
|
765
773
|
};
|
|
@@ -530,7 +530,7 @@ export async function onElementDropComplete(dragElement, dropElement) {
|
|
|
530
530
|
await executeActions(onInCorrect, dropElement, dragElement);
|
|
531
531
|
setTimeout(() => {
|
|
532
532
|
dragElement.style.transform = 'translate(0, 0)';
|
|
533
|
-
storingEachActivityScore(false);
|
|
533
|
+
// storingEachActivityScore(false);
|
|
534
534
|
// const oldDropIndex = dragToDropMap[dragElement.getAttribute('data-id')];
|
|
535
535
|
// if (oldDropIndex !== undefined && dropHasDrag[oldDropIndex]) {
|
|
536
536
|
// dropHasDrag[oldDropIndex].isFull = false;
|
|
@@ -693,7 +693,7 @@ export async function onElementDropComplete(dragElement, dropElement) {
|
|
|
693
693
|
// Add pulse and highlight effect for a successful match
|
|
694
694
|
const isCorrect = dropElement['value'].toLowerCase().includes(dragElement['value'].toLowerCase());
|
|
695
695
|
dispatchElementDropEvent(dragElement, dropElement, isCorrect);
|
|
696
|
-
|
|
696
|
+
storingEachActivityScore(isCorrect);
|
|
697
697
|
dragElement.style.opacity = '1';
|
|
698
698
|
const allDropElements = document.querySelectorAll('.drop-element');
|
|
699
699
|
allDropElements.forEach(el => updateDropBorder(el));
|
|
@@ -14,7 +14,7 @@ export function updateBalanceOnDrop(dragElement, dropElement) {
|
|
|
14
14
|
}
|
|
15
15
|
function calculateValue(elements, operation) {
|
|
16
16
|
if (elements.length === 0)
|
|
17
|
-
return
|
|
17
|
+
return null;
|
|
18
18
|
if (operation === "count") {
|
|
19
19
|
return elements.length;
|
|
20
20
|
}
|
|
@@ -46,18 +46,17 @@ function calculateValue(elements, operation) {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
export function balanceResult(container, objectiveString) {
|
|
49
|
-
var _a, _b, _c, _d, _e, _f;
|
|
50
49
|
const additionalCheck = container.getAttribute('equationCheck');
|
|
51
50
|
if (!additionalCheck)
|
|
52
51
|
return false;
|
|
53
52
|
const balanceEl = document.querySelector('lido-balance');
|
|
54
53
|
if (!balanceEl)
|
|
55
54
|
return false;
|
|
56
|
-
const leftVal =
|
|
57
|
-
const rightVal =
|
|
55
|
+
const leftVal = balanceEl.leftVal;
|
|
56
|
+
const rightVal = balanceEl.rightVal;
|
|
58
57
|
const hasLeft = !isNaN(leftVal);
|
|
59
58
|
const hasRight = !isNaN(rightVal);
|
|
60
|
-
if (
|
|
59
|
+
if (leftVal == null || rightVal == null) {
|
|
61
60
|
return false;
|
|
62
61
|
}
|
|
63
62
|
const symbol = leftVal > rightVal ? '>' : leftVal < rightVal ? '<' : '=';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LidoContainer, SelectedValuesKey } from "../constants";
|
|
2
2
|
import { findMostoverlappedElement, getElementScale } from "./dragDropHandler";
|
|
3
|
-
import { calculateScale,
|
|
3
|
+
import { calculateScale, executeActions, matchStringPattern, storingEachActivityScore } from "../utils";
|
|
4
4
|
import { removeHighlight } from "./highlightHandler";
|
|
5
5
|
let numberOfSlides = 0;
|
|
6
6
|
const slideNumbers = (element) => {
|
|
@@ -253,9 +253,21 @@ const slideCompleted = (slideElement) => {
|
|
|
253
253
|
const isCorrect = matchStringPattern(slideElement['value'], [objectiveArray[elementIndex].trim()]);
|
|
254
254
|
if (container.getAttribute('is-continue-on-correct') === 'true') {
|
|
255
255
|
storingEachActivityScore(true);
|
|
256
|
-
|
|
256
|
+
validationForSlideHandler();
|
|
257
257
|
}
|
|
258
258
|
else {
|
|
259
259
|
storingEachActivityScore(isCorrect);
|
|
260
260
|
}
|
|
261
261
|
};
|
|
262
|
+
const validationForSlideHandler = async () => {
|
|
263
|
+
var _a, _b;
|
|
264
|
+
const container = document.getElementById(LidoContainer);
|
|
265
|
+
if (!container)
|
|
266
|
+
return;
|
|
267
|
+
const objectiveArray = (_b = JSON.parse((_a = container.getAttribute(SelectedValuesKey)) !== null && _a !== void 0 ? _a : '[]')) !== null && _b !== void 0 ? _b : [];
|
|
268
|
+
const objectiveString = document.getElementById(LidoContainer)['objective'];
|
|
269
|
+
const res = matchStringPattern(objectiveString, objectiveArray);
|
|
270
|
+
if (res) {
|
|
271
|
+
await executeActions(container.getAttribute('onCorrect'), container);
|
|
272
|
+
}
|
|
273
|
+
};
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { f as format, g as getAssetPath, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-
|
|
1
|
+
export { f as format, g as getAssetPath, s as setAssetPath, a as setNonce, b as setPlatformOptions } from './p-ff8ce1fd.js';
|