def handle_select_answer(self):
if self.current_question is None:
return TextSendMessage(text='????????????'
'?????????????????')
reply = parse('???{answer}', self.message)['answer']
logger.info('SELECT{Q: %s, A: %s}', self.current_question.uid, reply)
is_correct = self.current_question.answer == reply
self.user.save_answer(self.current_question, is_correct)
score = self.user.get_current_score()
if self.current_question.answer == reply:
response = TextSendMessage(text=f'{_.CORRECT} ?? {score} ?')
else:
response = TextSendMessage(
text=f'{_.WRONG} ?? {score} ?'
)
return [response, *self.ask_next_question()]
评论列表
文章目录