calculate_score_1
is not a method of the instance, but is defined inside the __init__
method. Thus, that method should not have the self
parameter. Remove that parameter, then it should work. If you need it (you seem not to) you can still use the self
parameter of the outer __init__
method.
If you want to access the score
from another class (or in fact from another method of the same class) you have to make it a member of the instance, by defining it as self.score = ...
. You can then access it like this: your_question_1_window_instance.score
.
Finally, if you have "ten classes for ten questions" you should try to find some common ground for all those questions and create either a common super class or even one class that can be parametrized to fit all the questions. You just need the title, the type (select one/select many) and a list of answers, and which ones are correct. Everything else -- creating the check boxes, checking the answer, etc. -- should always be the same.