added read password for admin

This commit is contained in:
Crimson Hawk 2024-05-13 11:27:07 +08:00
parent 153c4d282d
commit 9f5ce4ce35
Signed by: CrimsonHawk
GPG key ID: 0804DD39BB9BF5AC

View file

@ -58,6 +58,7 @@ class libexam:
username = ""
questions = []
password = -1
def setmode(modein):
mode=modein
@ -75,6 +76,12 @@ class libexam:
print(f"Username set to: {user}\n")
return 0
def setadmin():
passwordf = open("password.txt", "r")
password = passwordf.readline()
print(f"Read password: {password}\n")
return 0
def readquestions():
sha256=hashlib.sha256()