Can't Make Course Public/Available to Guests (even with all the settings checked)

Can't Make Course Public/Available to Guests (even with all the settings checked)

by Sarah Noah -
Number of replies: 5

Moodle Version: 3.7+

PHP version: 7.1.30.1.16.04.1.1

I am trying to make a Moodle site that is technology onboarding for our campus and want to set it up so anyone joining the college can view the course, even if their account is not created yet (so a publicly accessed course). 

I followed all directions on the Moodle Guest Access documentation page, here: https://docs.moodle.org/310/en/Guest_access

However, whenever I use the URL to try to access the site publicly I still receive the Log in as Guest button (even with Auto login checked). And whenever, I click the link, I receive the following error:


Are there any other settings to check? I also double checked that cookies were enabled on the browser (Chrome) and still receive the same error. 

Average of ratings: -
In reply to Sarah Noah

Ang: Can't Make Course Public/Available to Guests (even with all the settings checked)

by Preben Pedersen -
Make sure that 'forcelogin' is unchecked in Siteadministration -> Security -> Site policies (/admin/settings.php?section=sitepolicies).

That would be my guess smile
In reply to Preben Pedersen

Re: Ang: Can't Make Course Public/Available to Guests (even with all the settings checked)

by Sarah Noah -
Hi Preben,

Thanks for the reply! I took a look under the closest setting I could find, which was Site admin > Security > Site security settings (I do not have Site policies under Security).

Here is what my settings show. Note how Force users to log in is unchecked already. 



Please let me know if you have any other ideas. 

Thanks! 
In reply to Sarah Noah

Re: Can't Make Course Public/Available to Guests (even with all the settings checked)

by Randy Thornton -
Picture of Documentation writers
Sarah,

1) The Auto-login setting works with urls that lead directly to a course, not to the main site.

So, if you use a url of the form https://[yourmoodlesitedomaingoeshere.com]/course/view.php?id=## where ## is a numeric id of the course, then the Auto-login for guest will take the user directly into the course. (If all is set up correctly in the course for Guest enrolment and the course is visible.) So, "auto-login" for guest is not very well named, since there is no actual login; it should be called something like "Bypass login and go directly to the course for guests" since when using this url to the course, it will bypass the front page and login entirely for guests, just like a web page.


2) The error above about Invalid login happens when you are trying to really login with the Log in button. Click the "Log in as guest" button instead to get access as a guest. Guest does not have a password for its account like normal users and never logs in the normal way.

If you have set a password in a course for guest access, then it will be asked for when the guest tries to enter the course. Each course can (and maybe should) have a different access password for the guest: the password is per course, it is not for a password for the guest user as a user. It's basically password protecting the course, which is otherwise public to view.

Randy
Average of ratings: Useful (1)
In reply to Randy Thornton

Re: Can't Make Course Public/Available to Guests (even with all the settings checked)

by Sarah Noah -
Hi Randy,

I appreciate the response, but it didn't help. The screenshot shown in my original post is what pops up when I use the URL that leads directly to the course, not the full site. So, I was already attempting to access the course URL and not just the site in general. When I paste the course URL into a browser, the page from my screenshot is what appears. Then, when I click on "Log in as Guest," the error message in that screenshot appears. It's as if it does not recognize at all that the course and site are set up to allow guest access, even though I have all the settings set up for this according to the Moodle Guest Access documentation.

I have not set a password to access the course I am testing with.
In reply to Sarah Noah

Re: Can't Make Course Public/Available to Guests (even with all the settings checked)

by Randy Thornton -
Picture of Documentation writers
Sarah,

Sounds to me like you have everything set up okay. This works for me in 3.7.

You may be the unfortunate victim of some random - and never truly identified - bugs in the use of the Auto-login with Guest. This has happened rarely from time to time in the last few years. See more about that here: https://tracker.moodle.org/browse/MDL-63154.

Have you tried this with more than one browser?

Another things to try is to turn on Debugging and try it again and see if there are any hidden errors back there. Something odd may turn up in that. How to do that is here:https://docs.moodle.org/310/en/Debugging#Enabling_debugging. Set it to Developer level, set Display messages on, and then try to access is as guest from another browser. (Turn it off when done so users don't complain.)

Some other obscure possibilities:

  • Is the Guest role present in Site admin > Users > Permissions > Define roles? Any changes made to it that you are aware of?
  • Are Site admin > Users > Permissions > User policies :: Role for visitors and Role for guest set to the default of Guest (guest)?
  • Are you using or have you tested this with the default Boost theme, as some other themes have custom login methods which might interfere.
  • Could there be some sort of redirect going on where the web server directs non-logged in users to the front page?
  • You have cookies on but are they being served properly? In Chrome, you can verify this Developer Tools > Application > Cookies, where you should find one cookie called MoodleSession, this is set when you first arrive at the site, before login, and removed when you log out.
Perhaps someone else has some other suggestions. Usually this is a issue of something disabled when it should be enabled, but as I say, there have been issues in the past few years where sometimes the Auto-login is not working in some cases and it has not been able to be reproduced so it can be debugged.