Tiny AI Prompt Generator (TinyMCE Plugin)

Moodle Plugin CI Moodle PHP License

Tiny AI Prompt Generator is a self-contained TinyMCE plugin for Moodle. It allows teachers to build pedagogical prompts through a guided interface and generate AI responses using OpenAI, Google Gemini, Anthropic Claude, DeepSeek, a local Ollama server, or any Custom OpenAI-compatible API, directly within the editor.

Features

Admin Tuning Controls

Related Plugins

If you prefer a side-block interface instead of an editor-integrated tool, check out:

Compatibility

Moodle Version Supported
Moodle 4.1 ✅
Moodle 4.2 ✅
Moodle 4.3 ✅
Moodle 4.4 ✅
Moodle 4.5 ✅
Moodle 5.0 ✅
Moodle 5.1 ✅
Moodle 5.2 ✅
Moodle 5.3 ✅

Minimum PHP Version: 8.1

Installation

  1. Download the plugin and place it in: lib/editor/tiny/plugins/aipromptgen
  2. Login to Moodle as an administrator.
  3. Navigate to Site administration → Notifications to complete the installation.
  4. Go to Site administration → Plugins → Text editors → TinyMCE editor → AI Prompt Generator to configure your API keys (OpenAI, Gemini, Claude) or Ollama endpoints.

Configuration

OpenAI Setup

  1. Obtain an API key from OpenAI.
  2. Enter your API key in the plugin settings.
  3. Choose your preferred model (default: gpt-5-mini).

Google Gemini Setup

  1. Obtain an API key from Google AI Studio.
  2. Enter your API key in the plugin settings.
  3. Choose your preferred model (default: gemini-3.8-flash).

Anthropic Claude Setup

  1. Obtain an API key from Anthropic Console.
  2. Enter your API key in the plugin settings.
  3. Choose your preferred model (default: claude-opus-5-5).

Ollama Setup (Local AI)

  1. Install Ollama on your server.
  2. Pull a model: ollama pull llama3
  3. Configure the endpoint in plugin settings (default: http://localhost:11434).
  4. Set the model name (e.g., llama3, mistral, phi3:mini).

DeepSeek Setup

  1. Obtain an API key from DeepSeek Platform.
  2. Enter your API key in the plugin settings.
  3. Choose your preferred model (default: deepseek-chat). Available models: deepseek-chat, deepseek-reasoner.

Custom API Setup (OpenAI-compatible)

  1. Enter the full URL of your custom endpoint in the plugin settings (e.g., http://localhost:1234/v1/chat/completions for LM Studio, or https://api.groq.com/openai/v1/chat/completions for Groq).
  2. Enter your API key (leave empty if the service does not require one).
  3. Enter the model name supported by your endpoint. Compatible services include: LM Studio, Groq, Together AI, OpenRouter, vLLM, Jan, and others.

Custom Templates (JSON)

You can define your own prompt templates that appear in the dropdown menu. Use placeholders like {subject}, {topic}, {lesson}, {audience}, {outcomes}.

Example 1: Simple JSON

[
  {
    "title": "Glossary",
    "prompt": "Create a list of 10 key terms for {subject}, topic: {topic}. Audience: {audience}."
  },
  {
    "title": "Quick Quiz",
    "prompt": "Create a multiple choice quiz (5 questions) for these outcomes: {outcomes}."
  }
]

Example 2: Complex JSON (Pedagogical Plan)

Use \n for new lines.

[
  {
    "title": "Detailed Lesson Plan",
    "prompt": "Write a 5E lesson plan for {subject}.\n\nTopic: {topic}\nOutcomes: {outcomes}"
  }
]

Prilagođeni šabloni (JSON) - Srpski

Možete definisati sopstvene šablone koji se pojavljuju u padajućem meniju. Koristite placeholder-e kao što su {subject}, {topic}, {lesson}, {audience}, {outcomes}.

Primer 1: Jednostavan JSON (Kopiraj ovo za testiranje)

Ovo uvodi tri nova šablona u padajući meni: Listu pojmova, Brzi kviz i Osnovu za debatu.

[
  {
    "title": "Glosar pojmova",
    "prompt": "Kreiraj listu od 10 ključnih pojmova i njihovih definicija za predmet {subject},
    a konkretno za temu: {topic}. Objašnjenja moraju biti prilagođena uzrastu: {audience}."
  },
  {
    "title": "Brzi test (Multiple Choice)",
    "prompt": "Napravi kratak test višestrukog izbora (5 pitanja, svako sa 4 ponuđena 
        odgovora i označenim tačnim rešenjem) koji pokriva 
        sledeće ishode učenja: {outcomes}."
  },
  {
    "title": "Tema za debatu",
    "prompt": "Na osnovu lekcije '{lesson}', osmisli jednu provokativnu tvrdnju za debatu
    u učionici. Napiši po tri jake teze 'ZA' i tri teze 'PROTIV'."
  }
]

💡 Primer 2: Napredni, kompleksni JSON (Kompletan pedagoški plan)

U ovom primeru prikazujemo kako se koristi \n za pravljenje novih redova unutar prompta kako bi instruisali AI da napravi kompleksniji dokument.

[
  {
    "title": "Detaljan plan časa (5ES model)",
    "prompt": "Kao stručnjak za metodiku nastave, napiši detaljan plan časa za predmet
        {subject} koristeći 5E model (Engage, Explore, Explain, Elaborate, Evaluate).\n\n
        Tema: {topic}\nLekcija: {lesson}\nUzrast: {audience}\nCiljevi: {outcomes}\n
        Tip časa: {style}\nJezik za generisanje: {language}\n\nPlan treba da sadrži
        vremensku raspodelu za čas od 45 minuta i konkretne instrukcije za svaku od 5E faza."
  },
  {
    "title": "Diferencirani zadaci (3 nivoa težine)",
    "prompt": "Kreiraj set vežbanja za temu '{topic}' (Lekcija: {lesson}), dizajniran za
        uzrast '{audience}'.\nZahtevam 3 zadatka:\n1. Osnovni nivo (reprodukcija znanja)\n
        2. Srednji nivo (primena na novom primeru)\n3. Napredni nivo (kritičko
        razmišljanje ili kreiranje nečeg novog)\n\nFokusiraj se pre svega na ostvarivanje
        ovog ishoda: {outcomes}"
  }
]

Šta se dešava u praksi?
Ako administrator kopira ovaj drugi primer u polje Predefined templates (JSON) i sačuva postavke, nastavnik će videti "Detaljan plan časa (5ES model)" u dropdown-u.

Ako nastavnik prethodno unese "Biologija" u polje Predmet i klikne na ovaj šablon, textarea za prompt će se trenutno osvežiti i {subject} će zameniti rečju "Biologija". Nastavnik onda samo pritisne "Send to AI" – štedeći sebi kucanje složenih struktura!

Usage

  1. Open the TinyMCE editor (e.g., in a Course Page, Page resource, or Assignment).
  2. Look for the AI Prompt Generator icon ( 🤖 ) in the toolbar.
  3. Fill in the prompt details (Subject, Audience, Outcomes, etc.).
  4. Select your preferred AI Provider and click Send to AI.
  5. View the streaming response and copy or use the generated content.

Permissions

The plugin uses the following capability:

Default roles with access: Manager, Course creator, Editing Teacher, Teacher.

Building from Source

If you modify the JavaScript source files, rebuild the AMD modules:

cd lib/editor/tiny/plugins/aipromptgen
grunt amd --force

Technical Requirements

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The plugin is a product of Erasmus project:
KA220-VET - Cooperation partnerships in vocational education and training
Project Title: AI tools for VET schools


© 2025 AI4Teachers | Boban Blagojević