mirror of
https://github.com/R0m1k3/Reviflow.git
synced 2026-10-11 17:26:20 +02:00
fix(quiz): rename 'Remediation' to 'Révision' in topic generation
This commit is contained in:
1 parent
75ebcef87f
commit
796c9146f4
1 file changed
+6
-5
@@ -529,10 +529,11 @@ async def generate_remediation_quiz(
|
|||||||
|
|
||||||
quiz_content = data["quiz"]
|
quiz_content = data["quiz"]
|
||||||
|
|
||||||
# Force topic to indicate remediation for reliable detection downstream
|
# Force topic to indicate remediation/revision for reliable detection downstream
|
||||||
if "remedia" not in quiz_content.get("topic", "").lower():
|
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")
|
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
|
# Inject revision_id if present so it persists through the quiz lifecycle
|
||||||
if revision_id:
|
if revision_id:
|
||||||
@@ -571,7 +572,7 @@ async def get_mastery_stats(
|
|||||||
for s in scores:
|
for s in scores:
|
||||||
if not s.topic: continue
|
if not s.topic: continue
|
||||||
# Normalize topic
|
# 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:
|
if clean_topic not in topic_map:
|
||||||
topic_map[clean_topic] = []
|
topic_map[clean_topic] = []
|
||||||
@@ -594,7 +595,7 @@ async def get_mastery_stats(
|
|||||||
if not e.topic: continue
|
if not e.topic: continue
|
||||||
# Also clean topic for errors if needed, or rely on exact match?
|
# Also clean topic for errors if needed, or rely on exact match?
|
||||||
# Ideally errors should also be grouped by clean topic.
|
# 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
|
error_counts[t_key] = error_counts.get(t_key, 0) + 1
|
||||||
|
|
||||||
for topic, topic_scores in topic_map.items():
|
for topic, topic_scores in topic_map.items():
|
||||||
|
|||||||
Reference in new issue
Block a user