Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # guizero -Adult Placement Test for English Classes
- from guizero import App, Text,PushButton,Box
- app = App(title="Adult Placement Test for English Classes",width = 500,height=800)
- score = 0
- # Function definitions for your events go here.
- def a123():
- score = 0
- if buttonb.text =="A":
- score += 1
- else:
- score += 0
- questionmessage.value = "next Q2"
- buttona.text="next A2"
- buttonb.text="next B2"
- buttonc.text="next C2"
- buttond.text="next D2"
- def b123():
- score = 0
- if buttonb.text =="A":
- score += 1
- else:
- score += 0
- questionmessage.value = "next Q2"
- buttona.text="next A2"
- buttonb.text="next B2"
- buttonc.text="next C2"
- buttond.text="next D2"
- def c123():
- score = 0
- if buttona.text =="A":
- score += 1
- else:
- score += 0
- buttona.text="next A2"
- buttonb.text="next B2"
- buttonc.text="next C2"
- buttond.text="next D2"
- questionmessage.value = "next Q2"
- def d123():
- score = 0
- if buttonb.text =="A":
- score += 1
- questionmessage.value = "next Q2"
- buttona.text="next A2"
- buttonb.text="next B2"
- buttonc.text="next C2"
- buttond.text="next D2"
- def next():
- nextbutton.text=score
- # Your GUI widgets go here
- box_timer =Box(app, width = "fill", border=0,height=50)
- box_question=Box(app, width = "fill", border=0,height=200)
- box_a=Box(app, width = "fill", border=0,height=80)
- box_b=Box(app, width = "fill", border=0,height=80)
- box_c=Box(app, width = "fill", border=0,height=80)
- box_d=Box(app, width = "fill", border=0,height=80)
- box_next=Box(app, width = "fill", border=0,height=50)
- timemessage = Text(box_timer, text="You have 20 minutes left")
- questionmessage = Text(box_question, text="I ----- some friends for dinner last night.")
- questionmessage.text_size=16
- questionmessage.font = "Arial Black"
- buttona=PushButton(box_a,text="A",command=a123)
- buttonb=PushButton(box_b,text="B",command=b123)
- buttonc=PushButton(box_c,text="C",command=c123)
- buttond=PushButton(box_d,text="D",command=d123)
- nextbutton= PushButton(box_next,text = "Next",command=next)
- # Show the GUI on the screen, start listening to events.
- app.display()
Add Comment
Please, Sign In to add comment