Remembered in this sentence is in the past tense, so the verb or verb phrase should also be in past tense. So your answer is D. had completed
The sentence should read as follows.
I had completed the test when I remembered the correct answer.
Hope this helps. :)