Benefit System Block
A Moodle block that displays the logged-in user's points balance and provides quick links to the Benefit System rewards and history pages. It works alongside the local_benefitsystem plugin.
Features
- Points display – Shows the current user's points balance in the block
- User info – Displays the user's avatar and full name
- View Rewards – Button linking to the available rewards page (exchange points for rewards)
- Your Rewards – Button linking to the user's exchanged rewards and exchange history
- Purchase History – Button visible only to site admins and users with
local/benefitsystem:managerewards; links to the admin purchase history page
The block is hidden for guests and shows a message if the local Benefit System plugin is not installed.
Requirements
- Moodle 4.0 or later
- local_benefitsystem plugin installed and upgraded (the block depends on it for balance and pages)
Installation
Ensure the local plugin is installed
The block requires local/benefitsystem. Install it first if you have not already.
Install the block
- Place the
benefitsystem folder in your Moodle blocks/ directory.
- As an administrator, go to Site administration ' Notifications and complete the upgrade.
Add the block
- Turn editing on (e.g. on Dashboard or a course page).
- Use "Add a block" and choose Benefit system.
- The block can be added to the Dashboard, course pages, course categories, activity pages, and site pages.
Usage
For users
- Dashboard / course / activity – When the block is present, users see their avatar, name, and points.
- View Rewards – Opens the list of rewards they can exchange points for.
- Your Rewards – Opens their exchanged rewards and exchange history (e.g. mark as redeemed).
For administrators
- Purchase History – Visible in the block only to site admins and users with
local/benefitsystem:managerewards. Opens the page that lists all users’ active and redeemed exchanges.
Where the block can be added
- Site front page
- Dashboard (My page)
- Course pages
- Course category pages
- Activity (module) pages
Only one instance of the block can be added per page.
Capabilities
| Capability | Description | Default |
|------------|-------------|--------|
| block/benefitsystem:addinstance | Add the Benefit system block to a page | Editing teachers, managers |
| block/benefitsystem:myaddinstance | Add the Benefit system block to the Dashboard | All logged-in users |
File structure
blocks/benefitsystem/
"── block_benefitsystem.php # Block class and content logic
"── db/
│ └── access.php # Capability definitions
"── lang/
│ └── en/
│ └── block_benefitsystem.php
"── styles.css # Block layout and points styling
"── version.php
└── README.md # This file
Privacy
The block does not store any user data. It only shows data (balance, links) provided by the local_benefitsystem plugin and links to its pages. Privacy metadata is defined in the block’s language file.
License
GPL v3 or later.
Copyright 2026 Bartosz Szaflarski (bartosz.szaflarski@shafla.pl).