The subject of the Passive Voice is changed into the object of the Active Voice. Also, the object of the Passive Voice is changed into the subject of the Active Voice.
The removal of the "to be" verb and the preposition "by" is necessary while changing the voice of the sentence from Passive to Active.
In Active voice (look at the options), it should be in interrogative form. These are "wh" questions that don't take "yes" or "no" as an answer.
"By whom?" is changed into "Who" while transforming from Passive to Active.
For example:
By whom are you taught Math? (or) Who are you taught Math by? (Passive)
Who teaches you Math? (Active)
"Who" is changed into "Whom" while transforming from Passive to Active.
For example:
Who is being taught by you? (Passive)
Whom are you teaching? (Active)
The sentence in the Passive voice is in Past indefinite. So, the sentence in the Active voice should be in past indefinite.
The options except (4) don't follow the correct grammatical format of the Active Voice.
Therefore, the correct answer is: "Who taught you grammar?"