feat: 实现考试分数智能分配
All checks were successful
continuous-integration/drone/push Build is passing

解决题目数量无法整除总分时出现无限小数的问题

后端:
- 新增 ScoreDistributor 分数分配工具类
- 支持整数分配和小数分配两种模式
- 更新 exam_service.py 使用智能分配
- 考试总分固定100分,按题目数量智能分配

前端:
- 新增 scoreFormatter.ts 分数格式化工具
- 提供分数显示、等级判断等辅助函数

示例:100分/6题 = [17,17,17,17,16,16] 总和=100
This commit is contained in:
yuliang_guo
2026-01-30 14:50:41 +08:00
parent 27b5766694
commit e3b7bdcfd8
5 changed files with 411 additions and 12 deletions

View File

@@ -0,0 +1,14 @@
"""
工具模块
"""
from app.utils.score_distributor import (
ScoreDistributor,
distribute_scores,
get_question_score,
)
__all__ = [
"ScoreDistributor",
"distribute_scores",
"get_question_score",
]