AI tools for teachers - prompt generator

Blocks ::: block_aipromptgen
Maintained by Boban Blagojević
AI Prompt Generator helps teachers create clear, structured prompts for AI tools directly from Moodle using course data (topics, resources, activities, competencies).

AI tools for teachers - prompt generator 0.1.1

Moodle 3.9, 3.10, 3.11, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5, 5.0
Released: 월요일, 18 8월 2025, 3:59 AM

AI for Teachers (Moodle block)

A block plugin that provides an AI prompt builder for teachers on a per‑course basis. Students cannot access it.

Compatibility - Moodle 4.3+ and 5.x (tested with Moodle 5). - Optional: Competencies (Learning plans) and Gradebook Outcomes.

Features - Visible only to roles with capability block/aipromptgen:manage (editing teachers/managers by default). - Per‑course prompt builder form with tooltips and Browse modals: - Subject (prefilled with course name on first load if empty) - Student age/grade - Teaching topic (area) + Browse (course sections) - Lesson title + Browse (sections/activities) - Class type: text input + Browse (common class types) - Outcomes/objectives: textarea + Browse (course competencies and, if enabled, gradebook outcomes; multi‑select) - Prompt language: text input + Browse (installed languages; stores hidden language code) - Prompt purpose: text input + Browse (e.g., lesson plan, quiz, rubric) - Audience: text input + Browse (teacher‑facing or student‑facing) - Generated prompt reflects the selected Prompt language. The visible language name is preserved and a single normalized code (e.g., sr_lt) is appended once: e.g., Serbian (sr_lt). - Block header can show a comma‑separated label of course Competencies/Outcomes when available. - No session‑based prefill: form does not restore previous session values. - Optional: "Send to ChatGPT" button that submits the generated prompt to OpenAI and displays the response (when configured with an API key).

Install 1. Place this folder under Moodle at blocks/aipromptgen. 2. Visit Site administration → Notifications to complete installation. 3. (Optional) Enable: - Competencies: Site administration → Advanced features → “Competencies”. - Outcomes: Site administration → Advanced features → “Enable outcomes”. Then link competencies to the course (Course → More → Competencies) and/or define local/global outcomes. 4. (Optional) Configure OpenAI integration (to enable "Send to ChatGPT"): - Site administration → Plugins → Blocks → AI for Teachers - Set the OpenAI API key and (optionally) the model (defaults to gpt-4o-mini).

Usage 1. Add the “AI for Teachers” block to a course page. 2. Click “Open AI Prompt Builder”. 3. Fill the fields (use Browse buttons for quick selection). 4. Click “Generate prompt” and copy or download the generated text. 5. (Optional) Click “Send to ChatGPT” to send the generated prompt and view the response inline (requires API key configuration).

Permissions - Capability: block/aipromptgen:manage (required to view the block and use the builder).

Notes - Competencies/Outcomes Browse: - If competencies are enabled and linked at course or activity level, they will appear in the modal. - If Gradebook Outcomes are enabled, local and global outcomes will be listed too. - Language field: - The visible field accepts a language name (with optional code in parentheses). A hidden languagecode is maintained automatically when using Browse. - The generated prompt honors the selected language and appends a single normalized code to the displayed name (e.g., Serbian (sr_lt)). If no meaningful code is available, (en) is only appended when the language is actually English. - Data cleaning/security: - All inputs have explicit $mform->setType(...) (e.g., PARAM_TEXT, PARAM_INT, PARAM_ALPHANUMEXT for codes). - Language string placeholders use single‑quoted strings in lang files to avoid premature interpolation. - Age/grade modal: - Choose an exact age or a range. The prompt formats this as 15 godina or 15-16 godina (localized wording can vary by language pack). - OpenAI integration: - When configured, pressing “Send to ChatGPT” sends the generated prompt to OpenAI and displays the AI response on the page. Ensure you have consent and comply with your institution’s data and privacy policies before sending any data to third‑party services.

Troubleshooting - “A required parameter (courseid) was missing”: - Open the builder from within a course or ensure the action URL includes courseid. The page also tries to infer it from cmid/id/current course. - Outcomes modal shows “None”: - Ensure Competencies and/or Outcomes are enabled. - Link competencies to the course or activities; define outcomes if needed. - Check role permissions to view competencies. - Language appears wrong in prompt: - Use the Browse list to set a known language and ensure the hidden languagecode is set. - Typed names are supported (with synonyms like “Serbian”), and the code is appended once. If you still see a mismatch, verify installed language packs and share the exact typed value to extend the mapping. - “Send to ChatGPT” button not visible: - Configure the OpenAI API key under Site administration → Plugins → Blocks → AI for Teachers, then reload the page.

Roadmap - Optional setting to “Force English output” regardless of selection. - Save user presets per course. - Integrations with external LLM providers (preview outputs). - Additional localized strings and templates

Version information

Version build number
2025081700
Version release name
0.1.1
Maturity
알파
MD5 Sum
573b907d01a0a3a829ed7d71a84c5899
Supported software
Moodle 3.9, Moodle 3.10, Moodle 3.11, Moodle 4.0, Moodle 4.1, Moodle 4.2, Moodle 4.3, Moodle 4.4, Moodle 4.5, Moodle 5.0

Version control information

Version control system (VCS)
GIT
VCS repository URL

Default installation instructions for plugins of the type Blocks

  1. Make sure you have all the required versions.
  2. Download and unpack the block folder.
  3. Place the folder (eg "myblock") in the "blocks" subdirectory.
  4. Visit http://yoursite.com/admin to complete the installation
  5. Turn editing on in any home or course page.
  6. Add the block to the page
  7. Visit the config link in the block for more options.