The issue is that 15cm is the entire path, but just like climbing a mountain, it doesn't matter what winding path you take. The only thing that matters is the difference between the start and end points, which in this problem is only 10cm. So the math is correct, but the numbers are not.
(.10)*(10)*(8) = 8 J