This site requires JavaScript to be enabled
An updated version of this article is available

Using Access Restrictions for Activities in Moodle

47961 views

14.0 - Updated on 2025-08-19 by Sarah Weatherman

13.0 - Updated on 2025-07-16 by Q Peiffer

12.0 - Updated on 2025-04-27 by Grace Hatterschide

11.0 - Updated on 2025-04-24 by Q Peiffer

10.0 - Updated on 2024-10-01 by Q Peiffer

9.0 - Updated on 2024-07-05 by Q Peiffer

8.0 - Updated on 2024-06-04 by Michael Whitman

7.0 - Updated on 2023-08-30 by Ethan Walgran

6.0 - Updated on 2023-01-25 by Ethan Walgran

5.0 - Updated on 2023-01-11 by Ethan Walgran

4.0 - Updated on 2022-11-09 by Ethan Walgran

3.0 - Updated on 2022-10-23 by Q Peiffer

In order to change access of an activity in a Moodle page, the instructor of the course must change the "Restrict access" options in the activity settings.  This can be very useful for external tools, which have limited settings inside of Moodle. This setting can be based on the following:

Multiple restrictions can be applied at once, and there is also an option to apply nesting for more advanced logic. 

This article provides several examples for working with the "Restrict access" settings.

Finding Restrict Access Settings

The access restriction settings are found in the Settings page of any activity or resource in Moodle.  There are two ways to get into the Settings page.

From The Main Course Page
  1. In the top-right corner of the screen, enable "Edit mode".
  2. Next to the activity's name, select the three vertical dots.
  3. In the pop-up menu that appears, select "Edit settings".
  4. Scroll down to the header labeled "Restrict access", and expand it.
From the Activity Page
  1. In the Activity's page, in the top row of headers, select "Settings".
  2. Scroll down to the header labeled "Restrict access", and expand it.

Using Restrict Access

In order to add a restriction, select the "Add restriction" button.

RESTRICTING BASED ON DATE AND TIME

Activities may need to have access restricted based on timing, which is like a Quiz's open and close time. This example will set an access restriction so that students can only access the activity between September 13th at 8:00AM, and September 15th at 11:55PM.

For the open time, select "Add restriction...", and select the Date button from the menu that appears. An option will appear in the Access restrictions tool, with two statements:

The first statement specifies the condition for all access restriction. When the first statement is set to "must", it says that all conditions in the box must be true in order for students to access the activity. This can be changed to "must not", meaning that all the conditions must be false in order for students to access the activity.

The second statement specifies a time and date that the activity will become available. By default, it is set to the current day at 00:00, the very start of the day at 12:00AM. In this example, change the time to 08:00, or 8:00AM.

For the close time, select "Add restriction", and then select the Date button again.  A new condition appears:

If access needs to be restricted after the 15th of September at 11:55PM, change the following:

The activity is now restricted from the 13th of September 2022 at 8:00AM until the 15th of September 2022 at 11:55PM.  The conditions should look like this:

RESTRICTING BASED ON GROUPS

Assignments may need to be restricted based on a Group role assigned to a student. For example, an assignment or group of assignments is specifically assigned to "Group Alpha".

For specific guidance on creating groups and adding students to them, please review our Creating and Adding Users to Moodle Groups article.

To add the restriction, select "Add restriction...", and then select the Group option from the window that appears. An option will appear in the Access restrictions tool, with two statements:

Click "Choose..." and select Group Alpha from the list.

In this case, it may also be prudent to declutter the Moodle page from students not in Group Alpha. In this case, select the open eye icon next to the Group restriction. This will change to a crossed-out eye, indicating that the assignment is fully hidden unless the student is in Group Alpha.

The conditions should look like this:

RESTRICTING BASED ON ACTIVITY COMPLETION

External tools may need to be restricted based on completion of a prior assignment. For instance, maybe an assignment should only be visible after a tutorial is completed.

To add the restriction, select "Add restriction...", and then select the Activity Completion button from the window that appears. An option will appear in the Access restrictions tool, with two statements:

Select "Choose..." and, from the list, select the activity "External Tool Tutorial" (this is an example). Note, that activity completion settings will need to be enabled on the assignment chosen in order for the Restrict access settings to allow it as an option.

Press Save. The assignment is restricted until students complete the other activity. The conditions should look like this:

Restriction in this way is also especially useful for Gamification.  See the "Overview of the Moodle Gamification Plugin" article for more details.

Additional Resources

Restrict Activity Access (Moodle Doc)

Setting Activity Completion on a Moodle Activity (DELTA Knowledge Base) 

Activity Completion (Moodle Doc)

Khan Academy article on conditional logic

For additional assistance, please contact the LearnTech Help Desk at learntech@ncsu.edu or (919) 513-7094, or via the Get Help form on the DELTA Knowledge Base.