Translation:I bought five pieces of fruit cake.
The English translation is slightly misleading, ask for a slice of fruit cake in English and you'll get a thick dense spiced brick, made with nuts, and dried and candied fruit. I think what most Chinese mean by 水果蛋糕 would probably best be described as a "fresh fruit sponge cake".
"I bought five fruit cakes" should be accepted. Moreover, the correct answer "I bought 5 pieces of fruit cakes." is wrong, should be just cake, since it's already 5 pieces.
If you have eaten cake before, you know that the cake can be cut up into slices and then each slice can be sold independently. In here, the sentence says that "I bought 5 slices of fruit cake", not 5 whole cakes, because there is the classifier 块, so "I bought five fruit cakes" is unacceptable.
If you want to say you bought 5 whole cakes, say 我买了五個水果蛋糕。
Sebast1ans is correct in pointing out that "pieces of fruit cakeS" is incorrect, though.
Chinese "measure words" can be tricky, and "piece" isn't the most complete definition for "块"; its also used for money " 一块钱" (so I think "unit" might be better). There are some instances where "五块蛋糕" being packaged for individual sale could be a size and shape that someone might describe them as "5 cakes", but the 1st thing I'd think of when hearing "5 cakes" would be 5 large whole cakes
I think it depends on the size of the cake. Wu kuai could be five square cakes or five squares of cake. Five pieces of fruit cake or five fruit cakes should both be acceptable.
蛋糕 - Have your 'dàngāo' and eat it too!
The character for "le" is pronounced "liang" when you tap on it. I know that that is one pronunciation of the character, but not in this context.