解决题目数量无法整除总分时出现无限小数的问题 后端: - 新增 ScoreDistributor 分数分配工具类 - 支持整数分配和小数分配两种模式 - 更新 exam_service.py 使用智能分配 - 考试总分固定100分,按题目数量智能分配 前端: - 新增 scoreFormatter.ts 分数格式化工具 - 提供分数显示、等级判断等辅助函数 示例:100分/6题 = [17,17,17,17,16,16] 总和=100
This commit is contained in:
14
backend/app/utils/__init__.py
Normal file
14
backend/app/utils/__init__.py
Normal file
@@ -0,0 +1,14 @@
|
||||
"""
|
||||
工具模块
|
||||
"""
|
||||
from app.utils.score_distributor import (
|
||||
ScoreDistributor,
|
||||
distribute_scores,
|
||||
get_question_score,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"ScoreDistributor",
|
||||
"distribute_scores",
|
||||
"get_question_score",
|
||||
]
|
||||
Reference in New Issue
Block a user