Moodle Plugins directory: OpenAI ChatBot: Versions: 1.0.0 | Moodle.org
OpenAI ChatBot
OpenAI ChatBot 1.0.0
Code prechecks
OpenAI ChatBot Block for Moodle
A powerful Moodle block that integrates OpenAI's Assistant API to provide intelligent tutoring and course-specific assistance directly within Moodle courses.
Features
- 🤖 OpenAI Assistant Integration: Uses OpenAI's latest Assistant API v2
- 📚 Course Context Awareness: Provides responses tailored to specific course content
- 🌍 Multi-language Support: Available in English and Spanish
- 🎨 Modern UI: Clean, responsive design that integrates seamlessly with Moodle Themes
- ⚙️ Easy Configuration: Simple admin interface for API key and assistant setup
- 🔒 Secure: No hardcoded API keys, all configuration through Moodle admin
Requirements
- Moodle 4.1 or later
- OpenAI API account with Assistant API access
- PHP cURL extension enabled
Installation
Method 1: ZIP Installation (Recommended)
- Download the plugin ZIP file
- Go to Site administration → Plugins → Install plugins
- Upload the ZIP file and follow the installation wizard
Method 2: Manual Installation
- Extract the plugin files
- Copy the openai_chatbotfolder to[moodle]/blocks/
- Go to Site administration → Notifications to complete the installation
Configuration
1. Get OpenAI Credentials
- Create an account at OpenAI Platform
- Generate an API key from the API Keys page
- Create an Assistant from the Assistants page
- Copy your Assistant ID
2. Configure the Plugin
- Go to Site administration → Plugins → Blocks → OpenAI ChatBot
- Enter your OpenAI API Key
- Enter your Assistant ID
- Configure other settings as needed:
- Enable Course Context: Include course information in responses
- Maximum Response Time: Timeout for API responses (default: 30 seconds)
 
3. Add Block to Courses
- Navigate to any course
- Turn editing on
- Click Add a block
- Select OpenAI ChatBot
- The block will appear in the course sidebar
Usage
For Students
- Type questions in the chatbot interface
- Get instant AI-powered responses
- Responses are contextual to the current course content
For Teachers
- Same interface as students
- Can help answer complex course-related questions
- Provides additional tutoring support
For Administrators
- Monitor usage through Moodle logs
- Adjust configuration settings
- Manage API costs through OpenAI dashboard
Customization
Assistant Behavior
Customize your assistant's behavior by: 1. Going to OpenAI Assistants 2. Editing your assistant's instructions 3. Adding knowledge base files 4. Configuring model parameters
Block Appearance
- The block inherits your Moodle theme styling
- Custom CSS can be added through Appearance → Themes → Advanced settings
Security & Privacy
- ✅ No API keys stored in code
- ✅ All configuration through Moodle admin interface
- ✅ User questions are sent to OpenAI for processing
- ✅ No personal data stored locally by the plugin
- ⚠️ Questions and responses pass through OpenAI's servers
Privacy Considerations
This plugin sends user questions to OpenAI's servers for processing. Please ensure your users are aware of this and that it complies with your institution's privacy policies.
Troubleshooting
Common Issues
"Configuration missing" error - Check that API key and Assistant ID are correctly entered - Verify your OpenAI account has API access
"Timeout" errors - Increase the Maximum Response Time setting - Check your internet connection - Verify OpenAI service status
Block not appearing - Ensure plugin is properly installed - Check that you have permission to add blocks - Try refreshing the course page
Getting Help
- Check the OpenAI API Status
- Review your OpenAI API usage and limits
- Check Moodle error logs for detailed error messages
Development
File Structure
blocks/openai_chatbot/
├── block_openai_chatbot.php    # Main block class
├── version.php                 # Plugin version and dependencies
├── settings.php               # Admin configuration interface
├── styles.css                 # Block styling
├── chatbot.js                 # Frontend JavaScript
├── lang/                      # Language files
│   ├── en/
│   └── es/
└── README.md                  # This file
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
License
This plugin is licensed under the GNU GPL v3.
Credits
Developed for the Moodle Community - 2025
Changelog
Version 1.0.0
- Initial release
- OpenAI Assistant API v2 integration
- Course context awareness
- Multi-language support (EN/ES)
- Admin configuration interface
For support and updates, visit our GitHub repository.
Version information
- Version build number
- 2025100500
- Version release name
- 1.0.0
- Maturity
- Stable version
- MD5 Sum
- b67ba5697c0cc6ccf2c29329192991ee
- Supported software
- Moodle 4.1, Moodle 4.2, Moodle 4.3, Moodle 4.4
- Latest release for Moodle 4.1
- Latest release for Moodle 4.2
- Latest release for Moodle 4.3
- Latest release for Moodle 4.4
 
Version control information
- Version control system (VCS)
- Other...
- VCS repository URL
Default installation instructions for plugins of the type Blocks
- Make sure you have all the required versions.
- Download and unpack the block folder.
- Place the folder (eg "myblock") in the "blocks" subdirectory.
- Visit http://yoursite.com/admin to complete the installation
- Turn editing on in any home or course page.
- Add the block to the page
- Visit the config link in the block for more options.