The original sentence should use капелюх, as this is a more common word in Ukrainian for "hat". Шапка in Ukrainian means "a headline" or a "fur hat"
The first thing I imagine when I hear шапка is actually a beanie :)
But yes, what is commonly called "hat" is капелюх in Ukrainian
So why this course uses less common version? And I must say that I prefer "капелюх", because it's like Polish "kapelusz" and "шапка" is like Polish "czapka" - "cap", so it's confusing for me.