と先生に言われた

was told by the teacher that…

→ と
phrase Rare #42,825
was told by the teacher that… と marks the quoted statement that comes before it.
JA: 早く寝た方がいいと先生に言われた。
EN: I was told by the teacher that I should go to bed early.

もっとじっくりスピーチの準備をすべきだったと先生に言われた。

My teacher told me I should have taken more time to prepare my speech.

そうしろと先生に言われた

My teacher told me to do so.

— ダーク・プレイス (2015)

もっと水を飲んだ方がいいと先生に言われたよ。

My teacher told me I should drink more water.

もっと時間をかけて発表を準備すべきだったと先生に言われた。

My teacher told me I should have spent more time preparing my presentation.