1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-25 10:20:30 +02:00

Add messages for better understanding

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello
2023-03-24 11:50:10 +01:00
parent dec9f9be11
commit c9fcfcf498
3 changed files with 54 additions and 0 deletions

View File

@ -25,6 +25,12 @@ class Draw(models.Model):
verbose_name=_('current round'),
)
last_message = models.TextField(
blank=True,
default="",
verbose_name=_("last message"),
)
def get_state(self):
if self.current_round.current_pool is None:
return 'DICE_SELECT_POULES'
@ -40,6 +46,9 @@ class Draw(models.Model):
@property
def information(self):
s = ""
if self.last_message:
s += self.last_message + "<br><br>"
match self.get_state():
case 'DICE_SELECT_POULES':
if self.current_round.number == 1:
@ -62,6 +71,23 @@ class Draw(models.Model):
Les capitaines peuvent lancer un dé 100 en cliquant sur le gros bouton
pour déterminer l'ordre de tirage. L'équipe réalisant le plus gros score pourra
tirer en premier."""
case 'WAITING_DRAW_PROBLEM':
td = self.current_round.current_pool.current_team
s += f"""C'est au tour de l'équipe <strong>{td.participation.team.trigram}</strong>
de choisir son problème. Cliquez sur l'urne au milieu pour tirer un problème au sort."""
case 'WAITING_CHOOSE_PROBLEM':
td = self.current_round.current_pool.current_team
s += f"""L'équipe <strong>{td.participation.team.trigram}</strong> a tiré le problème
<strong>{td.purposed}</strong>. """
if td.purposed in td.rejected:
s += """Elle a déjà refusé ce problème auparavant, elle peut donc le refuser sans pénalité et
tirer un nouveau problème immédiatement, ou bien revenir sur son choix."""
else:
s += "Elle peut décider d'accepter ou de refuser ce problème. "
if len(td.rejected) >= settings.PROBLEM_COUNT - 5:
s += "Refuser ce problème ajoutera une nouvelle pénalité de 0.5 sur le coefficient de l'oral de læ défenseur•se."
else:
s += f"Il reste {settings.PROBLEM_COUNT - 5 - len(td.rejected)} refus sans pénalité."
s += "<br><br>" if s else ""
s += """Pour plus de détails sur le déroulement du tirage au sort,