Skip to content
This repository has been archived by the owner on Jan 4, 2025. It is now read-only.

Commit

Permalink
FIX: Only throw error if player count is LESS than question count
Browse files Browse the repository at this point in the history
  • Loading branch information
claussmann committed Feb 12, 2024
1 parent ddd342e commit 0dafb89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyteamquiz/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self, catalgogues:Set[QuestionCatalogueFile], teams:Set[str]):
raise TeamNameError("Team name must be between 1 and 30 chars.")

# Ensure each player gets the same number of questions
if len(self.questions) <= len(self.teams):
if len(self.questions) < len(self.teams):
raise NotEnoughQuestionsError("You have fewer questions than teams. Select more catalogues.")
pick_questions = len(self.questions) - len(self.questions) % len(self.teams)
self.questions = self.questions[:pick_questions]
Expand Down

0 comments on commit 0dafb89

Please sign in to comment.