In my development team we're gotten a question from our stakeholders to make a navigation based on user roles (Students, Teachers, Course Administrators). I feel that is quite complicated of a task, and you never know which role the anonymous user has. If a user is logged in, it's easy - but for an anonymous user what's the best suggestion?
Well, what's the not-logged-in user most likely to be? For your specific use case it seems the obvious answer would be students.
Any activity that requires logging in or any form of authentication of course shouldn't be part of the logged-out view (alternately, attempting to initiate such an action would force a log in prompt). Depending on the system it's quite likely that Teachers have a special and more complicated UI, and some features teachers get shouldn't be allowed for students or anonymous users.
Anonymous users should be given whatever role has the least permissions and is the most common. This might be it's own role or it might be a read-only version of the lowest-permission logged-in account.
Giving them a way to chose whatever role sounds great in theory, but in reality a lot of those Administrator functions probably aren't/shouldn't be accessible from anonymous users. Important, high-privileged roles almost exclusively require logins, so why would anonymous users be able to see those navigation options?
With anonymous users there is nothing you can do, except provide a way for them to chose whatever role the want to assume. So split the content of the site in three distinct sections and tailor it to each role's needs.