For an individual problem, the database stores a score at the moment the exercise is submitted. So if you change that exercise's code later, that (alone) will not affect the score that a student already has in the database.
There are ways to resubmit a student's answer(s), so it can be regraded and the score in the database could be updated. However it would be a lot of manual work and would have to be done one student at a time.