Restrict Course Access by Teachers & Students to Specified Hours

Restrict Course Access by Teachers & Students to Specified Hours

by jamee^ah Admin -
Number of replies: 4

Is there a way with the latest release of Moodle to restrict a course access to certain hours of the day? For example from 5PM-6PM eastern only. I have seen restrictions by day but not hours.

Thank you.

Average of ratings: -
In reply to jamee^ah Admin

Re: Restrict Course Access by Teachers & Students to Specified Hours

by Ken Task -
Picture of Particularly helpful Moodlers

Don't think one can find a plugin for Moodle that does such, however, via 2 cron jobs ... one called 'open' which would use the maintenance mode script in admin/cli/ of code @5PM and set to disable - thus site available to all.

The other cron job called 'closed' sets maintenance mode to enable and executes @6PM.

Won't keep admin level users out.

Bad thing about setting up this way ... can't run overall cron job for moodle while in maintenance mode.

With a little imagination one could possibly cron a redirect rule for open access to closed and vice versa ... which (I think) would still allow the running of cron for Moodle.  

Note: have never really done above ... you know what is said of 'best laid plans', right?

If the purpose is simply to restrict students/teachers from screen time, just cause moodle is un-available won't accomplish that.   Matter of fact, thinking differently, the more time a student spends in the moodle, as opposed to YouTube, student might discover 'getting something' that she/he hadn't before.

Curious .... have to ask ... why?  What's the reason?

'SoS', Ken

Average of ratings: Useful (2)
In reply to Ken Task

Re: Restrict Course Access by Teachers & Students to Specified Hours

by José Roberto Júnior -
I do not know the reason for the request from the colleague above, but here at the institution where I work we need to do this because the teachers are accessing it outside working hours and we may have legal labor problems.

I saw that a solution would be to use an authentication system like Microsoft's (I don't remember which feature exactly) which defines the team's working hours there. By configuring Moodle to accept only authentication through this tool, you can restrict access by time.

For me this solution is not viable because services like this here in Brazil have high values. Our institution is small, with no conditions for a corporate solution.

I am still looking for a more viable solution for our conditions.