In your test the correct answer is, probably, passing. That's what Murphy's English Grammar says:
When one action happens before another action, we use having
(done) for the first action:
Having finished her work, she went home.
You can also say after -ing:
After finishing her work, she went home.
So, when there is the word after, it is more "right" to use [verb]-ing. But note that after having (done) occurs in practical usage. These sentences I've found on Google News:
After having done this, he returned to the scene
A bus driver almost choked to death after having found a coil in his two chicken breasts
Khan thought he had the fight with Mayweather wrapped up after having won a poll on the website.