I don't know the right words for some of the grammar, but here is how it breaks down. I hope that helps.
"your parents were ill" -- that's a straightforward sentence. In English we can mash sentences together.
"your parents were ill at the time" -- "at the time" almost certainly refers to "your parents were ill". It might also refer to "explained". It would be strange to split up "explained at the time" that way, so this is saying that your parents were ill at the time of the test.
"gone and explained" -- this phrase is acting like a verb. It implicitly refers back to "Your teacher" -- "gone (to your teacher) and explained (to your teacher)"
"had you" -- this is an old-fashioned way of saying "if you had"
So far, we have
- if you had gone (to your teacher) and explained that
- your parents were sick at the time of the test
If the sentence said "if you had", this would be two sentences joined together by "if". I believe the right term is that this is a compound sentence, but I may be mistaken. It could also be called a conditional sentence, but I'm not sure if that's a grammar term. (I bet Phil knows.) Such sentences are easier to understand when the "if" clause comes first, like "If XXX, then YYY." However, it is still correct to say it like this sentence does, "YYY if XXX."
"You had gone" is the past perfect tense of "to go". It means that the action ("to go") was completed in the past. You might google "English past perfect tense".
"Your teacher would have been happy to give you a makeup examination" -- "would have" is called a past modal. It refers to something that could have happened, but didn't.
And, in case it is not clear from context, "to give you a makeup examination" means to give you a test to make up for the one you missed.