"I drink coffee before going to sleep."
Translation:Tôi uống cà phê trước khi đi ngủ.
Tôi uống cà phê trước đi ngủ. is not correct but one of the possible translations for before is trước. Why is it not correct?
Adding đang would mean you are literally going to sleep at that moment. đang is used for the present progressive. Here, the "going" isn't present progressive, but simply the gerund.
Possibly a problem with this. I typed in, letter for letter, tone for tone, the same phrase, but it was graded as incorrect
I believe you're right. The second time it came around I typed it in properly, making sure it was ship shape, and I got it right. I probably left a letter out in fact, I type too fast