'r is a form of the definite article after a vowel.
The full form of this sentence is 'Dw i'n hoffi y caffi yma'
Hoffi ends in a vowel and is followed by 'Y' another vowel in Welsh.
This contracts to 'hoffi'r'
Which gives us - Dw i'n hoffi'r caffi yma
The literal translation of this sentence is 'I like the café here'
We generally translate 'the café here' as 'this café'
You may have noticed that 'caffi yma' is also two vowels next to each other and in fact we often write this sentence as:-
Dw i'n hoffi'r caffi 'ma.
But we didn't have 'ma to use to create the sentence for the course.
It is. But y ... yma is usually translated "this ...":
y caffi yma = "this cafe"
y plentyn yma = "this child"
y gath yma = "this cat"
It'd be y caffi hwn, not hon, as caffi is masculine. That's rather more formal language, plus it's more complicated as you have to be sure of your noun genders.
It told me "caffi 'ma" was incorrect, that it had to be "caffi yma." What are the rules for dropping the "y"?
It should have accepted it, I guess. Using 'ma as opposed to yma is just more informal and so very common in speech. The same applies for 'na from yna.
10 of the 26 possible answers here use "caffi 'ma" so maybe your mistake was somewhere else.
The system is not intelligent it just gives you the next correct answer after your attempt rather than corrects any mistake.