PlayerHUD Filter

Filters ::: filter_playerhud
Maintained by Jean Lúcio Santos Evangelista
A Moodle filter plugin that enables collectible item drops inside course content using PlayerHUD shortcodes.
Latest release:
9 sites
142 downloads
4 fans
Current versions available: 1

PlayerHUD Filter – Content Integration for Gamification

The PlayerHUD Filter is the essential companion plugin for the PlayerHUD Block. It enables the seamless insertion of gamification elements—such as collectible items, interactive NPC trades, and student dashboards—directly inside your Moodle course content.

Using a simple shortcode-based integration, teachers can embed these interactive elements within Pages, Labels, Books, Forum descriptions, and any other HTML-supported activity.

✨ Features

  • 📍 Inline Item Drops: Embed hidden or visible collectible items throughout the course learning path.
  • 🏪 Embedded NPC Trades: Place specific shop trades directly inside activities or lessons so students can exchange items contextually.
  • 📊 Course Dashboard Widget: NEW Embed a redesigned mini-HUD in a compact card layout—showing the student's character portrait, tier stars, reputation bar, level, XP, and recent stash—anywhere in the course (e.g., Topic 0).
  • Real-Time AJAX: Instant item collection and trade execution without page reloads, fully integrated with Moodle's External API.
  • 📱 Mobile-Ready Fallbacks: Graceful degradation and smart redirections for the official Moodle Mobile App.

📝 Supported Shortcodes

The filter automatically detects and transforms the following codes into interactive UI components:

  • [PLAYERHUD_DROP code=XXXXXX] - Renders a collectible item card, image, or text link. Supports strict server-side validation for cooldown timers and max usage limits.
  • [PLAYERHUD_TRADE code=XXXXXX] - Renders an interactive trade interface where students can pay required items to receive rewards directly from the text.
  • [PLAYERHUD_WIDGET] - NEW Renders the student's mini-profile, now featuring a compact card layout with character portrait, tier stars, reputation, Level, Progress Bar, and Recent Backpack Items.

🔗 Ecosystem Integration

This filter requires the PlayerHUD Block to function properly.

⚙️ Technical Reliability & Security

  • Hyper-Optimized Performance: Implements a strict Zero N+1 architecture. Even if a single page contains 50 shortcodes, the filter resolves all of them using bulk database queries and memory mapping, ensuring zero impact on server load.
  • Accessibility (WCAG 2.1 AA): Fully accessible interactive elements, proper ARIA labeling for emojis/images, keyboard navigation support, and screen-reader compliant modals.
  • Robust Security: Shortcode hashes prevent ID enumeration (students cannot guess or brute-force other item codes). Full capability checks and require_sesskey() enforcement on all AJAX triggers.

Potential privacy issues

This plugin does not store personal data. It renders interactive elements and relies on the PlayerHUD Block for data management.

Screenshots

Screenshot #0

Contributors

Jean Lúcio Santos Evangelista (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments

Show comments
Please login to post comments