Refactor ask_next_question to consolidate nonlocal variable declarations

This commit is contained in:
2025-08-15 10:26:27 +02:00
parent c68baecb52
commit ab6d476891

View File

@@ -364,8 +364,7 @@ def show_timer(minutes, questions_file, session_log, total_time, xp, level, root
question_frame.pack(pady=10)
def ask_next_question():
nonlocal question_idx, total_questions
nonlocal total_correct, total_questions
nonlocal question_idx, total_questions, total_correct
if question_idx >= len(questions_to_ask):
# Show score page at end
total_score = int((total_correct / total_questions) * max_score) if total_questions else 0