Those are some interesting requirements. I don't think you're going to find anything off-the-shelf that does all of that.
Jabber or even Office Communicator will satisfy some of the requirements, but things like saving all the messages to a text file... that isn't a standard feature, one would have to save each conversation manually.
I think what you are looking for is an app that would run on the instructors computer, and students would connect to using a web browser. Anonymity isn't usually a standard feature, but each computer could be configured to use a generic account (Computer1, Computer2, etc)