Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- from Question import *
- Q = Question(open('db.json'))
- root = Tk()
- root.geometry("500x600")
- # navbar = Frame(root, bg="#4FC3F7", width=500)
- # navbar.pack(fill=Y, side=LEFT)
- #
- navbar = Frame(root, bg="#d3d3d3", width=100)
- navbar.pack(fill=Y, side=LEFT)
- startButton = Button(navbar, text="Start", width=12)
- startButton.pack()
- startButton.place(x=3, y=40)
- optionsButton = Button(navbar, text="Options", width=12)
- optionsButton.pack()
- optionsButton.place(x=3, y=70)
- endButton = Button(navbar, text="End quiz", width=12)
- endButton.pack()
- endButton.place(x=3, y=100)
- test = Canvas(root, height=200)
- test.pack(fill=BOTH)
- #######################################################
- for i in range(len(Q.getAllQuestions())):
- question = Frame(test, bg="#fff")
- label = Label(question, text=str(i + 1) + ". " + Q.getAllQuestions()[i], fg="black", bg="#fff")
- label.config(font=("Arial", 12))
- label.pack(anchor=W, pady=5, padx=10)
- for j in range(len(Q.getAllAnswersFor(i))):
- checkbox = Checkbutton(question, text=Q.getAllAnswersFor(i)[j], variable=IntVar(), bg="#fff")
- checkbox.pack(anchor=W, padx=25)
- question.pack(fill=BOTH, padx=30, pady=15)
- mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement