"A nightmare came on him last night". That should be marked correct because it's the literal translation.
No, it should not be marked correct, because it is only a "literal" translation, and that indicates that you don't actually understand what the phrase means, and that you haven't learned how to say "he had a nightmare".
Bhí tromluí agam aréir. Easca.
Was it in your pocket? Because that sentence means that you had one in your possession, it doesn't mean that you experienced one.
Important to know that across much of the US the more literal translation, "a nightmare came on him last night" is the accepted speech, at least among the older pre-television generation.
Where does "he" come from? I wrote "A nightmare came last night."
air is ar é. In Irish, you don't 'have' a nightmare; nightmares come on you.
I knew that. Go raibh maith agat!
Putting it that way, that's kinda creepy.
It's a very poetic language. Sometimes for the worse haha