{% if competition.trinders|length == 0 %}

Aún no se ha creado ningún juego

{% else %} {% for trinder in competition.trinders %}
{% set cont = 0 %} {% set playsUser = 0 %} {% set contvidas = 0 %} {% set completed = 0 %} {% set noinit = 0 %} {% set inprogress = 0 %} {# Comprobar que hay medallas asignadas al trivial #}
{{trinder.name}}
{{trinder.description}}
{{trinder.description}}
{{trinder.name}}
{# Logica trivial completado, en progreso, no iniciado #} {# {% for user in trivial.competition.users %} {% set finished_attempt = 0 %} {% set started_attempt = 0 %} {% for attempt in trivial.attempt %} {% set wrong_answer = 0 %} {% if attempt.trivial.id == trivial.id and attempt.user.id == user.id %} {% for tracking in attempt.tracking %} {% if tracking.status == 0 %} {% set wrong_answer = wrong_answer + 1 %} {% endif %} {% endfor %} {# or (wrong_answer == trivial.vidas and trivial.vidas != 0) #} {# {% if attempt.tracking|length == trivial.rondas or (wrong_answer == trivial.vidas and trivial.vidas != 0) or trivial.rondas == 0 %} {% set finished_attempt = finished_attempt + 1 %} {% if user.id == app.user.id %} {% set playsUser = playsUser + 1 %} {% endif %} {% elseif attempt.tracking|length > 0 %} {% set started_attempt = 1 %} {% endif %} {% endif %} {% endfor %} {% if trivial.plays == 0 and trivial.rondas == 0 %} {% if started_attempt != 0 %} {% set completed = completed + 1 %} {% else %} {% set noinit = noinit + 1 %} {% endif %} {% endif %} {% if trivial.plays == 0 and trivial.rondas > 0 %} {% if finished_attempt > 0 %} {% set completed = completed + 1 %} {% elseif finished_attempt == 0 and started_attempt == 0 %} {% set noinit = noinit + 1 %} {% else %} {% set inprogress = inprogress + 1 %} {% endif %} {% endif %} {% if trivial.plays > 0 and trivial.rondas > 0 %} {% if finished_attempt == trivial.plays %} {% set completed = completed + 1 %} {% if user.id == app.user.id %} {% set cont = 1 %} {% endif %} {% elseif finished_attempt == 0 and started_attempt == 0 %} {% set noinit = noinit + 1 %} {% else %} {% set inprogress = inprogress + 1 %} {% endif %} {% endif %} {% endfor %} #} {# END logica trivial #}
Vidas: {% if trinder.life == 0 %}∞{% else %}{{trinder.life}}{% endif %}
Tiempo: {% if trinder.time == 0 %}∞{% else %}{{trinder.time}}{% endif %}
Categorías: {{trinder.category|length}}
"now"|date("Y-m-d") %} class="btn trivial-user-btn-jugar-disabled" title="La campaña aún no ha empezado" data-toggle="tooltip" {% elseif trinder.competition.finalizeAt|date("Y-m-d") < "now"|date("Y-m-d") %} class="btn trivial-user-btn-jugar-disabled" title="La campaña ya ha finalizado" data-toggle="tooltip" {% else %} class="btn trivial-user-btn-jugar" id="play-game-user" class="trivial-actions-enabled" data-toggle="modal" data-target="#modalGame" data-href="#" data-id-trivial="{{trinder.id}}" {% endif %} >JUGAR
Registro
{% set contador = 0 %} {% for record in registro[trinder.id] %} {% set contador = contador + 1 %} {% endfor %} {% for unp in usersNotPlayed[trinder.id]|filter(contador < 5) %} {% set contador = contador + 1 %} {% endfor %}
{{record.user.userName}} {{record.totalScore}}
{{unp.userName}} 0
REGISTRO
"now"|date("Y-m-d") %} class="btn trivial-user-btn-jugar-disabled" title="La campaña aún no ha empezado" data-toggle="tooltip" {% elseif trinder.competition.finalizeAt|date("Y-m-d") < "now"|date("Y-m-d") %} class="btn trivial-user-btn-jugar-disabled" title="La campaña ya ha finalizado" data-toggle="tooltip" {% else %} class="btn trivial-user-btn-jugar" id="play-game-user" class="trivial-actions-enabled" data-toggle="modal" data-target="#modalGame" data-href="#" data-id-trivial="{{trinder.id}}" {% endif %} >JUGAR
{% endfor %} {% endif %} {#display navigation#} {{ include ('Badges/forms/reward.html.twig') }}