I need some help with making sure my participants are entering the right type of answers on a custom item.

I created a custom item in which I have 4 "fill in the blank" type html boxes on a page. The 4 responses are supposed to add up to 100. What I need to do is to make sure participants actually enter responses that add up to 100 (so it could be 25,25,25,25 or 50,50,0,0, or whatever.) I created a responses.xls file that takes the values and sums them. I was able to figure out how to code the file to either continue to the next page if it adds up to 100, or how to say "no, try again" if it doesn't add up to 100. However, the problem I'm having is that if the user tries to reset their answers and re-submit, the previous "incorrect" response is still being called upon, the "no, try again" message reappears, and i'm guessing that the new answers are not saved into the responses.xls file.

Is there any possible way that I can work around this?