Only freeze the grade once the student finished the exercise

This is the fix for the bug I spotted before. @dragonfi for review, @antoviaque for merging.

Only freeze the grade once the student finished the exercise, not after the first drop.