A responsive web dashboard for visualizing Moodle LMS data and analytics. This dashboard provides insights into user activity, course statistics, and other key metrics from your Moodle installation.
- Real-time statistics on users, courses, and categories
- Active user tracking
- Clean, modern UI with responsive design
- Interactive charts and visualizations
- Recent activity feed
- Mobile-friendly interface
- PHP 7.4 or higher
- Moodle 3.9 or higher with web services enabled
- Web server (Apache/Nginx)
- MySQL/MariaDB (for future features)
-
Clone this repository to your web server:
git clone https://github.com/yourusername/moodle-analytics-dashboard.git
-
Copy
config.sample.php
toconfig.php
and update with your Moodle API credentials:define('MOODLE_API_URL', 'https://your-moodle-site.com/webservice/rest/server.php'); define('MOODLE_API_TOKEN', 'your-webservice-token');
-
Make sure the web server has write permissions to the following directories:
/cache
/logs
-
Access the dashboard through your web browser:
http://your-server/moodle-analytics-dashboard/
- In your Moodle site, go to Site administration > Plugins > Web services > External services
- Create a new service
- Add the following functions:
- core_webservice_get_site_info
- core_user_get_users
- core_course_get_courses
- core_course_get_categories
- Create an external service user with appropriate permissions
- Generate a token for the user
Edit the config.php
file to customize:
- API endpoints
- Database connection
- Caching settings
- UI preferences
-
Dashboard Overview
- View key statistics at a glance
- Monitor active users in real-time
- Track course and user growth
-
User Analytics
- View user activity patterns
- Track course enrollments
- Monitor user engagement
-
Course Analytics
- Track course completion rates
- Monitor assignment submissions
- Analyze quiz performance
- Install Node.js and npm
- Install dependencies:
npm install
- Build assets:
npm run build
- Follow PSR-12 coding standards
- Use PHP 7.4+ features where appropriate
- Document all functions and classes with PHPDoc
- Write unit tests for new features
- Keep your Moodle API token secure
- Restrict access to the dashboard using .htaccess or server configuration
- Regularly update dependencies
- Follow security best practices for PHP applications
This project is open-source and available under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.
For support, please open an issue in the GitHub repository.