Thank you very much.
This phrase is used to thank teachers for everything they have done, and also to express appreciation for the energy and effort they have expended.「ご苦労様くろうさまでした」(gokurosama deshita) has a similar meaning but may at times sound condescending and even rude, so it is probably best to avoid using it.