Skip to content

Commit

Permalink
change menu test and progress bar at 0% with correct answer
Browse files Browse the repository at this point in the history
  • Loading branch information
uo288574 committed Apr 10, 2024
1 parent 5808c81 commit ae2ddd3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
7 changes: 1 addition & 6 deletions webapp/src/components/FirstGame.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,8 @@ const Quiz = () => {
setRemTime((progress) => {
if(progress == 100){
newQuestion();
//getQuestions()
//repetir checkAndswer
return 0;
}
// const diff = Math.random() * 10;
// return Math.min(progress + diff, 100);

const diff = crypto.getRandomValues(new Uint32Array(1))[0] % 11; // Generate a random number between 0 and 10
return Math.min(progress + diff, 100);
});
Expand Down Expand Up @@ -209,6 +204,7 @@ const Quiz = () => {
currentQuestionIndex = (currentQuestionIndex + 1);
}
isCorrect = (false)
setRemTime(0)


changeButtons("false")
Expand All @@ -219,7 +215,6 @@ const Quiz = () => {
haveFailedQuestion = false;
navigator('/menu')
}

};

return (
Expand Down
5 changes: 2 additions & 3 deletions webapp/src/components/Menu.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ContextFun } from './Context';
import axios from 'axios';
import MockAdapter from 'axios-mock-adapter';
import { BrowserRouter as Router } from 'react-router-dom';
import { Menu } from './Menu';
import Menu from './Menu';

const mockAxios = new MockAdapter(axios);

Expand All @@ -14,9 +14,8 @@ describe("Menu component", () => {
});

test("renders menu",async () => {

render(
<Menu/>
<Menu />
);

const linkElement = screen.getByText(/Cómo jugar/i);
Expand Down

0 comments on commit ae2ddd3

Please sign in to comment.