AI Assistant
Configure and use the AI Assistant plugin for course and content generation.
AI Assistant Plugin
The AI Assistant plugin for Mentor LMS adds AI-powered tools for creating and editing courses, lessons, quizzes, and other content across your site.
If you have not installed the plugin yet, start with the Plugin Management Guide (upload ZIP, enable the plugin, run migration and seeder). Then return here to configure AI Assistant and use its features.
1. Introduction
The AI Assistant plugin connects your LMS to an external AI provider (OpenAI, Google Gemini, OpenRouter, Groq, or xAI). After you configure it once as an administrator, instructors can use these features:
| # | Feature | Where you use it |
|---|---|---|
| 1 | Create a course (full draft) | Course create page — one-shot generation with structure options |
| 2 | Update a course | Course edit page (basic information) |
| 3 | Create and edit sections | Course curriculum page |
| 4 | Create and edit Text Content lessons | Inside a section on the curriculum page |
| 5 | Create and edit section quizzes | Curriculum page — quizzes use that section’s current lessons |
| 6 | Create and edit FAQs, outcomes, and requirements | Course create (bulk) and course edit (per-row AI) |
| 7 | Generate a course thumbnail | Course create dialog or course edit → Media tab |
| 8 | Generate and update rich-text content | Any rich-text editor in the application |
Each instructor has a token allowance per period (daily, weekly, or monthly). Every AI request uses tokens from that allowance. Administrators are not limited by the token quota, but they still configure the provider and global limits for instructors.
Full course generation can use many tokens in one run (one call for the course outline, plus one call per text lesson when that option is enabled).
Detailed steps for each feature are in Section 3.
2. Configure AI Assistant (administrator)
Only administrators can open the configuration page. Instructors manage their own usage on a separate page (see Section 4).
Open the configuration page
- Make sure the AI Assistant plugin is enabled on Dashboard → Settings → Plugins.
- In the dashboard sidebar, open AI Assistant (admin menu).
- You will see AI Assistant Configuration with one settings card.
Settings explained
| Field | What it does |
|---|---|
| Tokens per instructor | Maximum AI tokens each instructor may use in one reset period (for example 100000). |
| Reset period | How often usage resets: Daily, Weekly, or Monthly. When the period ends, each instructor’s used tokens go back to zero up to this limit. |
| AI Provider | Which service powers all AI features (OpenAI, Google Gemini, OpenRouter, Groq, or xAI). |
| API Key | Secret key from your provider account. Required the first time you save. If a key is already stored, leave the field blank to keep it, or enter a new key to replace it. |
| Model | The model slug for the selected provider (choose from the dropdown). |
Supported providers (summary)
- OpenAI — API keys usually start with
sk-... - Google Gemini — API keys usually start with
AIza... - OpenRouter — Keys must start with
sk-or-v1-(create keys at openrouter.ai/keys) - Groq — API key from Groq console
- xAI (Grok) — API keys usually start with
xai-...
OpenRouter gives access to many models through one key. The configuration dropdown includes models such as:
openai/gpt-4o,openai/gpt-4o-minigoogle/gemini-2.0-flash-001,google/gemini-2.0-flash-lite-001anthropic/claude-sonnet-4.5mistralai/mistral-large-2411
Older OpenRouter slugs saved earlier (for example mistralai/mistral-large or deprecated Gemini/Claude names) are normalized automatically to a supported model id when the app runs AI requests.
Save configuration
- Fill in Tokens per instructor, Reset period, Provider, API Key (if not already saved), and Model.
- Click Save configuration.
- Wait for the green success message: Configuration saved successfully.
The Save button stays disabled until a provider, model, and API key (or an existing saved key) are present.
Tip: Create the API key in your provider’s dashboard first, then paste it here. Billing for AI usage is between you and the provider; the LMS only stores the key and tracks instructor token quotas.
Recommended setup order
- Install and enable the plugin (Plugin Management Guide)
- Run Migration and Seeder on the plugin card
- Open AI Assistant configuration and save provider + quota settings
- Ask instructors to check AI Assistant → Usage so they know their limit
3. Features and how to use them
AI controls appear only when the AI Assistant plugin is enabled. Most actions open a dialog: write a prompt (your instruction), submit, and the page reloads (or redirects) with the result. Messages appear at the top of the page after redirect.
Who can use what
| Role | Configuration | AI features | Token quota |
|---|---|---|---|
| Administrator | Yes | Yes | Not enforced (unlimited) |
| Instructor | No | Yes | Enforced per reset period |
| Student | No | No | — |
The subsections below follow the same order as the feature list in Section 1.
3.1 Create a course (course create page)
Page: Dashboard → Courses → Create New Course
Button: Generate with AI (top right of the page)
Dialog title: Generate Course with AI
What it does: Creates a new draft course in the database and redirects you to the course edit screen. It does not only fill the create form — the course is saved immediately as a draft with:
- Title, short description, and full HTML description
- Level and language
- Pricing fields when the AI infers them from your prompt (free/paid, discount, expiry)
- Sections (titles only)
- FAQs, requirements, and learning outcomes (counts you choose)
- Optional text lessons inside each section (when enabled)
- Optional thumbnail (when enabled)
Form fields
| Field | Required | Range / notes |
|---|---|---|
| Category | Yes | Same category combobox as manual create (parent category; child category when applicable) |
| Course language | Yes | All generated text (title, descriptions, sections, FAQs, outcomes, requirements, lessons) follows this language |
| Number of sections | Yes | 1–20 |
| Number of outcomes | Yes | 0–20 |
| Number of FAQs | Yes | 0–20 |
| Number of requirements | Yes | 0–20 |
| Your instructions | Yes | Topic, audience, goals, tone (minimum 10 characters) |
| Thumbnail generation | No | When on, generates a thumbnail after the course is created (uses the same provider when it supports images, e.g. OpenRouter) |
| Text lesson generation | No | When on, shows Text lessons per section (1–10). The AI creates that many text lessons per section, each with HTML body content based on the section title and your brief |
Steps
- Click Generate with AI.
- Select category and course language.
- Set section, FAQ, requirement, and outcome counts.
- Write your instructions (for example: “Create a beginner PHP OOP course”).
- Turn on Text lesson generation if you want lessons created automatically; set Text lessons per section.
- Optionally turn on Thumbnail generation.
- Click Generate with AI and wait. Generation can take up to a minute or more when many sections and lessons are requested (the server allows a longer timeout for this action).
- You are redirected to edit course with a success message. Open Curriculum and Info tabs to review sections, lessons, FAQs, outcomes, and requirements.
Token usage
- At least one AI call for the course structure.
- One additional call per text lesson when text lesson generation is enabled (for example 2 sections × 2 lessons = 4 extra calls).
- Thumbnail generation uses image tokens when enabled.
Partial success
- FAQs, requirements, and outcomes are saved before text lessons are generated.
- If lesson generation fails partway (quota, rate limit, or model error), you may still see the course with sections and Info content, plus an error or warning at the top. You can add remaining lessons manually with Text Content With AI on the curriculum page (Section 3.4).
Uses tokens from the instructor’s allowance (admins are exempt).
3.2 Update a course (course edit page)
Page: Open an existing course for editing
Tab: Basic
Button: Edit with AI
What it does: Updates the course title, short description, and full description from a single instruction. It does not change sections, lessons, or quizzes (those are managed on the curriculum page).
Steps:
- Go to Dashboard → Courses, open the course, and open the Basic tab.
- Click Edit with AI.
- Describe the changes (for example: “Shorten the title and make the description more beginner-friendly”).
- Submit. The basic fields refresh from the AI response.
3.3 Create and edit course sections (curriculum page)
Page: Edit a course → Curriculum
What it does:
- Create sections — Add sections with Add section as usual (no AI on create). AI does not build a section from scratch on the curriculum page alone.
- Edit a section title — Use AI to rename an existing section from the section actions menu.
Edit section title with AI
| Item | Detail |
|---|---|
| Where | Section row → open the section menu (⋯) → Update with AI |
| Steps | 1. Enter how the section title should change. 2. Submit. Only that section’s title is updated. |
3.4 Create and edit Text Content lessons (inside a section)
Page: Edit a course → Curriculum → inside a section
What it does:
- Create a new Text Content lesson with AI-generated HTML body.
- Edit an existing text lesson’s title and body with AI.
Create a Text Content lesson with AI
| Item | Detail |
|---|---|
| Where | Add lesson → choose lesson type Text Content With AI, or use the AI tab in the lesson dialog |
| Steps | 1. Optionally enter a lesson title (or leave blank for AI to suggest one). 2. Write instructions for the lesson content (topic, length, examples). 3. Set free or paid access if the form shows that option. 4. Generate. A text lesson is created with rich HTML content (same style as the course description editor). |
Edit an existing text lesson with AI
| Item | Detail |
|---|---|
| Where | Open an existing text lesson → Edit with AI in the lesson form |
| Steps | 1. Describe changes to the title and/or lesson body. 2. Submit. The lesson updates and the form reloads. |
3.5 Create and edit section quizzes (based on section lessons)
Page: Edit a course → Curriculum
What it does: Creates or updates a section quiz using content from that section’s current lessons (titles, summaries, and descriptions), so questions stay aligned with what students learn in the section.
Create a quiz with AI
| Item | Detail |
|---|---|
| Where | Section menu (⋯) → Quiz with AI |
| Requirement | The section must have at least one lesson |
| Steps | 1. Set how many single-choice, multiple-choice, and true/false questions to create (at least one in total). 2. Add optional instructions (difficulty, focus, tone). 3. Submit. The AI creates the quiz and its questions. |
Edit a quiz with AI
| Item | Detail |
|---|---|
| Where | On a quiz row in the curriculum, click the violet bot icon (Update quiz with AI) |
| Steps | 1. Describe what to change (add questions, rewrite wording, adjust marks, remove questions, and so on). 2. Submit. Open Quiz questions to review the updated quiz. |
3.6 FAQs, outcomes, and requirements
Two workflows:
A. Created automatically with “Generate Course with AI”
When you use Section 3.1, the system creates the number of FAQs, requirements, and outcomes you set in the dialog. Review them on the course edit page under the Info tab (and related areas).
B. Edit individual rows on an existing course
Page: Edit a course — FAQ, Outcomes, and Requirements areas
On the edit screen you add rows manually. AI edits the text of an existing row from your prompt (it does not create a new empty row by itself).
Each row has an AI button (bot icon). The flow is the same for all three types:
- Click AI on the FAQ, outcome, or requirement you want to change.
- Describe the update in the dialog.
- Submit. That row’s content is updated.
| Content type | What AI can change |
|---|---|
| FAQ | Question and/or answer |
| Learning outcome | Outcome text |
| Requirement | Requirement text |
3.7 Generate a course thumbnail
You can generate a thumbnail in two places:
During course creation
On Create New Course, open Generate with AI and enable Thumbnail generation before submitting. The thumbnail is attached to the new draft course when generation finishes.
On an existing course
Page: Edit a course → Media tab
Button: Generate with AI (on the thumbnail area)
Steps:
- Open the Media tab.
- Click Generate with AI.
- Describe the image (style, subject, mood — for example: “Clean flat illustration of online learning with blue tones”).
- Submit. The new thumbnail replaces or sets the course thumbnail.
Image generation counts toward token usage like text features.
3.8 Generate and update rich-text editor content (anywhere in the app)
Where: Any screen that uses the rich-text editor and shows Write with AI in the toolbar (for example course descriptions, blog content, or other long-form fields)
What it does: Generates HTML (or inserts content) inside the editor only. Nothing is saved to the database until you save the parent form yourself.
Steps:
- Open the field with the rich-text editor.
- Optionally select text first — the selection is sent as context for rewrites.
- Click Write with AI in the toolbar.
- Describe what to write or how to change the content.
- Click generate. The result appears in the editor; edit further if needed, then Save the form.
This feature is available across the application wherever that editor control is enabled, not only on course pages.
When an instructor runs out of tokens
If an instructor has used all tokens for the current period, further AI requests are blocked with a message that includes when the quota resets. They can still edit courses manually. Usage resets automatically at the start of the next daily, weekly, or monthly period (based on your configuration).
During full course generation, if the quota runs out while text lessons are being created, some lessons may be skipped and a warning may appear; the course, sections, and Info content are usually already saved.
4. View token limit and usage history (instructor)
Instructors (and roles that share the instructor menu entry) can monitor allowance without opening admin settings.
Open the usage page
- Confirm AI Assistant is enabled.
- In the dashboard sidebar, open AI Assistant (instructor menu — same name as admin, different page).
- The page title is AI Assistant Usage.
Summary cards
At the top you will see:
| Card | Meaning |
|---|---|
| Total token uses | Tokens consumed in the current period, with phrasing like “of {limit} this period”. |
| Remaining tokens | How many tokens are left before the limit is reached, and when the period resets (date and time). |
Token usage history table
Below the cards, Token usage history lists each AI request:
| Column | Meaning |
|---|---|
| Date | When the request ran |
| Feature | Which AI action was used (see labels below) |
| Model | AI model used for that request |
| Tokens | Tokens charged for that request |
Feature labels you may see include:
| Label | Typical action |
|---|---|
| Generate course | Full course generation from the create page |
| Edit course | Basic tab Edit with AI |
| Generate thumbnail | Course thumbnail image |
| Edit section | Section title Update with AI |
| Edit FAQ / Edit outcome / Edit requirement | Per-row AI on the edit course page |
| Generate quiz / Refine quiz | Section quiz create or update |
| Generate text lesson / Edit text lesson | Lesson create or edit with AI |
| Generate content | Write with AI in a rich-text editor |
You can search and sort the table and change page size (10, 15, 20, or 25 rows per page).
Note: Administrators do not see token limits applied to their own requests, but they configure limits and can use all AI features without quota blocking.