Course Press Auto Enrollment function does not work with latest version

Hello,

just tried to use the code from https://premium.wpmudev.org/forums/topic/coursepress-auto-register-user#post-768674 with the latest version of the course press plugin and I get an error that the class "Student" does not exist.

How would I need to modify the code to get it running with the latest version of course press?

Many thanks in advance,
André