def from_data(cls, question):
return cls(
category=question['category'],
type=question['type'],
question=unescape(question['question']),
answer=unescape(question['correct_answer']),
incorrect=tuple(map(unescape, question['incorrect_answers'])),
)
# How many times should the cache be used before making an API request
# to get more questions, the lower this number, the more likely it will
# make an HTTP request. Set to 0 to always use the API
#
# Note that the toggler is only called when the trivia session doesn't
# have any questions in the queue, so be careful when making this really
# high. Otherwise the question cache might never be filled.
评论列表
文章目录