Its pretty easy to distinguish between la and la. I guess they were kinda smart in doing this. Writing le pomme should make you realise you are wrong and then write the correct one le pain. A listening excersize that isnt just about figuring out what they said but discerning the difference in grammar at the same time, not sole!y relying on your ears.
Well done duolingo on this one.
All nouns in French have a gender: masculine or feminine. There is no logic other than etymology. So you must learn each noun with its gender. In addition, determiners (possessive adjectives, articles, demonstrative adjectives, etc) agree in gender and number with the noun they come with. Same rule for usual adjective.
Le bon pain La bonne pomme