Hello,
You can add an index for all the puzzles. When I finish a puzzle, you save it to the database, and that way you know which puzzles I’ve solved and can identify the highest index among them.
Assume that you have a “SOLVE” button for every puzzle. If current cell puzzle’s index < Current User’s puzzles max index then the title is “LOCKED” and the button should be not clickable.
Please let me know if you need more help.