AI Features
Use AI to generate lessons, exercises, translations, and get writing assistance.
The Lex Editor integrates AI-powered tools that dramatically speed up lesson creation. From generating an entire lesson from a topic description to auto-completing sentences as you type, AI is available throughout the editing experience.
Overview of AI Tools
| Tool | What It Does | How to Access |
|---|---|---|
| AI Lesson Builder | Generates a complete lesson with exercises from a topic | Course page > "Generate with AI" or toolbar |
| Ask AI | Inline AI assistant for writing and editing help | Toolbar button or /askai |
| AI Autocomplete | Suggests text completions as you type | Automatic (appears inline) |
| Exercise Generation | Creates exercises from lesson context | Exercise block configuration |
| Translation Tool | Translates selected text between languages | Select text > Translate button |
AI Lesson Builder
The lesson builder is the most powerful AI feature. It generates a complete, structured lesson from a topic, target language, and CEFR level.
How It Works
The generation follows a two-phase process for high-quality, coherent output:
- Planning phase -- the AI creates a lesson plan with a storyline, key vocabulary, grammar focus, and section briefs. This ensures all parts of the lesson connect thematically.
- Section generation -- each lesson section (warm-up, vocabulary, theory, exercises, reading, summary) is generated in parallel using the shared plan as context.
This two-phase approach means that vocabulary introduced early in the lesson reappears in exercises later, and the grammar explanations connect to the practice activities.
Step-by-Step: Generating a Lesson
Access the Generator
From a course page: Click Add Lesson and select Generate with AI.
From the editor: Click the AI Generate button in the toolbar.
Define Your Lesson
Fill in the required information:
- Topic -- be specific (e.g., "Present Perfect with already/yet/just" rather than just "grammar")
- Target language -- the language being taught
- CEFR level -- A1 through C2
- Lesson format -- class (with teacher), homework, self-study, or test
Configure Sections
The lesson template defines which sections to include. Each section can be enabled or disabled:
- Warm-up -- conversation starters, flashcards, icebreakers
- Vocabulary -- new words with translations and examples
- Theory -- grammar explanations with rules and tables
- Exercises -- interactive practice with mixed widget types
- Reading -- text passage with comprehension questions
- Listening -- audio with comprehension questions (TTS-generated)
- Speaking -- speech recording tasks
- Writing -- essay prompts with AI-assisted evaluation
- Image -- describe-the-picture activities (with AI-generated images)
- Summary -- key points review and mini-quiz
- Brain breaks -- roulette, drawing, breathing timer
Set Exercise Preferences
For the exercises section, configure:
- Exercise count -- 3 to 20 exercises
- Exercise types -- which widget types to include (fill-in-blank, multiple choice, matching, ordering, sentence builder, true/false)
- Difficulty calibration -- match level exactly, slightly below, or slightly above
- Distractors -- include extra wrong options in matching and sentence builder widgets
Provide Optional Context
- Student background -- prior knowledge, specific challenges
- Content preferences -- themes, professional context, cultural references
- Notes -- any additional instructions for the AI
Generate
Click Generate Lesson. The process takes 30-60 seconds. A progress indicator shows which sections are being generated.
Review and Customize
The generated lesson appears in the editor, fully editable. Review it for:
- Content accuracy
- Level appropriateness
- Exercise quality
- Cultural sensitivity
After Generation
The generated lesson is a starting point. We strongly recommend:
- Adding your personal teaching voice -- include tips, anecdotes, and examples from your experience
- Adding media -- insert images, audio recordings, or video that you have prepared
- Adjusting exercises -- modify questions, add or remove options, tune difficulty
- Checking accuracy -- AI can make mistakes, especially with advanced grammar rules or cultural nuances
- Testing all widgets -- click through every exercise as a student would
Always review AI-generated content before publishing. The AI produces high-quality drafts, but it can occasionally make factual errors, generate awkward phrasing, or miss cultural nuances. Your expertise makes the final lesson great.
Section-by-Section Regeneration
You do not need to regenerate the entire lesson if one section is not right. You can:
- Regenerate a single section -- keep the sections you like and regenerate only the problematic one
- Modify parameters and regenerate -- change the exercise type mix or word count and try again
- Edit manually instead -- for small adjustments, editing is faster than regenerating
Ask AI Assistant
The Ask AI tool is an inline assistant that helps with writing and editing tasks directly in the editor.
How to Use It
- Click the Ask AI button in the toolbar, or type
/askai - A prompt input appears where you can type your request
- The AI generates content and inserts it at the cursor position
Example Prompts
- "Write 5 example sentences using the present perfect tense"
- "Create a dialogue between two people ordering food at a restaurant"
- "Explain the difference between 'since' and 'for' at B1 level"
- "Generate a vocabulary list of 10 travel-related words with definitions"
- "Write a short story using these vocabulary words: adventure, mysterious, discover"
The Ask AI tool understands the context of your lesson and generates content that fits the current topic and level.
AI Autocomplete
As you type in the editor, the AI may suggest text completions. These appear as grayed-out text after your cursor.
- Accept the suggestion -- press
Tabto insert the suggested text - Ignore -- keep typing to dismiss the suggestion
- Partial accept -- press
Tabonce for one word, or keep pressing for more
Autocomplete is context-aware. It considers the text you have already written, the lesson topic, and the target language level.
Autocomplete works best when you have written a few sentences to establish context. It is most useful for generating example sentences, extending explanations, and completing repetitive patterns.
Exercise Generation from Context
The AI can generate exercises automatically from your lesson content:
- Write or generate a text passage, grammar explanation, or vocabulary section
- In the exercise block configuration, choose "Generate exercises from context"
- The AI analyzes your content and creates relevant exercises:
- Fill-in-the-blank questions based on grammar patterns in the text
- Multiple choice questions based on vocabulary
- Matching exercises from vocabulary tables
- True/false statements about the reading passage
- Comprehension questions
This is especially useful after a reading passage or grammar theory section -- the exercises directly test what was just taught.
Translation Tool
The translation tool lets you quickly translate text between languages.
How to Use It
- Select the text you want to translate
- Click the Translate button in the floating toolbar (or right-click menu)
- Choose the target language
- The translation appears -- you can insert it, copy it, or dismiss it
Use Cases
- Quickly translate vocabulary words for bilingual lessons
- Create side-by-side translation comparisons
- Verify your own translations
- Generate translations for matching exercises
Lesson Analysis
Beyond content creation, AI is also used to analyze student performance on completed lessons. This feature is accessed from the enrollment page rather than the editor.
What It Does
The AI examines a student's answers across all exercises in a completed lesson — fill-in-the-blank, multiple choice, matching, ordering, true/false, sentence builder, speech exercises, and essays. It produces a structured report with:
- Performance summary and exercise-by-exercise breakdown
- Error pattern identification — recurring mistakes across exercise types
- Strengths and weaknesses assessment
- Essay feedback with quality rating (if applicable)
- Follow-up recommendations — suggested topics, focus skills, and exercises
Reports are written in the student's target language.
How to Use It
- Go to the student's enrollment page
- Find a completed lesson (status: Passed or Verified)
- Click the brain icon — a confirmation dialog shows the cost
- The analysis runs asynchronously via Celery and a notification arrives when it finishes
- Click the yellow brain icon to view the report in a side panel
A bulk analysis option analyzes the 20 most recent lessons in a single request.
See Lesson Analysis for more details.
How AI Costs Work
AI features use tokens from your account balance.
| Action | Approximate Cost |
|---|---|
| Full lesson generation | ~100 tokens |
| Additional exercises (per 10) | ~25 tokens |
| Ask AI request | Varies |
| Translation | Varies |
| Lesson analysis (single) | Varies |
| Lesson analysis (bulk, 20 lessons) | Varies |
Managing Your Token Budget
- Purchase tokens in the Billing section
- Track usage in your billing dashboard
- Optimize usage by planning before generating -- a specific, detailed prompt produces better results on the first try, reducing the need for regeneration
- Customize rather than regenerate -- for small adjustments, manual editing is free and faster
A typical lesson generation costs approximately 100 tokens (~$1). Given that manual lesson creation takes 2-4 hours, the ROI is significant for teachers who create content regularly.
Best Practices for AI-Assisted Lesson Creation
Getting the Best Results
- Be specific with your topic. "German dative case with definite articles" produces better results than "German grammar."
- Provide student context. If the student struggles with verb aspect or has a specific native language, mention it. The AI adapts accordingly.
- Use the hybrid approach. Let AI generate the structure and exercises, then add your personal expertise, examples, and teaching tips.
- Iterate. Treat the first generation as a draft. Review, customize, and regenerate sections as needed.
When to Use AI vs. Manual Creation
AI is ideal for:
- Creating initial lesson drafts
- Generating exercise sets quickly
- Building vocabulary tables with translations
- Rapid prototyping of new lesson ideas
- Adapting existing content to different levels
Create manually when:
- Content requires highly specialized domain knowledge
- Specific institutional formatting is required
- You need complex interactive elements that AI cannot generate
- Topics are sensitive or culturally nuanced
- Personal anecdotes or experiences are the core content
Frequently Asked Questions
Can AI generate content in any language?
The AI supports major world languages. Quality is highest for widely spoken languages (English, Spanish, French, German, Polish, Russian, etc.) and may be lower for less common languages.
Can I use AI to generate homework from a class lesson?
Yes. Use the section-by-section generation to create exercise sets based on topics you covered in class. You can also generate a full homework lesson using the same topic and vocabulary.
How accurate is AI-generated content?
Quality is generally high for A1-B2 content and common grammar topics. Advanced topics (C1-C2) and specialized domains may require more careful review. Always verify accuracy before publishing.
Can AI create audio content?
Yes. Listening sections can be generated with TTS (text-to-speech). The AI writes a dialogue or monologue script, and the TTS engine converts it to audio with configurable voices, emotional tags, and natural pacing.
Can the AI generate images?
Yes. Image sections can include AI-generated images (realistic scenes or memes) using models like Flux or DALL-E 3. The images are created during the asset pipeline phase and stored with your lesson.
