Moodle Plugins directory: eFlow AI Tutor | Moodle.org
eFlow AI Tutor
eFlow AI Tutor for Moodle
This plugin integrates an AI tutoring system into Moodle, providing real-time assistance to students and teachers.
Features
- Floating chat button that can be positioned anywhere on the screen
- Real-time AI responses through API integration
- Customizable appearance
- Iframe mode support with dynamic Moodle variable insertion
- Automatic polling for new responses
Installation
- Extract the plugin files to
/local/eflow_aitutorin your Moodle installation - Visit Site Administration > Notifications to complete the installation
- Configure the plugin in Site Administration > Plugins > Local plugins > eFlow AI Tutor
Configuration
To obtain your API credentials:
- Visit https://eflow.ai
- Click on "Book a Demo"
- The eFlow support team will contact you and provide your API credentials
Configuration
- Enable the plugin
- Set the API credentials (username and password)
- Configure the appearance settings
- Customize which courses have the tutor enabled
API Polling
The plugin automatically polls the eFlow API every 30 seconds to check for new responses. This happens when:
- The chat interface is open
- The user is active on the page
Polling is automatically paused when the chat is closed to conserve resources.
Technical Details
API Integration
The plugin connects to the eFlow API for AI responses. The flow is:
- User sends a message from the chat interface
- Message is sent to the API via AJAX
- Plugin polls the API every 30 seconds for new responses with default parameters
- New responses are displayed in the chat interface automatically
Iframe Mode
When iframe mode is enabled, the plugin can display external content in an iframe instead of the chat interface. The iframe URL can include the following Moodle variable placeholders:
moodle_user_id: The current user's IDmoodle_course_id: The current course's IDmoodle_activity_id: The current activity's ID (if available)
For example, if you set the iframe URL to:
https://learn.eflow.app/embed/eL990000316938e/moodle_user_id/moodle_course_id/moodle_activity_id/app
The plugin will automatically replace the placeholders with actual values:
This allows the iframe content to be aware of the Moodle context in which it's being displayed.
JavaScript Components
chat.js: Main chat interfacepoller.js: Handles API polling functionality
PHP Components
classes/external/send_message.php: Sends messages to the APIclasses/external/check_responses.php: Checks for new responseslib.php: Contains utility functions including API authentication
License
This plugin is licensed under the GNU GPL v3 or later.
Comments