From ef2f24f6f5f548987655f77a0a385c36aa4a71f2 Mon Sep 17 00:00:00 2001 From: Mawoka Date: Fri, 7 Oct 2022 13:13:37 +0200 Subject: [PATCH] :bug: Fixed in-human-count --- classquiz/routers/live.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/classquiz/routers/live.py b/classquiz/routers/live.py index c1a0009..9ac2f10 100644 --- a/classquiz/routers/live.py +++ b/classquiz/routers/live.py @@ -112,7 +112,10 @@ async def get_live_game_data( ga_1 = GameAnswer1(id=i, answers=[GameAnswer2.parse_obj(i) for i in res]) data.answers.append(ga_1) player_count = await redis.scard(f"game_session:{game_pin}:players") - game = _GetLivePlayGame(**{**game.dict(), "total_questions": len(game.questions)}) + total_questions = len(game.questions) + if in_human_count: + total_questions += 1 + game = _GetLivePlayGame(**{**game.dict(), "total_questions": total_questions}) if in_human_count: player_count += 1 game.current_question += 1