Your version of the answer is correct, because when you were answering the teacher's question, you both were in the present. So only
I went to the toilet.
..is okay.
If you were relating this whole story later to somebody, then you might use the Past Perfect:
When I returned, the teacher asked me where I had been. I replied that I had gone to the toilet.
The Past Perfect is possible because you are retelling this story now. The moment when the teacher asked you is in the past, and the moment then you visited the toilet is in a deeper past.
Grammar terminology: my second example uses "backshifting" of tenses. More specifically, this is called "a backshift in reported speech" (here's another helpful explanation).
The past tense and present perfect tense may seem similar, but they are very different. The past tense describes a specific event, e.g. "John ate an apple". It's like a story.
The present perfect tense on the other hand is not a description of a specific event. It is only an assertion that there exists an event fitting the details of that sentence, and the event completed before the present. "John has eaten an apple" means the event of "John eats an apple" occured at least once in John's lifetime.
If I were to draw a picture that directly represents "John ate an apple", I would draw a picture of a man eating an apple, an the "time within the drawing" would be in the past.
If I were to draw a picture that directly represents "John has eaten an apple", I would draw nothing, because the sentence is just an abstract fact like "Most people use cellphones".
Therefore, if someone asks you,
What did you do for the holidays
You should reply with a description of "what you did for the holidays". You can give a description by using the past tense. You could say:
I went to Switzerland
If you had replied "I have been/gone to Switzerland" it would feel very out of place -as if you were saying a random fact about yourself.
Keep in mind that I these are just my observations as an American English speaker. I've heard that British speakers use the present perfect tense to also describe specific events, but Im not sure.
Best Answer
I think we can answer the question by ruling out the incorrect options.
This sentence is in past perfect tense. Past perfect is used to avoid ambiguity when we mention two events that happened in the past. We use the past perfect for the earlier event. However, in many cases the chronological order is obvious; then we can use the simple past tense without causing any ambiguity.
Here, "gone" is an adjective. At the first glance I confused it with a passive structure, but the verb "go" is an intransitive verb. By the way, the adjective "gone" describes "leaving a place". Therefore, it does not make sense in this context.
I think this sentence does not have a serious problem in terms of using tenses.
In this sentence we have the past progressive (or continuous) tense. Progressive aspects are used to talk about a process. "I was going to Peru" implies that you were in the middle of your trip, for example somewhere between Peru and the location where you started your journey.
Therefore, as a learner, I would choose the third answer among those four options.