Open JamshidTashpulatov opened 5 years ago
Hi @JamshidTashpulatov
That's something I'm working on right now. Did you manage to get that sorted out?
Cheers Brad
Hi @JamshidTashpulatov
See my post re "show stored puzzle attempts" - that may give you a clue. :)
Hello Brad,
How to save the answer entered by user into attempts key?
best regards, Vidyesh
Hello Brad,
How to save the answer entered by user into attempts key?
best regards, Vidyesh
Hi Vidyesh
Unless I've misunderstood your question...
Since the attempt key is simply part of the JSON data for each crossword entry (if you've followed what I posted at https://github.com/jweisbeck/Crossword/issues/23) then you can use whatever storage mechanism you like - Mongo, Localstorage, anything really. Up to you when you save it, depending on your solution, localStorage would probably be fastest as they enter each letter. And to then continue a puzzle, get the puzzle data from whatever your storage is and invoke my showAttempts function in puzzInit.
Cheers Brad
Hello Brad,
Thanks for a warm reply. I did the same as you suggested (using localStorage, simple and quick approach). It is now able to retrieve the correct answers of earlier visited puzzles.
I'll share my crossword link once I deploy on heroku. I liked your showAttempt solution.
best regards,Vidyesh Ranade+91 9850 88 91 88
On Fri, May 27, 2022 at 11:43 AM bradzo @.***> wrote:
Hello Brad,
How to save the answer entered by user into attempts key?
best regards, Vidyesh
Hi Vidyesh
Unless I've misunderstood your question...
Since the attempt key is simply part of the JSON data for each crossword entry (if you've followed what I posted at #23 https://github.com/jweisbeck/Crossword/issues/23) then you can use whatever storage mechanism you like - Mongo, Localstorage, anything really. Up to you when you save it, depending on your solution, localStorage would probably be fastest as they enter each letter. And to then continue a puzzle, get the puzzle data from whatever your storage is and invoke my showAttempts function in puzzInit.
Cheers Brad
— Reply to this email directly, view it on GitHub https://github.com/jweisbeck/Crossword/issues/17#issuecomment-1139315963, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABXPESPTJJBICQJGRJ3IUCDVMBRZ7ANCNFSM4G3XLNUA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
How can I save the data entered in this game while playing the game
LocalStorage
? To prevent the data entered from being updated while the page is up.