forked from mttu-developers/konabot
添加中间答案功能
This commit is contained in:
@ -63,7 +63,7 @@ def get_submission_message(
|
||||
hint_msg = "✨ 恭喜!这是本题的中间答案,加油!"
|
||||
else:
|
||||
hint_msg = "🤔 答错啦!请检查你的答案。"
|
||||
return f"{hint_msg}\n\n提示:{hint.hint}"
|
||||
return f"{hint_msg}\n\n提示:{hint.message}"
|
||||
return "❌ 答错啦!请检查你的答案。"
|
||||
|
||||
|
||||
@ -162,3 +162,15 @@ def get_puzzle_info_message(manager: PuzzleManager, puzzle: Puzzle) -> UniMessag
|
||||
msg = msg.text(f"\n---------\n使用 `konaph ready {puzzle.raw_id}` 完成编辑")
|
||||
|
||||
return msg
|
||||
|
||||
|
||||
def get_puzzle_hint_list(puzzle: Puzzle) -> str:
|
||||
msg = f"==== {puzzle.title} 提示与中间答案 ====\n"
|
||||
if len(puzzle.hints) == 0:
|
||||
msg += "\n你没有添加任何中间答案。"
|
||||
return msg
|
||||
for hint_id, hint in puzzle.hints.items():
|
||||
n = {False: "[提示]", True: "[中间答案]"}[hint.is_checkpoint]
|
||||
msg += f"\n{n}[{hint_id}] {hint.pattern}"
|
||||
msg += f"\n {hint.message}"
|
||||
return msg
|
||||
|
||||
Reference in New Issue
Block a user