修复中途退出考试报错问题

This commit is contained in:
zhangyuheng 2024-10-20 21:26:13 +08:00
parent 878686faf7
commit b37063d4f0

View File

@ -63,6 +63,7 @@ class ExamApp:
def init_main_menu(self):
self.clear_screen()
self.is_submitted = True
tk.Label(self.root, text="选择考试级别").pack(pady=20)
for level in ['A', 'B', 'C']:
tk.Button(self.root, text=f"级别 {level}", command=lambda l=level: self.start_exam(l)).pack(pady=10)
@ -203,6 +204,10 @@ class ExamApp:
mins, secs = divmod(self.time_left, 60)
self.timer_score_label.config(text=f"剩余时间:{mins:02}:{secs:02}")
self.root.after(1000, self.update_timer)
elif self.is_submitted:
return
else:
self.submit_exam()
def clear_screen(self):
for widget in self.root.winfo_children():