To me it looks like this. Teacher spent x weeks teaching a certain way to solve the problem. Teacher set the test to see how well they had learned the method. Every other child did it the way the teacher taught but your child did it a way the teacher couldn't follow. Since the purpose of the test was to check whether the students had mastered the method taught NOT whether they could solve the problems the teacher marked the question wrong. While it is very annoying and probably should have been explicitly stated a large part of completing tests and assessments is interpreting what the writer actually wants as opposed to what they ask (often completely different). This may be a good time to address that - after being sympathetic.