🐛 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 return None
if len(question_id_list) == 0: if len(question_id_list) == 0:
return None return None
index = random.choice(question_id_list) # nosec question_id = random.choice(question_id_list) # nosec
question = await self.quiz_service.get_question(question_id_list[index]) question = await self.quiz_service.get_question(question_id)
_options = [] _options = []
correct_option = None correct_option = None
for answer in question.answers: for answer in question.answers: