The correct option is C When she allowed them to speak, the students told the teacher how strict she was.
Since the "students ..teacher" is qualified by the adverbial clause, "When...speak", these should be placed close together, hence Option B is correct. The rest of the options do not place the qualifying clauses together, hence incorrect.