Hide to a group of users
At times, you may want to restrict a group of users from earning points, viewing the levels or completely interacting with Level Up XP, for example when running a control group. This can be done using the capabilities and roles that Moodle offers.
Creating the role
The first step is to create the role that restricts the permissions of our future users. Note that this requires administrator or site manager access.
- Navigate to Site administration > Users > Permissions > Define roles
- Click the button to Add a new role
- In the next screen leave User role or archetype as "No role", and continue
- Set the following details for this role
- Short name: levelupxp_forbidden
- Custom full name: Forbid Level Up XP interactions
- Custom description: Forbids users from earning points, viewing the block, their levels, etc...
- Role archetype: none
- Context types where this role may be assigned:
- System
- Category
- Course
- Allow role assignments:
- Manager
- Course creator
- Teacher
- Allow role overrides:
- Manager
- Allow role switches:
- Manager
- Course creator
- Teacher
- Non-editing teacher
- Allow role to view:
- Manager
- Course creator
- Teacher
- Non-editing teacher
- Click the button Show advanced if present
- In the filter field, enter block/xp
- Set the following permissions, and leave the rest unchanged:
- block/xp:addinstance: Prohibit
- block/xp:myaddinstance: Prohibit
- block/xp:view: Prohibit
- block/xp:earnxp: Prohibit
- Finally, click on Create this role
Assigning the role
Now that our role has been defined, we can start assigning it to users. The users given such role will no longer earn points or be able to view the block. Note that if they had previously earned points, it is possible that they still appear in the leaderboard, you will need to reset your courses or manually reset their points.
Forbidding a single course
You must be using Level Up XP per course, not sitewide.
- Navigate to the course of your choosing
- Visit the Participants or Enrolled students page depending on your Moodle version
- Assign the role Forbid Level Up XP interactions to all relevant users
- That is all.
Forbidding a whole category
You must be using Level Up XP per course, not sitewide.
- Navigate to the category of your choosing
- Visit the Assign roles page
- Select the role Forbid Level Up XP interactions
- Assign the role to the relevant users
- That is all.
Forbidding everywhere
- Navigate to Site administration > Users > Permissions > Assign system roles
- Select the role Forbid Level Up XP interactions
- Assign the role to the relevant users
- That is all.