From 796c9146f4ac161e38858b0e1eb3c96ec41f77c1 Mon Sep 17 00:00:00 2001 From: Reviflow Bot Date: Sat, 31 Jan 2026 13:27:21 +0100 Subject: [PATCH] =?UTF-8?q?fix(quiz):=20rename=20'Remediation'=20to=20'R?= =?UTF-8?q?=C3=A9vision'=20in=20topic=20generation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/modules/quiz/router.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/app/modules/quiz/router.py b/backend/app/modules/quiz/router.py index a2ee42c..f040f4a 100644 --- a/backend/app/modules/quiz/router.py +++ b/backend/app/modules/quiz/router.py @@ -529,10 +529,11 @@ async def generate_remediation_quiz( quiz_content = data["quiz"] - # Force topic to indicate remediation for reliable detection downstream - if "remedia" not in quiz_content.get("topic", "").lower(): + # Force topic to indicate remediation/revision for reliable detection downstream + topic_lower = quiz_content.get("topic", "").lower() + if "remedia" not in topic_lower and "révision" not in topic_lower: original_topic = quiz_content.get("topic", "Révision") - quiz_content["topic"] = f"{original_topic} (Remediation)" + quiz_content["topic"] = f"{original_topic} (Révision)" # Inject revision_id if present so it persists through the quiz lifecycle if revision_id: @@ -571,7 +572,7 @@ async def get_mastery_stats( for s in scores: if not s.topic: continue # Normalize topic - clean_topic = s.topic.replace(" (Remediation)", "").replace(" (Remédiation)", "").strip() + clean_topic = s.topic.replace(" (Remediation)", "").replace(" (Remédiation)", "").replace(" (Révision)", "").strip() if clean_topic not in topic_map: topic_map[clean_topic] = [] @@ -594,7 +595,7 @@ async def get_mastery_stats( if not e.topic: continue # Also clean topic for errors if needed, or rely on exact match? # Ideally errors should also be grouped by clean topic. - t_key = e.topic.replace(" (Remediation)", "").replace(" (Remédiation)", "").strip() + t_key = e.topic.replace(" (Remediation)", "").replace(" (Remédiation)", "").replace(" (Révision)", "").strip() error_counts[t_key] = error_counts.get(t_key, 0) + 1 for topic, topic_scores in topic_map.items():