Teacher taught for months despite child porn investigation