In a 5-teams pool, the order of two teams that present the same problem is random
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
parent
a4c7951475
commit
18bd2c7c18
|
@ -2,7 +2,7 @@
|
|||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
from collections import OrderedDict
|
||||
from random import randint
|
||||
from random import randint, shuffle
|
||||
|
||||
from asgiref.sync import sync_to_async
|
||||
from channels.generic.websocket import AsyncJsonWebsocketConsumer
|
||||
|
@ -452,6 +452,8 @@ class DrawConsumer(AsyncJsonWebsocketConsumer):
|
|||
p_index = 0
|
||||
for pb, tds in problems.items():
|
||||
if len(tds) == 2:
|
||||
# Le règlement demande à ce que l'ordre soit tiré au sort
|
||||
shuffle(tds)
|
||||
tds[0].passage_index = p_index
|
||||
tds[1].passage_index = p_index + 1
|
||||
p_index += 2
|
||||
|
|
Loading…
Reference in New Issue