From e0de9a4f315990842e75b284d3540cbe9a9f2212 Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Mon, 25 Nov 2013 19:26:57 +0100 Subject: [PATCH] Don't readd points on visited questions --- game.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/game.py b/game.py index dad4441..0ce3384 100644 --- a/game.py +++ b/game.py @@ -147,19 +147,26 @@ class SeopardyGame(QtGui.QWidget): return self._inOtherWindow = True answers = self.gamestate.get_answers(section, number) + wasAnswered = (answers is not None and answers.is_answered()) - qwin = QuestionWindow(self.players, section, number, self.questions.get_question(section, number), answers, self) + question = self.questions.get_question(section, number) + if question["Double-Jeopardy"]: + print("maunz") + + return + + qwin = QuestionWindow(self.players, section, number, question, answers, self) qwin.showFullScreen() qwin.exec_() self._inOtherWindow = False - answers = qwin.get_answers() - self.gamestate.set_answers(section, number, answers) - # add points to players - # FIXME: Note that we cannot add points when revisiting a question - self._set_player_points(answers) + if not wasAnswered: + answers = qwin.get_answers() + self.gamestate.set_answers(section, number, answers) + + self._set_player_points(answers) # restyle the button self._restyle_button(section, number, answers)