I have noticed that because of the delay caused by the animation playing while submitting an answer you can submit multiple times before the game state changes.
The animDuration is set to 300 and there are 2 setTimeout calls that use animDuration before actually changing the state of the game, which means you have effectively 600ms to submit anything, e.g if you press enter multiple times you will be able to submit "skips" even though you might have found the answer already but the game has not yet had the time to change its state.
This PR solves this problem simply by disabling the user input as the submit begins and re-enables it at the end. Another solution would be to change the state of the game instantly instead of at the end of the animations. Let me know what you think.
I have noticed that because of the delay caused by the animation playing while submitting an answer you can submit multiple times before the game state changes.
The animDuration is set to 300 and there are 2 setTimeout calls that use animDuration before actually changing the state of the game, which means you have effectively 600ms to submit anything, e.g if you press enter multiple times you will be able to submit "skips" even though you might have found the answer already but the game has not yet had the time to change its state.
This PR solves this problem simply by disabling the user input as the submit begins and re-enables it at the end. Another solution would be to change the state of the game instantly instead of at the end of the animations. Let me know what you think.