"gern haben" is for persons. "I like you." = "Ich habe dich gern."
"mögen" is for things, that you feel related to. "I like ice cream." = "Ich mag Eis."
"gefallen" is for stuff that you just got to know. "I liked the opera yesterday." = "Mir hat die Oper gestern gefallen.", "I like what you say." = "Mir gefällt, was du sagst."
"verb + gern" is for activities that you like to do and have already done several times. "Ich schwimme gern." = "I like to swim." "Ich fahre gern Auto." = "I like driving a car."
I hope I could be of help.
I'm Australian and wrote for this "You like swimming?" which would be a quite acceptable thing to say here, we often shorten things here when asking a question like this leaving off the do (thou some do say it with the do, its fine either way). It thou marks this response as being incorrect thou common language used here.
If I write answers in Scottish slang, they'll be marked a wrong despite being perfectly fine in Scotland.
Duolingo assumes proper English to make things easier for them (they don't have to account for every kind of slang) and you/me (if I write your answer which sounds like a statement, I need to be marked wrong to learn the real meaning).