Guest access

Guest access

by Martin LaGrow -
Number of replies: 3

Is there a way to configure a report to show which courses have guest access enabled?

Average of ratings: -
In reply to Martin LaGrow

Re: Guest access

by Randy Thornton -
Picture of Documentation writers

If you install the Configurable Reports plugin, you can do a report for this. https://moodle.org/plugins/view.php?plugin=block_configurable_reports

Here's code I use to do this (for 2.5) - very basic, but shows you all courses with Guest enrolment whether it has been turned on or not.

 

SELECT c.shortname, c.fullname, 
CASE
 WHEN c.visible = 0 THEN 'Hidden'
 WHEN c.visible =1 THEN 'Available'
END AS Course_status,
CASE
  WHEN e.status = 0 THEN 'On'
  WHEN e.status = 1 THEN 'Off but present'
END AS Guest_enabled
FROM prefix_course AS c
JOIN prefix_enrol AS e ON c.id = e.courseid
WHERE e.enrol = 'guest'
 
Average of ratings: Useful (1)
In reply to Randy Thornton

Re: Guest access

by Stuart Mealor -

Beat me to it Randy !

We had a similar query on www.FreeMoodle.org because we needed to check which Courses had Guest access enabled, and which Teachers had changed it! sad

My query just showed Courses that did not have Guest access enabled, but Randy's version is nicer I think smile

Stu

In reply to Stuart Mealor

Re: Guest access

by Randy Thornton -
Picture of Documentation writers

I hope you borrow it smile

I used to be really paranoid about courses where Guest access might be present but not enabled, in case a Teacher just went clicking around and turned it on by mistake. So the last column in the report is useful for alerting you to that situation.