A Lesson is a timed, scored practice session drawn from a pool of typed quiz questions. Sealearn’s adaptive engine analyses each user’s weekly activity, current streak, and recent scores before every session and dynamically chooses the number of questions, the difficulty mix, and the XP multiplier. This means no two sessions feel identical, and the challenge scales automatically with the learner’s performance.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/DerBasilisk/SEA-ServicioEvaluaconAsistida/llms.txt
Use this file to discover all available pages before exploring further.
Lesson types
| Type | Description |
|---|---|
lesson | Standard lesson with a hand-curated or AI-supplemented question pool. |
checkpoint | End-of-unit evaluation with a harder question mix. |
review | Spaced-repetition replay triggered when a previous completion is due for review. |
ai_generated | Questions are generated fresh by the AI each time the lesson is started, using the subject and lesson context. |
Lesson model fields
unit, must be unique.lesson, checkpoint, review, ai_generated. Defaults to lesson.10. The adaptive engine multiplies this before crediting the user.0. Perfect scores (100%) add an extra 5 gems on top.5.null means no limit. Defaults to null.easy, medium, or hard. The adaptive engine may shift this up or down by one level depending on the user’s activity score.true.Adaptive engine
When a user starts a lesson,getAdaptiveConfig computes an activity score (0–100) from three signals:
| Signal | Weight | How it is measured |
|---|---|---|
| Lessons completed in the last 7 days | 40% | Up to 14 lessons/week maps linearly to 100. |
| Current streak | 30% | Up to 30 days maps linearly to 100. |
| Average score of last 10 completions | 30% | Raw percentage (0–100). Defaults to 50 when no history exists. |
activityScore drives three adaptive parameters:
| Activity score | questionCount | difficulty | easyRatio / hardRatio |
|---|---|---|---|
| 0–30 (low activity) | 5–8 | Escalated one level above base | 20% easy / 50% hard |
| 31–60 (moderate) | 9–13 | Base difficulty unchanged | 33% easy / 33% hard |
| 61–100 (high activity) | 14–18 | Lowered one level below base | 50% easy / 20% hard |
questionCount is always clamped between 5 and 18.
Endpoints
GET /api/lessons/review
Returns up to 10 completed lessons that are due for spaced-repetition review today (i.e. theirspacedRepetition.nextReviewDate is on or before the current date).
Authentication: Bearer token required.
true on success.GET /api/lessons/:id
Returns a single active lesson populated with its parent unit and the unit’s parent subject (name, color, icon). Also includes the requesting user’s current status, best score, and completion count for that lesson. Authentication: Bearer token required. Path parameterstrue on success.POST /api/lessons/:id/start
Triggers the adaptive engine, selects (or generates) questions, records a new in-progress session, and returns everything the client needs to render the lesson UI: the question list, AI-generated theory slides, and the adaptive configuration used. Forlesson type, if the question pool is smaller than the adaptive questionCount, the API automatically calls the AI to generate the missing questions and saves them for future use before proceeding.
Authentication: Bearer token required. The user must have at least 1 heart remaining.
Path parameters
true on success.multiple_choice questions the options array is shuffled randomly before being sent. For order_items the array is exposed as shuffledItems (correct order removed). For match_pairs the pairs are split into leftItems and rightItems, each independently shuffled. For sentence_builder the wordBank is shuffled.Question answer formats
Each question object in thequestions array has a type field. Use the correct answer shape when calling POST /api/lessons/:id/answer.
multiple_choice — select one option by ID
multiple_choice — select one option by ID
[{ _id, text }, ...] (shuffled). Submit the _id of the option you believe is correct.true_false — submit a boolean
true_false — submit a boolean
true or false). String values "true" and "false" are also accepted and coerced automatically.fill_blank — submit a string
fill_blank — submit a string
order_items — submit items in the correct sequence
order_items — submit items in the correct sequence
shuffledItems array of strings. Submit those same strings in the order you believe is correct.match_pairs — submit left-to-right pair mappings
match_pairs — submit left-to-right pair mappings
leftItems and rightItems, each as [{ _id, text }] arrays (shuffled independently). Both arrays are derived from the same underlying pair documents, so a left item and its matching right item share the same _id. Submit an array of { leftId, rightId } objects where you set leftId to a left item’s _id and rightId to the _id of the right item you believe it matches. A submission is correct when every leftId equals its corresponding rightId (i.e. they originate from the same pair).sentence_builder — reconstruct a sentence from a word bank
sentence_builder — reconstruct a sentence from a word bank
wordBank array of strings. Submit the words in the correct order as an array of strings.free_text — open-ended answer evaluated by AI
free_text — open-ended answer evaluated by AI
evaluationCriteria and maxScore. The response shape differs from other types — see the POST /api/lessons/:id/answer response section.typing — exact text reproduction
typing — exact text reproduction
code_python — Python code evaluated against test cases
code_python — Python code evaluated against test cases
POST /api/lessons/:id/answer
Submits one answer and returns whether it was correct, the explanation, and the XP earned for that question. An incorrect answer deducts one heart for every question type exceptfree_text, which is AI-evaluated and never penalises hearts. typing and code_python handle heart deduction inside their own response branch but follow the same rule.
Authentication: Bearer token required.
Path parameters
true, XP earned for a correct answer is halved (xpValue * 0.5).typing questions. Stored alongside the attempt record.free_text)
true on success.free_text response
true on success.code_python response
true on success.POST /api/lessons/:id/complete
Marks the current in-progress session as completed, calculates the final score, awards adaptive XP and gems, updates the user’s streak, adds XP to the weekly league, unlocks the next lesson if eligibility criteria are met, and checks for new achievement unlocks. Authentication: Bearer token required. An active in-progress session must exist for this lesson. Path parameterstrue on success.POST /api/lessons/:id/abandon
Abandons an in-progress session. The lesson’s status is reset toavailable and the current session attempts are cleared. No XP is awarded and no hearts are penalised.
Authentication: Bearer token required.
Path parameters