Skip to content

DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.

fix(assessment): use mastery point names

XZH9f64cde3f916
diff --git a/deeptutor/capabilities/mastery/tools.py b/deeptutor/capabilities/mastery/tools.py
index 262b6c484..e6cd317e4 100644
--- a/deeptutor/capabilities/mastery/tools.py
+++ b/deeptutor/capabilities/mastery/tools.py
@@ -719,7 +719,7 @@ class MasteryGradeTool(BaseTool):
choice_options=choice_options,
correct_answer=expected_answer,
material_title=progress.name,
- section_title=kp.title if kp else "",
+ section_title=kp.name if kp else "",
)
mastered = bool(kp and is_mastered(progress, kp))
payload = {
diff --git a/deeptutor/learning/tests/test_mastery_tools.py b/deeptutor/learning/tests/test_mastery_tools.py
index 98ee25ab3..18b0bf297 100644
--- a/deeptutor/learning/tests/test_mastery_tools.py
+++ b/deeptutor/learning/tests/test_mastery_tools.py
@@ -365,6 +365,10 @@ async def test_grade_syncs_mastery_attempt_to_question_bank(path_id, session_sto
assert entry["user_answer"] == "5"
assert entry["correct_answer"] == "4"
assert entry["is_correct"] is False
+ assert entry["source"] == "mastery_path"
+ assert entry["material_id"] == path_id
+ assert entry["section_id"] == kp_id
+ assert entry["section_title"] == "Truth tables"
# An idempotent retry with a changed model argument must not overwrite the
# committed learner answer in the auxiliary question bank.