The practice recommender selects the next exercise that maximises diagnostic value for each student’s current ability level, using Item Response Theory 2-Parameter Logistic (2PL) and Fisher information. Rather than cycling through exercises in a fixed order, the engine finds the single item that is most informative given what BKT already knows about the student — the exercise that is neither too easy nor too hard, sitting right at the boundary of the student’s competence.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/vruizz22/innova-backend-serverless/llms.txt
Use this file to discover all available pages before exploring further.
IRT 2PL Model
Item Response Theory models the probability that a student with ability θ answers a given item correctly. The 2PL model gives each exercise two parameters:- a (
irtA) — discrimination: how sharply the item distinguishes students just above and just below its difficulty. Higherameans a steeper sigmoid curve. - b (
irtB) — difficulty: the ability level at which a student has a 50% chance of answering correctly. Positivebmeans a harder item.
irtA = 1.0 and irtB = 0.0 (average discrimination, average difficulty) and are refined nightly as response data accumulates.
Fisher Information
Fisher informationI(θ) quantifies how much an item at difficulty b reduces uncertainty about a student at ability θ. The 2PL Fisher information formula is:
P(θ) · (1 - P(θ)) is maximised when P(θ) = 0.5, i.e. when the item is exactly at the student’s ability level. The recommender therefore targets items where the student has roughly a 50% chance of success — challenging enough to be diagnostic, accessible enough not to be demoralising.
The PracticeService implements this directly:
I(θ):
θ Estimation from BKT
The student’s ability estimate θ is derived from BKT’spKnown via the logit transform:
pKnown is clamped to [0.05, 0.95] before the transform to avoid ±∞. The mapping is intuitive:
| pKnown | θ (approx.) | Interpretation |
|---|---|---|
| 0.05 | −2.94 | Very low mastery |
| 0.30 | −0.85 | BKT prior (no data yet) |
| 0.50 | 0.00 | Average mastery |
| 0.75 | +1.10 | High mastery |
| 0.95 | +2.94 | Near mastery ceiling |
pKnown = 0.30 (the BKT prior), which maps to θ ≈ −0.85 — steering the recommender toward slightly-below-average difficulty items, appropriate for an unobserved topic.
API Endpoints
Recommend next exercise
GET /practice/recommend-next?studentId=...&domainId=...Returns the single highest-Fisher-information exercise for the student. The optional domainId scopes the search to one domain’s exercises. The response includes the exercise id, problem text, irtA, irtB, student theta, and a human-readable reasoning string.Course-scoped recommendation
GET /mastery/recommend/:courseId/:studentIdFinds the student’s weakest topic (lowest pKnown) within the course, converts to θ, and returns the best-fit exercise — excluding exercises the student answered correctly in the past 7 days.Manual assignment
POST /practice/assign with body { studentId, itemIds, dueAt }Creates an assignment from a teacher-specified list of exercise IDs. IRT parameters are not used here — the teacher has already selected the items.Nightly Calibration
IRT parameters (irtA, irtB) start at default values and improve over time. The innova-ai-engine service runs a nightly calibration job that:
- Aggregates all
Attemptrecords for each exercise. - Fits new
aandbvalues using a 2PL marginal maximum likelihood estimator. - Writes the updated values back to the
Exercisetable in Postgres.
recommendNext call, the updated parameters are used automatically. Topics or exercises with fewer than ~30 responses are skipped and retain their defaults until sufficient data accumulates.
Assignment Creation
Teachers can create assignments in two ways:- Recommendation-driven — call
GET /practice/recommend-next?studentId=...to retrieve the exercise with maximum Fisher information, then pass the returned exercise ID toPOST /practice/assign. The IRT-selected exercise is ready to assign immediately. - Manual with IRT context — use
POST /practice/assignwith a{ studentId, itemIds, dueAt }body to create an assignment from a hand-picked list. The IRT parameters on those exercises are still used for future recommendations.
BKT and IRT are complementary models, not alternatives. BKT tracks whether the student knows a topic (the hidden state
pKnown). IRT describes how informative a specific item is at a specific ability level. The practice recommender uses BKT output (pKnown → θ) as the input to the IRT item selector (I(θ)), combining the two into a single coherent adaptive loop.