Empowering Smarter Learning Through AI
Built with the tools and technologies:
MoodleAgent is an all-in-one automation tool designed to streamline educational content management within Moodle. It leverages web automation, PDF processing, and AI-driven analysis to facilitate data extraction, document summarizing, and interactive flash-cards.
What is MoodleAgent?
This project simplifies workflows by integrating multiple tools for web scraping, PDF content extraction, OTP management, and AI interactions.
The core features include:
- 🔍 Web & PDF Automation: Automates navigation and content extraction from Moodle courses, including PDF text processing.
- 🧠 AI Content Analysis: Generates summaries, flashcards, and quizzes using multiple AI providers for flexible insights.
- 🎛️ User Interface: Provides an intuitive web interface for configuring tasks, monitoring progress, and reviewing results.
- 🔑 OTP Migration: Facilitates secure transfer of 2FA secrets, enhancing authentication management.
- ⚙️ Environment Management: Ensures all dependencies are installed for scalable, robust functionality across the project.
- Python 3.12
pip- Internet access (for Moodle + AI APIs)
- Appropriate Moodle credentials (user, password; possibly permission to download course resources)
- API keys / credentials for AI provider(s) you intend to use
git clone https://github.com/ShadowsAdi/MoodleAgent.git
cd MoodleAgent
pip install -r requirements.txt- Copy
.env.exampleto.env - Fill in necessary environment variables:
- Moodle login credentials (URL, username, password, OTP secret if needed)
- AI API key(s)
python app.py- Access the web UI (default:
http://127.0.0.1:8000) - From UI, configure tasks (e.g. which Moodle course(s), what content to extract), trigger or schedule them.
Here are a few example workflows:
-
Generate flashcards from PDF lectures:
- Give MoodleAgent the name of course folder.
- It searches for lecture's PDF, extracts text.
- Uses AI to create flashcards automatically or generate a quiz.
-
Summarize a course module:
Extract all lesson pages + PDFs, produce a summary document (or set of summaries per section) to help students review. -
Backup / migrate 2FA secrets:
Use the OTP secret extractor to export or migrate OTP secrets safely. See Google Authenticator Exporter
The Flask app exposes several REST endpoints that external systems can call to trigger automations, check progress, and retrieve results.
Endpoint:
POST /start_automation
Description:
Starts a new Moodle automation task (summary, flashcards, or quiz generation).
Request Parameters (form-data / x-www-form-urlencoded):
| Parameter | Type | Required | Description |
|---|---|---|---|
course_name |
string | ✅ Yes | Name of the Moodle course |
subject_name |
string | ✅ Yes | Name of the subject within the course |
action_type |
string | ❌ No | Task type: "summary", "flashcards", "quiz" (default: "summary") |
ai_provider |
string | ❌ No | AI backend: "google" or "openai" (default: "google") |
Example Request (cURL):
curl -X POST http://localhost:8000/start_automation -d "course_name=Computer Science" -d "subject_name=AI Fundamentals" -d "action_type=summary" -d "ai_provider=openai"Example Response:
{
"message": "Started successfully"
}Endpoint:
GET /status
Description:
Returns the current state of the running (or last) automation task.
Example Request:
curl http://localhost:8000/statusExample Response:
{
"running": true,
"progress": 35,
"message": "Extracting PDF content...",
"result": null,
"error": null,
"action_type": "summary"
}Endpoint:
GET /result
Description:
Fetches the result of the last task.
- For
summary→ returns HTML rendered summary - For
flashcardsorquiz→ returns JSON content - If no result yet, redirects to
/
Example Request:
curl http://localhost:8000/result(Note: This returns rendered HTML — better accessed via browser or embedded in another system.)
Endpoint:
POST /reset
Description:
Resets the internal task state (useful for starting fresh).
Example Request:
curl -X POST http://localhost:8000/resetExample Response:
{
"message": "Data reset successfully"
}- Trigger a task →
POST /start_automation - Poll for progress every seconnd →
GET /status - Retrieve result →
GET /result - (Optional) Reset state →
POST /reset
-
Improve Agent's Memory
- Implement a more persistent memory layer (e.g., vector database or file-based context).
- Enable contextual recall across multiple runs.
-
Switch to Ollama's Python API
- Replace direct OpenAI calls with Ollama’s Python API.
-
Enhance Agentic Capabilities
- Add more tools (web search, file operations, scheduling).
- Support flexible tool orchestration (planning + execution).
-
Extend REST API
- Add endpoints for managing tasks, retrieving logs, and exporting results (JSON/PDF).
- Provide authentication (API keys, JWT, etc).
-
Deliver a Docker Image
- Create a production-ready Dockerfile.
- Publish prebuilt images to Docker Hub.
-
Maybe Switching to LangChain
- Compare current architecture with LangChain’s agents & memory.
- Prototype a LangChain integration for multi-tool workflows.