修复作业按次登记扣分上限误拦,节假日改用国内接口
1. 作业按次登记:单次扣分上限改为按"每次缺交"校验(一次缺交视为一次扣分), 不再因学生合计分值超过上限而整单拦截(解决班委提交时"扣分侧有问题") 2. 节假日接口:优先使用国内接口 api.jiejiariapi.com(放假/调休补班), 失败时自动降级到原备用接口;缓存、证书回退与手动校历逻辑不变
This commit is contained in:
1 parent
71c3263335
commit
250acf35fd
3 files changed
+68
-24
No files matched your search
@@ -84,15 +84,12 @@ class HomeworkService:
|
||||
if sid not in student_map:
|
||||
return {"success": False, "message": "存在无效学生(不存在或已禁用)"}
|
||||
|
||||
if limits["max_subtract"] is not None:
|
||||
for sid, miss in miss_map.items():
|
||||
total_deduct = miss * deduction
|
||||
if total_deduct > limits["max_subtract"]:
|
||||
name = student_map[sid]["name"]
|
||||
return {
|
||||
"success": False,
|
||||
"message": f"{name} 缺交{miss}次合计扣{total_deduct}分,超过单次扣分上限{limits['max_subtract']}分"
|
||||
}
|
||||
# 单次扣分上限按"每次缺交"校验:按次登记中一次缺交视为一次扣分,合计分可超过单次上限
|
||||
if limits["max_subtract"] is not None and deduction > limits["max_subtract"]:
|
||||
return {
|
||||
"success": False,
|
||||
"message": f"单次缺交扣分不能超过{limits['max_subtract']}分"
|
||||
}
|
||||
|
||||
# 创建作业记录(每次一条)
|
||||
base_title = (title or "作业登记").strip() or "作业登记"
|
||||
|
||||
Reference in new issue
Block a user