Student Assessment
StudentAssessment is the student-facing assessment modality. It manages the answer submission flow, tracks knowledge state, and uses the AlgorithmEngine for adaptive question selection.
Struct
Section titled “Struct”pub struct StudentAssessment { state: State<StudentAssessmentSynced, StudentAssessmentEphemeral>, services: Arc<StudentAssessmentServices>, cmd_tx: CommandSender<...>, cmd_rx: CommandReceiver<...>,}The services include the AlgorithmEngine for adaptive question selection:
pub struct StudentAssessmentServices { pub agent: Arc<AgentService>, pub algorithm: AlgorithmEngine,}Synced State
Section titled “Synced State”pub struct StudentAssessmentSynced { pub meta: ResourceMeta, pub session_id: String, pub student_id: String, pub placements: Vec<ComponentPlacement<QuestionSequencePosition>>, pub answers: HashMap<String, AnswerData>, pub knowledge_snapshot: Vec<(usize, f32)>, // sparse knowledge vector pub indicator_snapshot: Vec<(usize, f32)>, // sparse skill indicator pub status: StudentAssessmentStatus,}Ephemeral State
Section titled “Ephemeral State”pub struct StudentAssessmentEphemeral { pub current_question_index: usize, pub precomputed_next: Option<PrecomputedBranch>, pub output: Vec<AssessmentElement>,}The precomputed_next field holds pre-calculated next questions for both correct and incorrect outcomes, enabling instant transitions.
Position
Section titled “Position”QuestionSequencePosition describes a question’s place in the sequence:
pub struct QuestionSequencePosition { pub sequence_number: usize, pub question_id: String,}Status Lifecycle
Section titled “Status Lifecycle”InProgress → Paused → InProgress | └→ Completed| Status | Meaning |
|---|---|
InProgress | Student is actively answering questions |
Paused | Student paused or teacher paused the session |
Completed | Assessment finished (all questions answered or ended) |
Intents
Section titled “Intents”| Intent | Parameters | Purpose |
|---|---|---|
Start | — | Begin the assessment, compute first question |
SubmitAnswer | answer: String | Submit answer for current question |
SkipQuestion | — | Skip current question without answering |
Pause | — | Pause the assessment |
Resume | — | Resume from pause |
End | — | End the assessment early |
Recompile | — | Force recompilation (hidden) |
Feedback
Section titled “Feedback”Async operations produce feedback that arrives on the next dispatch cycle:
pub enum StudentAssessmentFeedback { PrecomputedBranch { if_correct: Option<String>, // question ID if answer is correct if_incorrect: Option<String>, // question ID if answer is incorrect }, NextQuestionComputed { question_id: String, },}Answer Flow
Section titled “Answer Flow”- Start — spawns async computation via
AlgorithmEngineto select the first question - NextQuestionComputed feedback — adds new placement to the sequence
- Precomputed branches — while student answers, the engine pre-computes what comes next for both outcomes
- SubmitAnswer — stores answer data, triggers knowledge update (direct + indirect), selects next question
- Knowledge update — direct impact on tested skills, indirect propagation via distance matrix, clipped to
[KL, KU]
Knowledge Update Detail
Section titled “Knowledge Update Detail”When an answer is submitted:
1. Direct knowledge = current + (±1 × score_factor × DIRECT_MULTIPLIER) per tested skill2. Indirect knowledge = propagation along distance matrix edges to untested skills3. Clip to [KL, KU] bounds4. Store updated knowledge_snapshot (sparse)5. Compute next question from updated stateUses nalgebra::DVector internally for linear algebra operations.
Snapshot
Section titled “Snapshot”pub struct StudentAssessmentSnapshot { pub id: String, pub name: String, pub session_id: String, pub student_id: String, pub placements: Vec<StudentQuestionPlacement>, pub answers: HashMap<String, AnswerData>, pub current_question_index: usize, pub status: StudentAssessmentStatus, pub version: u64, pub export_ready: bool,}Related
Section titled “Related”- Overview — architecture and shared types
- Teacher — the teacher authoring modality
- Algorithm — adaptive engine internals
- Components — question compilation