Open-source browser extension that helps you work through Moodle quiz questions using your own AI API keys. It reads the on-page question (and optional images), calls the provider you configure, and shows a discreet answer under the options.
Browser support: moodleAI has been tested only on Firefox (temporary add-on /
about:debugging). Other Chromium browsers may work because the project uses Manifest V2 APIs, but they are not officially verified.
| Feature | Description |
|---|---|
| Multi-provider AI | Groq, OpenAI, Claude (Anthropic), Grok (xAI), DeepSeek, Google Gemini |
| Your keys only | API keys stay in local extension storage — no accounts or relay server required |
| Free-tier path | Groq is the recommended free / low-cost route |
| Vision support | Image questions via canvas capture or cropped tab screenshot |
| Discreet UI | Answers render at near-invisible gray opacity; toggle with " |
| Solve modes | Automatic (default): detect & solve · Manual: solve only on a configurable hotkey |
| Theme selectors | Default Moodle .qtext / .ablock · presets + fully custom CSS for university themes |
| Subject profiles | Java, Databases, Algorithms, Networks, Unified, or a custom system prompt |
| Pixel settings popup | Dark monochrome HUD to configure provider, models, and prompts |
A quick walkthrough of moodleAI:
example.mp4
If you want to try moodleAI without paid API bills, use Groq:
- Create a free account at console.groq.com
- Generate an API key under API Keys
- In the extension popup, set Provider → Groq, paste the key, and save
Groq offers a generous free tier with fast inference. For questions that include images, pick a vision-capable model in the popup (e.g. Llama 4 Scout). Rate limits and model availability depend on Groq’s current free-tier policy — check their console for the latest limits.
| Goal | Suggested setup |
|---|---|
| Free / cheapest to start | Groq + free API key |
| Strongest general quality | OpenAI / Claude / Gemini (paid) |
| Text-only budget alternative | DeepSeek (no vision in this extension) |
End-to-end flow when you open a Moodle quiz attempt:
┌─────────────────────────────────────────────────────────────────┐
│ Moodle page (.qtext / .ablock) │
│ │
│ 1. Content script polls for a new question │
│ 2. Parse text, MC options, dropdowns │
│ 3. If image present → smart capture │
│ • Prefer: draw <img> to canvas │
│ • Fallback: tab screenshot cropped to question region │
│ 4. Background script calls your chosen AI API │
│ (avoids page CORS; key never leaves your browser) │
│ 5. Inject answer under options as gray text (opacity: 0.1) │
│ 6. Press " to hide/show the answer │
└─────────────────────────────────────────────────────────────────┘
| Step | Behavior |
|---|---|
| Question loads | Extension detects Moodle markup (.qtext) |
| Solve | Auto (default): runs after detection · Manual: wait for solve hotkey (default Ctrl+Shift+S, changeable in popup) |
| Processing | Request goes to the provider selected in settings |
| Answer ready | Appended under the options block as near-invisible gray (opacity: 0.1) |
| Toggle | Press " (quote key) to switch between 0.1 and fully hidden (0) |
The answer style is intentional: readable if you know where to look, easy to hide during a glance.
src/popup/ → configure provider, key, models, prompt
src/content/ → detect question, capture image, show answer
src/background.js → screenshot + proxy API calls
src/shared/ → providers, prompts, storage helpers
Built output lands in dist/ (content, popup, background bundles).
- Firefox (tested browser)
- Node.js 18+ and npm
- An API key (start with Groq for free tier)
git clone https://github.com/YOUR_USERNAME/moodleai.git
cd moodleai
npm install
npm run build- Open
about:debugging#/runtime/this-firefox - Click Load Temporary Add-on…
- Select this project’s
manifest.json
Temporary add-ons in Firefox are cleared when the browser restarts. Reload the add-on (or use a development workflow) after each restart while developing.
- Click the moodleAI toolbar icon
- Turn the extension ON
- Choose a provider (use Groq for free tier)
- Paste your API key
- Select text and vision models
- Pick a subject profile or edit the system prompt
- Choose Solve mode: Automatic (default) or Manual
- Optionally set a custom solve hotkey (default
Ctrl+Shift+S) - If questions are not detected, open THEME_SELECTORS — keep Standard Moodle (
.qtext/.ablock) or pick a preset / enter custom CSS for your university - Click
[ SAVE_SETTINGS ]
- Open a Moodle quiz attempt that uses standard question markup
- Automatic mode: wait a few seconds after the question appears
Manual mode: press your solve hotkey (defaultCtrl+Shift+S) - Look under the options for the faint gray answer
- Press
"to hide or show it - The solve hotkey also re-solves the current question in either mode
# After build + load extension, open in Firefox:
# test/demo.html (Moodle-like markup for dry runs)| Provider | Vision | Notes |
|---|---|---|
| Groq | Yes | Recommended free tier; fast Llama models |
| OpenAI | Yes | gpt-4o / gpt-4o-mini |
| Claude (Anthropic) | Yes | Anthropic Messages API |
| Grok (xAI) | Yes | OpenAI-compatible API |
| DeepSeek | Yes | Vision and Text |
| Google Gemini | Yes | AI Studio API keys |
Keys are stored only in local extension storage on your machine. Requests go directly from the extension to the provider — there is no moodleAI backend holding your key.
moodleai/
├── manifest.json # Extension manifest (MV2)
├── package.json
├── webpack.config.js
├── README.md
├── src/
│ ├── background.js # Screenshots + AI request proxy
│ ├── content/ # Page script (parse, capture, display)
│ ├── popup/ # Settings UI (HTML / CSS / JS + fonts)
│ ├── shared/ # Providers, prompts, storage
│ └── server/ # Optional local OCR / image helper
├── dist/ # Generated bundles (npm run build)
└── test/
└── demo.html # Local Moodle-like fixture
| Command | Description |
|---|---|
npm run build |
Production build (content script lightly obfuscated) |
npm run build:dev |
Development build with source maps |
npm run build:watch |
Rebuild on file changes |
npm run server |
Optional local helper (localhost:3000) |
npm run dev |
Dev build + helper server |
Not required for normal use. Useful for local OCR experiments or CORS-bypassing image fetch:
npm run server| Endpoint | Description |
|---|---|
POST /api/ocr |
OCR an uploaded image |
GET /api/ocr?imageUrl= |
OCR a remote image URL |
GET /api/image-to-base64?url= |
Return image as a data URL |
- API keys are never committed to this repository — use the popup only
- Keys live in browser local storage for the current profile
- Network traffic goes to the AI provider you selected, not a third-party moodleAI server
- If you fork or publish builds, rotate any keys that ever appeared in git history
This project is published for education, research, and personal tooling. Using automated assistance during graded assessments may violate your institution’s academic integrity policy. You are responsible for how you use the software.
Contributions are welcome.
- Fork the repository
- Create a branch (
feature/…orfix/…) - Run
npm run buildand smoke-test on Firefox - Open a pull request with a clear description of the change
Please avoid committing secrets, personal API keys, or environment files.
- Broader browser testing (Chrome / Edge permanent install flow)
- Manifest V3 migration
- Additional providers or models
- Improved Moodle theme / DOM selectors
- Accessibility and localization
ISC — free to use, modify, and distribute. See package metadata for details.
moodleAI is provided as is, without warranty. Provider APIs, free-tier limits, and Moodle page structure can change without notice. Firefox is the only browser used for testing at the time of this release.