From 94b1c908c414548b2568ea191255d6efe53b61cc Mon Sep 17 00:00:00 2001 From: Crimson Hawk Date: Wed, 15 May 2024 08:37:59 +0800 Subject: [PATCH] fixed syntax issues --- libexam.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/libexam.py b/libexam.py index f02267b..33a6f55 100644 --- a/libexam.py +++ b/libexam.py @@ -127,12 +127,10 @@ class libexam: - def writeanswer(qn,ans) - if(username=""){ + def writeanswer(qn,ans): + if(username==""): print(f"Username not set!\n") return 1 - } - md5 = hashlib.md5() @@ -235,13 +233,11 @@ class libexam: return 0 def readanswer(qn): - if(username=""){ + if(username==""): print(f"Username not set!\n") return 1 - } - md5 = hashlib.md5() md5.update(username) filename = md5.digest() @@ -283,7 +279,6 @@ class libexam: print(f"Stage 1 integrity check\n") if(s1hash==s1h.digest()): print(f"Hashes match: {s1hash}\n") - break else: print(f"Hashes does not match !\nExpected: {s1h.digest()}\nGot: {s1hash}\n") return 1 @@ -306,7 +301,6 @@ class libexam: print(f"Stage 2 integrity check\n") if(s2hash==s2h.digest()): print(f"Hashes match: {s2hash}\n") - break else: print(f"Hashes does not match !\nExpected: {s2h.digest()}\nGot: {s2hash}\n") return 1