it always accepted "hat" as both "czapka" and "capelusz"...
in this sentence it is clear you have to distinguish between those two. (cap=czapka, hat=kapelusz)
(In Polish "kapelusz" has a whole rim)
Why does cap need an article here?
is kapelusza in the case of "dopelniacz" here ?
Yes indeed. "zamiast" takes Genitive.
"A cap rather than a hat" was marked incorrect. Please explain.
Seems fine, added.