From 2ab29c8ef37704cb13ceb9c51ae6b6c75812f7e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=90=E6=81=BA?= <1621362626@qq.com> Date: Fri, 22 Aug 2025 10:13:42 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=A4=9A=E9=80=89=E9=A2=98=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/page0.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/page0.py b/components/page0.py index c75524a..e1aa53a 100644 --- a/components/page0.py +++ b/components/page0.py @@ -211,7 +211,6 @@ class Page0(tk.Frame): self.text2.insert("end", self.row[14]) self.text2.config(state="disabled") - correct = 0 for i in range(4): state = self.correct_answer[i] + 2 * self.my_answer[i] # 0:未选对, 1:漏选, 2:错选, 3:选对 @@ -221,12 +220,16 @@ class Page0(tk.Frame): self.buttons[i].config(text=full_text, style="Miss.TButton") elif state == 2: # 选错 → 红色 self.buttons[i].config(text=full_text, style="Wrong.TButton") - correct = 1 elif state == 3: # 选对 → 淡绿色 self.buttons[i].config(text=full_text, style="Correct.TButton") else: # 未选且错误 → 不变(保持原始或默认) self.buttons[i].config(text=full_text, style="Default.TButton") + if self.my_answer == self.correct_answer: + correct = 1 # 或者 True,表示完全正确 + else: + correct = 0 # 表示不完全正确 + self.c_backend.update(self.row[0], correct) self.winfo_toplevel().focus_set()