I have no idea what your doing on this line. You don't divide it by 4 because there's 4 tests, but rather by the total percentage.
To get the final mark in terms of a percentage you would have to do
because in total the weighting is out of 50. You need to do 12.5 * 4 as there's 4 tests each worth 12.5% which gives you 50.