Puzzles are only collected when a student successfully completes a level. When a student runs out of JiJis, they are taken back to the beginning of the level without collecting puzzles.
Students always earn puzzles for playing orange levels, but they won't earn puzzles if they play a level with a green checkmark on it. This means a student playing games in their History or earlier on the learner bridge won't collect any puzzles. If a student has not finished their grade level but is replaying games, you may want to remind the student to click on the Journey Map or the Assignments House and be sure to click on orange levels to move forward in ST Math.
See also: Knowing when a student has completed their Journey