Skip to content

Commit

Permalink
Fixed some problems with the question management
Browse files Browse the repository at this point in the history
  • Loading branch information
alegarman2002 committed Apr 28, 2024
1 parent be4601c commit 149ff6a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions webapp/src/components/FirstGame.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ const Quiz = () => {
// const [currentQuestionIndex, setCurrentQuestionIndex] = useState(storedInt);
// const [isCorrect, setIsCorrect] = useState(false);
const [remTime, setRemTime] = useState(0);
const [totalTime, setTotalTime] = useState(0);

useEffect(() => {
const time = setInterval(() => {
setRemTime((progress) => {
if(progress === 100){
// checkAnswer(-1);
checkAnswer(-1);
return 0;
}
const diff = 4;
Expand Down Expand Up @@ -102,10 +103,15 @@ const Quiz = () => {
currentQuestionIndex = (currentQuestionIndex + 1);
botonCorrecta.style.backgroundColor = previousBackgroundColor
changeButtons("false")
await gameStore()

haveFailedQuestion = false;
load = true
navigator('/menu')
haveEnter = false

if (currentQuestionIndex === allQuestions.length ) {
await gameStore()
navigator('/menu')
}
return
}

Expand Down

0 comments on commit 149ff6a

Please sign in to comment.