feat: add error card feature for automated learner misunderstanding detection#268
feat: add error card feature for automated learner misunderstanding detection#268kawtarhassani wants to merge 12 commits into
Conversation
…m into lib/features
|
@kawtarhassani Language: all six files are written in French. The project rule is that all Content issues:
Please fix the language and the two factual mismatches (1 and 2) before approval |
|
Hi , @kawtarhassani Security review🔴 Critical (3) — Must fix before merge🔴 [CRITICAL — Blocking] LLM-sourced fields ( Required before merge: Encode all fields with an 🔴 [CRITICAL — Blocking]
Required before merge: Validate server-side that the support belongs to the authenticated user before any operation. Never trust an identifier sourced from 🔴 [CRITICAL — Blocking] If Required before merge: Validate that 🟠 High (4)🟠 [HIGH] Svelte currently escapes fields by default, but Fix in this PR: Explicitly document the prohibition of 🟠 [HIGH] The opened tab has access to Fix: Replace with 🟠 [HIGH]
Fix: Check 🟠 [HIGH]
Fix: Scrub credentials before logging. Audit existing logs for key traces. 🟡 Medium (4)🟡 [MEDIUM — GDPR] Multiple Fix: Remove production 🟡 [MEDIUM]
Fix: Apply 🟡 [MEDIUM] Backend error messages (potentially including table names, stack traces, or file paths) are surfaced directly in the interface. Fix: Map API errors to generic user-facing messages. Log the full detail in DEV mode only. 🟡 [MEDIUM — GDPR] Log statements potentially expose the content of user learning exchanges — personal data under GDPR. Fix: Log only IDs and technical metadata. Define a log retention and data minimization policy.
|
|
All requested changes have been applied:
Point 3 (path prefix): |
|
HI @OumaLam 🔴 Critical (3/3 fixed)
🟠 High (4/4 fixed)
🟡 Medium (4/4 fixed)
Full test suite: 233 passed, 0 failed. |
|
Salam @kawtarhassani , At the moment, this is not a clean PR. It includes a very large number of unrelated changes, which makes it difficult to review the actual feature. Please rebase your branch onto the current main, keep only the commits related to the feature ur woking on, and remove unrelated changes before requesting a review again. |
Pull Request Checklist
devbranch.feat).Description
This pull request introduces the Error Card feature in Open TutorAI CE.
The goal of this contribution is to automatically analyze exchanges between a student and the AI tutor in order to detect learning misunderstandings and transform them into structured pedagogical error cards. After each tutor response, the exchange is analyzed asynchronously in the background by a pedagogical LLM. When one or more misunderstandings are identified, the system generates structured remediation content associated with the current support session and stores it in the database.
The generated error-card content is designed to help students revisit their mistakes through pedagogical feedback such as the identified concept, a description of the misunderstanding, a simple explanation, and a correct example. Students are notified when new error-card content is generated and can later access their cards from a dedicated side panel, review them, and export them as a PDF for revision purposes.
The feature follows a fire-and-forget workflow so that the analysis never blocks the chat interface. This keeps the tutoring experience responsive while still providing personalized remediation support in the background.
In addition to the feature itself, this contribution also includes API integration, persistence logic, frontend integration, automated tests, documentation, diagrams, screenshots, and security improvements.
Changelog Entry
Description
Added
Error Card backend support, including model, repository, and service logic.
New API endpoints for:
Frontend integration for error-card retrieval and display.
Error card side panel with PDF export support.
Documentation files covering:
Automated tests for API and service behavior.
Changed
Deprecated
Removed
Fixed
Security
Breaking Changes
Additional Information
This contribution includes:
Screenshots or Videos
Included in this contribution: