I think its worked this time so appreciated your patience. You should of received the funds hope you did and big big thank you for all your work-
Thats brilliant much appreciated your help and thank you.
Yes definitely wishing a fantastic week ahead
Hope you are well the quiz just needs the following so if you be so kind to help and to look at the solution below and see if you get it to work ever more amazing.
When a question is presented to the user all the radio buttons are selected, this would be better is none were selected.
Here Ingo is the possible solution
When using radio buttons the attribute 'variable' is crucial!
so when the radiobutton was configured in the Quiz_ui file the value of the attribute 'variable' for all of them was set to 'self.answerButton'.
self._radiobutton_A1 = tkinter.Radiobutton(root,
activebackground = "#cccccc",
anchor = "w",
background = "#ffff00",
compound = "left",
font = "Tahoma 10",
highlightbackground = "#cccccc",
justify = "left",
text = "",
textvariable = self.var_A1,
value = 1,
>>>>>>> variable = self.answerButton,
wraplength = 400,
(>>>>>>>>>) is my empasis
and self.answerButton was itself defined in the Quiz_ui file as:
self.answerButton = tkinter.StringVar(root)
If the value of this variable is set to "0" then all radio buttons will be deselected.
(That's it - that's all you have to do so Ingo could you test and see it works and then resend much appreciate !!)
When the user selects a radioButton then the value of this variable will change to the value of the attribute 'value' which was set when the radioButton was configured.
self._radiobutton_A2 = tkinter.Radiobutton(root,
>>>>>>> value = 2,
variable = self.answerButton,
Hence in the Quiz.py file when you want to test if no radiobutton has been selected :
if int(self.answerButton.get()) == 0:
(self.answerButton.get() will return a string e.g. " 0 ".
wrapping this within the function call int( ~) will give an integer e.g. 0
which is easier to test !!)
And if you want to deselect all radio buttons :
And if you wanted to test if a particular radioButton was set (which you don't because
of the way you have implemented your logic!)
e.g. 2nd radio button :
if int(self.answerButton.get()) == 2: