Compare commits

...

2 Commits

Author SHA1 Message Date
9320815d3f 修复无法更改图片的问题
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-11-01 20:59:58 +08:00
795300cb83 在每日答题情况添加记录点显示
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-11-01 18:42:47 +08:00
2 changed files with 13 additions and 2 deletions

View File

@ -130,7 +130,18 @@ def get_daily_report_v2(manager: PuzzleManager, gid: int | None = None):
if re.match(r"^\d+$", u):
uname = get_username(int(u), gid)
tries = len(manager.submissions[p.raw_id][u])
msg += f"\n- {uname} [💦 {tries} 提交]"
checkpoints_touched = len(set((
s.hint_id for s in manager.submissions[p.raw_id][u]
if (
s.hint_id >= 0
and s.hint_id in p.hints
and p.hints[s.hint_id].is_checkpoint
)
)))
checkpoint_message = ""
if checkpoints_touched > 0:
checkpoint_message = f" | 🚩 {checkpoints_touched} 记录点"
msg += f"\n- {uname} [💦 {tries} 提交{checkpoint_message}]"
return msg

View File

@ -320,7 +320,7 @@ def create_admin_commands():
if image is not None and image.url is not None:
b = await download_image_bytes(image.url)
image_manager.remove_puzzle_image(p.img_name)
image_manager.upload_puzzle_image(b.unwrap())
p.img_name = image_manager.upload_puzzle_image(b.unwrap())
elif remove_image.available:
image_manager.remove_puzzle_image(p.img_name)