Open HenriScaff opened 4 months ago
Another consideration: if the user lets the time run out AND does not make a guess, then we have no record of them guessing that sketch and they could do it again.
Seems like we might just need to add a db entry as soon as user clicks begin, so we know the user has SEEN a sketch, even if they haven't made a guess. Might need a slight model change.
yeah. it should not be handled by sessions. here's how i think it should be done
GET /guess/<sketch-id>
/
/guess/<sketch-id>/begin
POST /guess/<sketch-id>/begin
POST /guess/<sketch-id>/attempt
@ickerio these suggestions are great and would be a good future step of this project. PR #47 adds some temporary changes to the current session functionality which alleviates most problems above.
Currently in /guess, the begin button starts the timer for the user's guess session for that specific sketch.
However, if the user refreshes the page, they could simply start again, seemingly getting infinite time to guess the sketch.
If the user leaves the page without making a guess, they could then come back to the page and again have the timer reset, again giving infinite time technically.
If the user DOES make a guess, but THEN leaves the page and tries to go back to the page through /index, /index will NOT allow it because it registers that you have guessed that sketch before (hence won't show the guess button). This is a slightly more unique circumstance and perhaps one we do not need to deal with, but to consider.