Mentor LMS Docs
Plugins Management

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:

#FeatureWhere you use it
1Create a course (full draft)Course create page — one-shot generation with structure options
2Update a courseCourse edit page (basic information)
3Create and edit sectionsCourse curriculum page
4Create and edit Text Content lessonsInside a section on the curriculum page
5Create and edit section quizzesCurriculum page — quizzes use that section’s current lessons
6Create and edit FAQs, outcomes, and requirementsCourse create (bulk) and course edit (per-row AI)
7Generate a course thumbnailCourse create dialog or course editMedia tab
8Generate and update rich-text contentAny 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

  1. Make sure the AI Assistant plugin is enabled on Dashboard → Settings → Plugins.
  2. In the dashboard sidebar, open AI Assistant (admin menu).
  3. You will see AI Assistant Configuration with one settings card.

Settings explained

FieldWhat it does
Tokens per instructorMaximum AI tokens each instructor may use in one reset period (for example 100000).
Reset periodHow 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 ProviderWhich service powers all AI features (OpenAI, Google Gemini, OpenRouter, Groq, or xAI).
API KeySecret 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.
ModelThe 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-mini
  • google/gemini-2.0-flash-001, google/gemini-2.0-flash-lite-001
  • anthropic/claude-sonnet-4.5
  • mistralai/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

  1. Fill in Tokens per instructor, Reset period, Provider, API Key (if not already saved), and Model.
  2. Click Save configuration.
  3. 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.

  1. Install and enable the plugin (Plugin Management Guide)
  2. Run Migration and Seeder on the plugin card
  3. Open AI Assistant configuration and save provider + quota settings
  4. 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

RoleConfigurationAI featuresToken quota
AdministratorYesYesNot enforced (unlimited)
InstructorNoYesEnforced per reset period
StudentNoNo

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

FieldRequiredRange / notes
CategoryYesSame category combobox as manual create (parent category; child category when applicable)
Course languageYesAll generated text (title, descriptions, sections, FAQs, outcomes, requirements, lessons) follows this language
Number of sectionsYes1–20
Number of outcomesYes0–20
Number of FAQsYes0–20
Number of requirementsYes0–20
Your instructionsYesTopic, audience, goals, tone (minimum 10 characters)
Thumbnail generationNoWhen on, generates a thumbnail after the course is created (uses the same provider when it supports images, e.g. OpenRouter)
Text lesson generationNoWhen 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

  1. Click Generate with AI.
  2. Select category and course language.
  3. Set section, FAQ, requirement, and outcome counts.
  4. Write your instructions (for example: “Create a beginner PHP OOP course”).
  5. Turn on Text lesson generation if you want lessons created automatically; set Text lessons per section.
  6. Optionally turn on Thumbnail generation.
  7. 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).
  8. 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:

  1. Go to Dashboard → Courses, open the course, and open the Basic tab.
  2. Click Edit with AI.
  3. Describe the changes (for example: “Shorten the title and make the description more beginner-friendly”).
  4. 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

ItemDetail
WhereSection row → open the section menu (⋯) → Update with AI
Steps1. 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

ItemDetail
WhereAdd lesson → choose lesson type Text Content With AI, or use the AI tab in the lesson dialog
Steps1. 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

ItemDetail
WhereOpen an existing text lesson → Edit with AI in the lesson form
Steps1. 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

ItemDetail
WhereSection menu (⋯) → Quiz with AI
RequirementThe section must have at least one lesson
Steps1. 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

ItemDetail
WhereOn a quiz row in the curriculum, click the violet bot icon (Update quiz with AI)
Steps1. 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:

  1. Click AI on the FAQ, outcome, or requirement you want to change.
  2. Describe the update in the dialog.
  3. Submit. That row’s content is updated.
Content typeWhat AI can change
FAQQuestion and/or answer
Learning outcomeOutcome text
RequirementRequirement 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:

  1. Open the Media tab.
  2. Click Generate with AI.
  3. Describe the image (style, subject, mood — for example: “Clean flat illustration of online learning with blue tones”).
  4. 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:

  1. Open the field with the rich-text editor.
  2. Optionally select text first — the selection is sent as context for rewrites.
  3. Click Write with AI in the toolbar.
  4. Describe what to write or how to change the content.
  5. 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

  1. Confirm AI Assistant is enabled.
  2. In the dashboard sidebar, open AI Assistant (instructor menu — same name as admin, different page).
  3. The page title is AI Assistant Usage.

Summary cards

At the top you will see:

CardMeaning
Total token usesTokens consumed in the current period, with phrasing like “of {limit} this period”.
Remaining tokensHow 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:

ColumnMeaning
DateWhen the request ran
FeatureWhich AI action was used (see labels below)
ModelAI model used for that request
TokensTokens charged for that request

Feature labels you may see include:

LabelTypical action
Generate courseFull course generation from the create page
Edit courseBasic tab Edit with AI
Generate thumbnailCourse thumbnail image
Edit sectionSection title Update with AI
Edit FAQ / Edit outcome / Edit requirementPer-row AI on the edit course page
Generate quiz / Refine quizSection quiz create or update
Generate text lesson / Edit text lessonLesson create or edit with AI
Generate contentWrite 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.


On this page