Answer:
the teacher said they had a headache yesterday
The teacher said that "I had a headache the previous day".
I hope this helps you