I don't think that a 25% margin on the selling price and a 25% markup are the same thing.
e.g. a 10% margin on a selling price of $200 would mean that target cost is $180. Alternatively, a 10% markup on $180 would mean that the selling price is $198. The margin is a fixed proportion of sales with Target cost the variable, where as the markup is not a fixed amount as it is proportional to the target cost.
In the exam, i think i jumped the gun and did 25% profit margin on the selling price of $400 = $100. Therefore, the TC = $300. However, if what u say is correct, then i should have done a 25% margin on the TC which would produce the $320 figure. Although, my problem then with that figure is that you are not actually making a 25% margin (on sales).
It doesn't matter too much now. Results will be out in a month and we all have 3 months of summer ahead of us. Have a good break.