From 8f3de263f1af0eaade36ca07a9f3654623e166fb Mon Sep 17 00:00:00 2001 From: coral2742 Date: Mon, 8 Apr 2024 00:33:15 +0200 Subject: [PATCH 1/2] sparkles: Cambios en botones si se acaba el tiempo --- webapp/src/components/Game.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webapp/src/components/Game.js b/webapp/src/components/Game.js index d48854c7..c167efee 100644 --- a/webapp/src/components/Game.js +++ b/webapp/src/components/Game.js @@ -56,6 +56,11 @@ const Game = () => { } else { // Se acabó el tiempo setTimedOut(true); + const buttons = document.querySelectorAll('button[title="btnsPreg"]'); + buttons.forEach(button => { + button.disabled = true; + button.onmouse = null; + }); } }); } From 5d8ad9e10938c374ea8028041557fa90e49f9884 Mon Sep 17 00:00:00 2001 From: coral2742 Date: Mon, 8 Apr 2024 00:53:43 +0200 Subject: [PATCH 2/2] :sparkles: Solucionado problema con temporizador --- webapp/src/components/Game.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/webapp/src/components/Game.js b/webapp/src/components/Game.js index 45eabf06..804cd95d 100644 --- a/webapp/src/components/Game.js +++ b/webapp/src/components/Game.js @@ -156,7 +156,8 @@ const Game = () => { const handleAnswerClick = (option, index) => { // Almacenar la opción seleccionada por el usuario en gameUserOptions setGameUserOptions(prevUserOptions => [...prevUserOptions, option]); - + // parar el temporizador + stopTimer(); if(option === correctOption) { const buttonId = `button_${index}`; const correctButton = document.getElementById(buttonId); @@ -169,9 +170,6 @@ const Game = () => { const incorrectButton = document.getElementById(buttonId); incorrectButton.style.backgroundColor = "rgba(208, 22, 22, 0.952)"; - // parar el temporizador - stopTimer(); - // mostrar la correcta for (let correctIndex = 0; correctIndex < 4; correctIndex++){ const buttonIdCorrect = `button_${correctIndex}`; @@ -337,9 +335,17 @@ const getQuestions = () => {