fix chapter now

This commit is contained in:
CakeCN
2025-12-14 14:33:29 +08:00
parent c8942cedac
commit cb435ecade
2 changed files with 2 additions and 5 deletions

View File

@@ -77,8 +77,6 @@ class AgentNamespace(Namespace):
Returns:
int: 需要跳过的章节数
"""
need_skip_chapters = 0
# 总是从mongo加载学习进度
progress_result = load_learning_progress(user_id, course_id, chapter_name, lesson_name)
@@ -100,7 +98,7 @@ class AgentNamespace(Namespace):
upload_learning_progress_to_cloud(progress)
# 计算需要跳过的章节数:从初始的-1到当前的chapter_chain_now
need_skip_chapters = chatmanager.chapter_chain_now + 1
need_skip_chapters = chatmanager.chapter_chain_now
else:
# 使用默认值,确保有完整的结构
chatmanager.chat_historys = progress_result['data']['chat_historys']