🐛 Fix to get the question id

梅开二度
This commit is contained in:
洛水居室 2022-10-28 17:02:40 +08:00
parent 6e8f29786e
commit 884afa3087
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -36,8 +36,8 @@ class QuizPlugin(Plugin, BasePlugin):
return None
if len(question_id_list) == 0:
return None
index = random.choice(question_id_list) # nosec
question = await self.quiz_service.get_question(question_id_list[index])
question_id = random.choice(question_id_list) # nosec
question = await self.quiz_service.get_question(question_id)
_options = []
correct_option = None
for answer in question.answers: