Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Guest role.

Guest role

From MoodleDocs

Guest access

Moodle has a built-in "Guest account". Visitors can log in as guests using the "Login as a guest" button on the login screen and enter any courses which allow guest access. In addition, logged-in users can enter any courses which allow guest access without being required to enrol.

Guests ALWAYS have "read-only" access - meaning they can't leave any posts or otherwise mess up the course for real students.

They cannot:

This feature can be handy when you want to let a colleague in to look around at your work, or to let students see a course before they have decided to enrol.

Note that you have a choice between two types of guest access: with an enrolment key or without. If you choose to allow guests who have the key, then the guest will need to provide the current enrolment key EVERY TIME they log in (unlike students who only need to do it once). This lets you restrict which guests can get into a course. If you choose to allow guests to enter without a key, then anyone can get into your course.

If you want guests to be able to take quizzes, or any of the other activities listed above, and have considered the security implications, you can create a visitor account, say with username = password = visitor, for everyone to share.

Enabling guest access

To enable guest access to a Moodle site, the guest login button should be set to "show" by an admin in Administration > Users > Authentication in Moodle 1.9 and in Administration>Plugins>Authentication>Manage Authentication in Moodle 2.0

Teachers can then set whether their courses allow guest access in the course settings.

To allow visitors to be logged in as guests automatically when entering courses with guest access, the autologinguests box should be checked by an admin in Administration > Users > Permissions > User policies.

Disabling guest access

Guest access for visitors can be disabled by hiding the guest login button. In the site administration block in Moodle 1.9 go to Users > Authentication > Manage Authenticationor in Moodle 2.0 go to Plugins> Authentication>Manage Authentication and scroll down to the Guest Login Button pulldown menu.

TIP: Generally speaking, if any courses allow guest access then there will be no way for a visitor to log into the site and thus they will not be able to see these courses.

Self-enrolment

Sometimes you may wish to allow people to have a more interactive engagement with a course without you having to enrol them in advance. In this case you can enable "self-enrolment" for your course. This allows anyone with a user account on your Moodle server to become a student on your course. As with guest access, you can use the enrolment key to limit this only to people to whom you have given the key.

Skip login page by URL

When you need a URL for external people to view your Moodle pages which allow guest access, you can add to one simple URL parameter username=guest to skip login page and automatically login these users as Guests.

For example, this URL will ask the user to login before display Welcome page of the "Using Moodle" course:

But this URL will log the visitor in as Guest and display the requested page immediately:

Note: if user tries to go to login directly from the page opened by this URL, he can't do it because the login page will return him to that URL and relogin as Guest again. It can be frustrating, and because of this, use this method only in links for external visitors.

See also

Using Moodle forum discussions: