Let's look at "おっしゃった" (osshatta), the honorific past form of "言う" (to say), and "通りに" (toori ni), meaning "as; just like." The sentence states that the speaker will redo something exactly as the teacher said. Therefore, the way they will redo it is "先生のおっしゃった通りに" (just as the teacher said).
「おっしゃった」は先生が「言った」の尊敬語、「通りに」は「as; just like」です。先生が言ったのと全く同じようにやり直す、という意味です。やり直す方法は「先生のおっしゃった通りに」です。
Project Eagle analyzes your vulnerabilities using AI. Play thousands of interactive quizzes and mock exams completely free!