布局更新
This commit is contained in:
@@ -49,7 +49,7 @@ class SelectionPuzzle(Puzzle):
|
||||
max_riddles_num: 最大生成谜题数 (默认2个)
|
||||
prefix: 问题前缀
|
||||
"""
|
||||
def __init__(self, mapping: dict, jammer: list, max_riddles_num: int = 2, prefix: str = ""):
|
||||
def __init__(self, mapping, jammer: list, max_riddles_num: int = 2, prefix: str = ""):
|
||||
self.prefix = prefix
|
||||
self.mapping = mapping
|
||||
self.jammer = list(set(jammer + list(mapping.values()))) # 合并干扰项和正确答案并去重
|
||||
@@ -92,12 +92,12 @@ class SelectionPuzzle(Puzzle):
|
||||
answers.append(correct_answer)
|
||||
all_options.append(options)
|
||||
|
||||
question_texts = [f"{self.prefix}"]
|
||||
question_texts = []
|
||||
for i, (puzzle, options) in enumerate(zip(puzzles, all_options)):
|
||||
#options_text = "\n".join([f" {chr(97+j)}. {opt}" for j, opt in enumerate(options)])
|
||||
question_texts.append(f"{i+1}. {puzzle}")
|
||||
question_texts.append(f"{self.prefix}:\n {i+1}. {puzzle}")
|
||||
|
||||
self.wording = "\n".join(question_texts)
|
||||
self.wording = question_texts
|
||||
self.answer = answers
|
||||
self.options = all_options
|
||||
|
||||
|
Reference in New Issue
Block a user