Thanks David! Really helpful. But before I sent this post, I had already suggested to my friends that "had got" could be used in this sentence. However, they said we couldn't for 2 reasons:
1- We can't use 2 verbs in the past perfect in one sentence.
2- The verbs "got out.." and "realized" both happened almost at the same time and, so, the verb "got" can't be used in the past perfect simple, and also "had answered one question wrong " is action number 1 here and must be in the past perfect.
What do you think of this?