topics_questions=all_questions# don't use topics for now. see next to lines to use topics
# if you want to use topics 1) filter all questions with topics 2) use topic questions to construct quiz_questions (when removing service keys from all_questions dict)
# topics = ["теодолит"] # move topics to VARIABLES
# topics = ["теодолит"] # move topics to VARIABLES
# topics_questions = [q for q in all_questions if q.get("topic") in topics]
# topics_questions = [q for q in all_questions if q.get("topic") in topics]
a["correct_answer"]=next(question["answer"]forquestioninall_questions ifquestion["id"]==question_id)# all_questions can be replaced with topic_questions