Python Forum
Need To Create Simple Mutiple Choice Quiz In Tkinter
Thread Rating:
  • 3 Vote(s) - 2.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need To Create Simple Mutiple Choice Quiz In Tkinter
#1
i am trying to create a simple quiz in tkinter but i have no proper reference how to get it done properly i researched alot on google but as i am new to python i am confused as to how exactly show i get it done i tried many tutorials and reference but none have helped getting me a simple one  can anyone help ?
Reply
#2
(Apr-01-2017, 01:02 AM)Rashi Wrote: i tried many tutorials and reference
Then you should have at least a skeleton code of an idea? We cant just put code up for you, then we would be doing the work.
Recommended Tutorials:
Reply
#3
yes i do have i'll make new thread to do it alone with code
Reply
#4
import sys
from tkinter import *

root=Tk()
name=StringVar(value='Enter Name Here')
cn=StringVar(value='Enter CN Here')

def random():
    mlabel=Label(root,text="U CLicked Me").pack()
    return

def random1():
    mtext=name.get()
    mno=cn.get()
    mlabel2=Label(root,text=mtext).pack()
    mlabel3=Label(root,text=mno).pack()

def mquit():
    mexit=messagebox.askyesno(title="Quit",message="Quit The Test ?")
    if mexit > 0:
        root.destroy()
        return







root.geometry('700x700+400+400')
root.title('Welcome To Quiz')

mainmenu=Menu(root)

root.configure(menu=mainmenu)

submenu=Menu(mainmenu,tearoff=0)
mainmenu.add_cascade(label="Options",menu=submenu)
submenu.add_command(label="Restart",command=random)
submenu.add_command(label="Close",command=mquit)

mentry=Entry(root,textvariable=name).pack()
mentry=Entry(root,textvariable=cn).pack()
mbutton=Button(root,text='Ok',command=random1,fg='red',bg='blue').pack()








root.mainloop()
i tried to google & searching on internet but no luck and this is soo far what i have done now all i want to do add is 20question or so but i have no idea how do i do it sorry i am new to tkinter help would really be appreciated , i was planning to add all question and answer in text file and then import it but i don't know how to get the radio buttons to work with the options in the text file so was planning to do everything in the file and make the code longer
Reply
#5
For a reference, download the following: http://infohost.nmt.edu/tcc/help/pubs/tk...index.html
a good place to find sample code is here: http://nullege.com/
There is a repository of almost 66 thousand python scripts.
Reply
#6
(Apr-01-2017, 03:50 AM)Larz60+ Wrote: For a reference, download the following: http://infohost.nmt.edu/tcc/help/pubs/tk...index.html
a good place to find sample code is here: http://nullege.com/
There is a repository of almost 66 thousand python scripts.

i checked the documentation but its really confusing and i am not used to nullege though i had already searched github but i didn't find that could help me in my current program all i need to know is how do i get my questions and answer to work with radio buttion or directly how to add them to the program
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  I'm trying to figure out if this is a bug from a simple quiz at Future Skill fabstr1 3 1,514 Jan-25-2023, 10:06 PM
Last Post: deanhystad
  [TkInter]Simple Python Homework zaji_123 4 4,058 Jan-01-2021, 07:09 PM
Last Post: EliesBe
  How to create simple thread safe singletone that protect __init__ on import module umen 0 1,652 Apr-16-2020, 09:43 AM
Last Post: umen
  Using random.choice v.v Dawkinz 8 3,504 Aug-31-2019, 04:42 PM
Last Post: Dawkinz
  [URGENT] Trying to create a simple password manager in python equanox314 5 11,177 Jul-28-2017, 08:04 AM
Last Post: DeaD_EyE
  Just some second choice answers help please ajaY 6 5,080 Apr-07-2017, 08:25 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020