main
黄海 5 months ago
parent 63734e8707
commit 8a2ba43797

@ -38,18 +38,21 @@ def query_all_questions():
result = {
"question_id": qid,
"content": data[0]['content'],
# 保留原有结构
"knowledge_points": data[0]['knowledge_points'], # 现在每个元素包含id+name
"literacy_points": data[0]['literacy_points'] # 现在每个元素包含id+title
"knowledge_points": data[0]['knowledge_points'],
"literacy_points": data[0]['literacy_points']
}
results.append(result)
# 增强版输出展示
print(f"\n试题ID: {qid}")
print(f"知识点: {[kp['name'] for kp in result['knowledge_points']]}")
print(f"知识点ID: {[kp['id'] for kp in result['knowledge_points']]}")
print(f"素养点: {[lp['title'] for lp in result['literacy_points']]}")
print(f"素养点ID: {[lp['id'] for lp in result['literacy_points']]}")
print(f"\n{'=' * 40} 题目详情 {'=' * 40}")
print(f"📚 试题ID: {qid}")
print(f"📝 内容全文: {result['content']}") # 新增完整内容输出
print(f"🔍 内容摘要: {result['content'][:50]}...") # 保留摘要显示
print(f"🧠 知识点: {[kp['name'] for kp in result['knowledge_points']]}")
print(f"🆔 知识点ID: {[kp['id'] for kp in result['knowledge_points']]}")
print(f"🌟 素养点: {[lp['title'] for lp in result['literacy_points']]}")
print(f"🔢 素养点ID: {[lp['id'] for lp in result['literacy_points']]}")
print('=' * 90)
except Exception as e:
print(f"❌ 查询失败: {str(e)}")

Loading…
Cancel
Save