Repository navigation
feat(ACRE): Implement Adaptive Concept Recovery Engine (V2) - #1155
Open
Rohit23f1001156 wants to merge 5 commits into
Open
Rohit23f1001156 wants to merge 5 commits into
Rohit23f1001156 wants to merge 5 commits into
Conversation
…o-return in ProgressService and AttemptService
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(ACRE): Implement Adaptive Concept Recovery Engine (V2)
Problem
The existing recovery workflow redirects students to review material after a failed quiz, but the subsequent retry still uses random question selection. As a result, retry attempts are not focused on the concepts that caused the failure, reducing the effectiveness of the recovery loop.
Solution
ACRE V2 introduces adaptive concept recovery by preserving failed concept tags across the review workflow and using them to bias question selection during quiz retries. Recovery attempts prioritize weak concepts while reducing repeated questions and presenting them in Bloom's taxonomy order.
Workflow
Highlights
Introduces adaptive concept recovery for quiz retries.
Preserves failed concept tags across the review workflow.
Prioritizes weak concepts using weighted adaptive selection.
Applies repetition penalties while maintaining randomized sampling.
Clears recovery state only after a successful retry.
Behavior Changes
Failed quiz submissions now enter the recovery workflow even if the quiz item was previously completed.
Recovery state is preserved until the retry quiz is successfully passed.
Retry quizzes prioritize questions covering previously failed concepts.
Recovery state is cleared only after a successful retry.
Implementation
Adaptive Selection (3 New Services)
| Service | Responsibility |
|----------|----------------|
| AdaptiveQuestionSelector | Weighted random sampling without replacement (roulette-wheel), repetition penalty, Bloom ordering |
| AdaptiveSelectionContextBuilder | Loads active recovery state and student quiz history from the database |
| AdaptiveWeightPolicy | Pure scoring: base weight, failed-tag boost (×5), repetition penalty (×0.2), priority multiplier |
Recovery Workflow
ProgressService
Resolves failed concept tags.
Matches review items using concept tags.
Persists recovery state to the progress document.
Fix: Prevents premature clearing of
recoveryStatewhen the review item is completed.AttemptService
Integrates the adaptive selection context.
Fix: Updates the gate condition so failed submissions always enter recovery regardless of prior completion status.
Infrastructure
Added repository support for adaptive selection queries.
Registered adaptive selection services in the dependency injection container.
Extended quiz and recovery interfaces.
Non-functional Changes
Suppressed verbose face-recognition debug logs behind the
DEBUG_FACEflag.No functional frontend behavior changes.
Testing
The adaptive recovery workflow was verified through build validation, targeted unit tests, and an end-to-end Fail → Review → Retry scenario.
✅ Build
Result
✅ ACRE Unit Tests
pnpm exec vitest run ProgressService.acre.test.tsResult
✅ End-to-End Integration Verification
Attempt 1 — Standard Selection
↓
Student fails quiz → Recovery state saved → Review item completed
↓
Retry attempt generated with adaptive selection
Attempt 2 — Adaptive Selection
Known Test Failures (Not ACRE-Related)
Running the full backend test suite reveals several existing infrastructure-related failures (DI container bindings and test environment setup) that are unrelated to ACRE V2.
The ACRE-specific unit tests and end-to-end workflow pass successfully.
| Root Cause | Affected Suites |
|------------|-----------------|
| Missing
CourseRegistrationRepositoryDI binding in test container | QuestionController, InviteController, ReportController || Auth emulator not configured in test environment | EnrollementController |
| Test fixture setup issues | CourseSettingController.backfill |
These failures reproduce identically on the current
mainbranch.Reviewer Guide
Suggested review order:
AdaptiveQuestionSelector.tsAttemptService.tsProgressService.tsQuestionBankService.tsProgressService.acre.test.ts