Skip to main content

POST /api/v1/track-answer

Track a learning event and update all relevant cognitive analytics.

Request

Headers

Example Request

result = await engine.track_answer(
    user_id="student_123",
    skill_id="algebra_linear",
    is_correct=True,
    time_spent_seconds=45,
    confidence_score=4
)

Response

success
boolean
Operation success status
data
object
mastery_before
float
Mastery probability before this attempt
mastery_after
float
Updated mastery probability after this attempt
velocity
float
Change in mastery (after - before)
plateau_detected
boolean
Whether learning plateau was detected
total_attempts
integer
Total attempts for this skill
correct_attempts
integer
Total correct attempts for this skill

Example Response

{
  "success": true,
  "data": {
    "mastery_before": 0.65,
    "mastery_after": 0.72,
    "velocity": 0.07,
    "plateau_detected": false,
    "total_attempts": 24,
    "correct_attempts": 19,
    "recommendation": null
  },
  "message": "Learning event tracked successfully"
}

What Happens Under the Hood

1

BKT Update

Bayesian Knowledge Tracing updates mastery probability based on the answer
2

Velocity Calculation

Learning velocity is calculated from mastery change
3

Plateau Check

System checks for learning plateau indicators
4

Efficiency Analysis

Cognitive efficiency metrics are updated
5

Return Results

Updated analytics are returned to the caller

Status Codes