replier.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:quizbot-2017 作者: pycontw 项目源码 文件源码
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()]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号