{% set cont = 0 %} {% set contvidas = 0 %} {% set completed = 0 %} {% set noinit = 0 %} {% set inprogress = 0 %} {% 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 %} {% if attempt.tracking|length == trivial.rondas and ((wrong_answer < trivial.vidas and trivial.vidas != 0) or (trivial.vidas == 0)) %} {% set finished_attempt = finished_attempt + 1 %} {% 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 %} {% set posicion = 0 %} {% set intentos = 0 %} {% set contestadas = 0 %} {% set puntuacionMaxima = 0 %} {# Logica para saber posicion preguntas contestadas... del usuario logueado #} {% if trivial.modality == "COOPERATIVO" and pagination[0] is defined %} {% set pagination = pagination[0]['attempt'] %} {% endif %} {% for attempt in pagination %} {% if app.user.id == attempt.user.id and (trivial.modality == "INDIVIDUAL" or trivial.modality == "COOPERATIVO") %} {% set posicion = loop.index %} {% for total_intentos in total_attempts %} {% if total_intentos.user_id == attempt.user.id%}{% set intentos = total_intentos.total_intentos %}{% endif %} {% endfor %} {% for total_contestadas in total_answers %} {% if total_contestadas.user_id == attempt.user.id%}{% set contestadas = total_contestadas.total_contestadas %}{% endif %} {% endfor %} {% set puntuacionMaxima = attempt.totalScore %} {% endif %} {% endfor %}
{{trivial.name}}
{% if app.user.role == "ROLE_ADMIN" or app.user.role == "ROLE_TUTOR" %}
Total jugadores
{{trivial.competition.users|length}}
Completados
{{completed}}
No iniciado
{{noinit}}
En progreso
{{inprogress}}
{% else %}
Ranking de jugadores
{% endif %}