Skip to main content

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.

  1. Navigate to Site administration > Users > Permissions > Define roles
  2. Click the button to Add a new role
  3. In the next screen leave User role or archetype as "No role", and continue
  4. 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
  5. Click the button Show advanced if present
  6. In the filter field, enter block/xp
  7. 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
  8. 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 for the whole site.

  1. Navigate to the course of your choosing
  2. Visit the Participants or Enrolled students page depending on your Moodle version
  3. Assign the role Forbid Level Up XP interactions to all relevant users
  4. That is all.

Forbidding a whole category

You must be using Level Up XP per course, not for the whole site.

  1. Navigate to the category of your choosing
  2. Visit the Assign roles page
  3. Select the role Forbid Level Up XP interactions
  4. Assign the role to the relevant users
  5. That is all.

Forbidding everywhere

  1. Navigate to Site administration > Users > Permissions > Assign system roles
  2. Select the role Forbid Level Up XP interactions
  3. Assign the role to the relevant users
  4. That is all.

Additional resources