✨ Closes #164
This commit is contained in:
@@ -338,7 +338,14 @@ async def submit_answer(sid: str, data: dict):
|
|||||||
answers.json(),
|
answers.json(),
|
||||||
ex=18000,
|
ex=18000,
|
||||||
)
|
)
|
||||||
|
answers = _AnswerDataList.parse_raw(await redis.get(f"game_session:{session['game_pin']}:{data.question_index}"))
|
||||||
|
player_count = await redis.scard(f"game_session:{session['game_pin']}:players")
|
||||||
|
if len(answers.__root__) == player_count:
|
||||||
|
await sio.emit(
|
||||||
|
"question_results",
|
||||||
|
await redis.get(f"game_session:{session['game_pin']}:{data.question_index}"),
|
||||||
|
room=session["game_pin"],
|
||||||
|
)
|
||||||
# await redis.set(f"game_data:{session['game_pin']}", json.dumps(data))
|
# await redis.set(f"game_data:{session['game_pin']}", json.dumps(data))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,8 @@
|
|||||||
socket.on('question_results', (data) => {
|
socket.on('question_results', (data) => {
|
||||||
try {
|
try {
|
||||||
question_results = JSON.parse(data);
|
question_results = JSON.parse(data);
|
||||||
|
final_results_clicked = true;
|
||||||
|
timer_res = '0';
|
||||||
} catch {
|
} catch {
|
||||||
question_results = undefined;
|
question_results = undefined;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user