"Il a entendu le chien en entrant dans l'appartement."
Translation:He heard the dog while entering the apartment.
I put " on going into the apartment". As far as I know this is entirely synonymous with "on entering...." but it was rejected nonetheless.
That sentence is ambiguous. One sense is "the dog [which was] entering the apartment". For that, I'd answer "Il a entendu le chien qui entrait dans l'appartement". Another sense is "heard the dog enter[ing] the apartment". I'm not confident enough to translate that one.
If he heard the dog entering the apartment, the French sentence would be different: "Il a entendu le chien qui entrait dans l'appartement".
If you now accept "upon entering the apartment," you should also accept the far less archaic "on entering the apartment."