Hi
having a simplified class like this that regulate a quiz game:
class Game():
def __init__(self,username):
...
self.username=username
self.question_list=db.getQuestions()
self.game_over=False
def get_question(self):
...
if self.question_list.is_not_empty():
return question
def check_answer(answer)
...
if answer.is_correct():
self.game_over=False
else:
self.game_over=True
and having a web controller that receive input parameters like username, questions and answers..is it correct to use Game class directly from controller?
I ask this question because looking at controller code, i feel guilty to have coded inside some logic too; for example controller instantiates Game just when username is received and then calls get_question and check_answer in order.
Do you think is more correct to have another "layer" that receives input parameters from controller and talk directly to Game class?
Thanks Michele