|
|
@ -151,13 +151,13 @@ class SeopardyGame(QtGui.QWidget):
|
|
|
|
wasAnswered = (answers is not None and answers.is_answered())
|
|
|
|
wasAnswered = (answers is not None and answers.is_answered())
|
|
|
|
|
|
|
|
|
|
|
|
question = self.questions.get_question(section, number)
|
|
|
|
question = self.questions.get_question(section, number)
|
|
|
|
|
|
|
|
dj = None
|
|
|
|
if not wasAnswered and question["Double-Jeopardy"]:
|
|
|
|
if not wasAnswered and question["Double-Jeopardy"]:
|
|
|
|
print("maunz")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dwin = DoubleJeopardyWindow(self.players, number*100, self.currentPlayer, parent=self)
|
|
|
|
dwin = DoubleJeopardyWindow(self.players, number*100, self.currentPlayer, parent=self)
|
|
|
|
dwin.exec_()
|
|
|
|
dwin.exec_()
|
|
|
|
|
|
|
|
dj = (dwin.get_player(), dwin.get_chosen_points())
|
|
|
|
|
|
|
|
|
|
|
|
qwin = QuestionWindow(self.players, section, number, question, answers, self)
|
|
|
|
qwin = QuestionWindow(self.players, section, number, question, answers, dj, self)
|
|
|
|
qwin.showFullScreen()
|
|
|
|
qwin.showFullScreen()
|
|
|
|
qwin.exec_()
|
|
|
|
qwin.exec_()
|
|
|
|
|
|
|
|
|
|
|
@ -177,13 +177,21 @@ class SeopardyGame(QtGui.QWidget):
|
|
|
|
self._restyle_button(section, number, answers)
|
|
|
|
self._restyle_button(section, number, answers)
|
|
|
|
|
|
|
|
|
|
|
|
def _set_player_points(self, answers, rollback=False):
|
|
|
|
def _set_player_points(self, answers, rollback=False):
|
|
|
|
for player, correct in answers.get_tries():
|
|
|
|
for i, (player, correct) in enumerate(answers.get_tries()):
|
|
|
|
prefix = 1
|
|
|
|
prefix = 1
|
|
|
|
if rollback:
|
|
|
|
if rollback:
|
|
|
|
prefix *= -1
|
|
|
|
prefix *= -1
|
|
|
|
if not correct:
|
|
|
|
if not correct:
|
|
|
|
prefix *= -1
|
|
|
|
prefix *= -1
|
|
|
|
player.add_points(answers.points()*prefix)
|
|
|
|
|
|
|
|
|
|
|
|
points = 0
|
|
|
|
|
|
|
|
print(i, answers.get_dj_points())
|
|
|
|
|
|
|
|
if i == 0 and answers.get_dj_points() is not None:
|
|
|
|
|
|
|
|
points = answers.get_dj_points()
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
points = answers.points()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
player.add_points(prefix*points)
|
|
|
|
|
|
|
|
|
|
|
|
def _restyle_button(self, sec, qno, answers):
|
|
|
|
def _restyle_button(self, sec, qno, answers):
|
|
|
|
|
|
|
|
|
|
|
|