@gamelearn/arcade-components 1.4.3 → 1.4.4
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.
|
@@ -291,7 +291,8 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
|
|
|
291
291
|
var _list$currentSlide, _list$currentSlide$sp, _list$currentSlide2, _list$currentSlide2$s;
|
|
292
292
|
|
|
293
293
|
e.stopPropagation();
|
|
294
|
-
var
|
|
294
|
+
var currentTextDom = document.querySelectorAll("[data-text-id=\"".concat(id, "\"]"));
|
|
295
|
+
var allDataTextIds = document.querySelectorAll("[data-text-id]");
|
|
295
296
|
var feedbackCorrect = list[currentSlide].correctTexts.find(function (element) {
|
|
296
297
|
return element.id === id;
|
|
297
298
|
});
|
|
@@ -311,17 +312,24 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
|
|
|
311
312
|
if (list[currentSlide].correctTexts[orderCounter].id === id) {
|
|
312
313
|
setOrderCounter(orderCounter + 1); // hacer verde 🎉
|
|
313
314
|
|
|
314
|
-
handleCorrectClick(
|
|
315
|
+
handleCorrectClick(currentTextDom, specificCorrectFeedback);
|
|
315
316
|
} else if (list[currentSlide].correctTexts.find(function (c) {
|
|
316
317
|
return c.id === id;
|
|
317
318
|
}) && list[currentSlide].correctTexts[orderCounter].id !== id) {
|
|
318
319
|
// si has dado buena fuera de orden
|
|
320
|
+
allDataTextIds.forEach(function (e) {
|
|
321
|
+
return e.classList.remove('text-click__success');
|
|
322
|
+
});
|
|
323
|
+
setOrderCounter(0);
|
|
324
|
+
setCorrectTextFragmentsAccumulated(0);
|
|
325
|
+
correctTextFragmentsPartial.current = 0;
|
|
319
326
|
emitEvent({
|
|
320
327
|
type: 'hidePuzzleButtons',
|
|
321
328
|
payload: true
|
|
322
329
|
});
|
|
323
330
|
setFeedbackData(function (prevState) {
|
|
324
331
|
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
332
|
+
show: true,
|
|
325
333
|
result: false,
|
|
326
334
|
text: list[currentSlide].info.orderFeedback.desc || translate('puzzles.incorrectOrder'),
|
|
327
335
|
timeout: false
|
|
@@ -329,15 +337,15 @@ var TextClickPuzzleComponent = function TextClickPuzzleComponent(_ref) {
|
|
|
329
337
|
});
|
|
330
338
|
} else {
|
|
331
339
|
// si has click en mala repuesta
|
|
332
|
-
handleIncorrectClick(
|
|
340
|
+
handleIncorrectClick(currentTextDom, specificWrongFeedback);
|
|
333
341
|
}
|
|
334
342
|
} else if ((feedbackCorrect === null || feedbackCorrect === void 0 ? void 0 : feedbackCorrect.id) === id) {
|
|
335
343
|
// si no va en orden
|
|
336
344
|
// si la opción clickada es correcta
|
|
337
|
-
handleCorrectClick(
|
|
345
|
+
handleCorrectClick(currentTextDom, specificCorrectFeedback);
|
|
338
346
|
} else if ((feedbackIncorrect === null || feedbackIncorrect === void 0 ? void 0 : feedbackIncorrect.id) === id || id === 'allWrong') {
|
|
339
347
|
// si la opción clickada es incorrecta
|
|
340
|
-
handleIncorrectClick(
|
|
348
|
+
handleIncorrectClick(currentTextDom, specificWrongFeedback);
|
|
341
349
|
}
|
|
342
350
|
}, [list, currentSlide, orderCounter, handleCorrectClick, emitEvent, translate, handleIncorrectClick, playSound]);
|
|
343
351
|
var recursiveStuff = (0, _react.useCallback)(function (jsx) {
|