Quick actions

{% if quiz is same as (season.activeQuiz) %} {{ 'Deactivate Quiz'|trans }} {% else %} {{ 'Make active'|trans }} {% endif %}

{{ 'Questions'|trans }}

{%~ for question in quiz.questions ~%}

    {%~ for answer in question.answers %} {{ answer.text }} {% if answer.candidates|length > 0 %} ({{ answer.candidates|map(c => c.name)|join(', ') }}) {% endif %} {%~ else %} {{ 'There are no answers for this question'|trans -}} {%~ endfor %}
{% else %} {{ 'EMPTY'|trans }} {% endfor %}

{{ 'Candidates'|trans }}

{% for candidate in season.candidates %} {% set quizCandidate = null %} {% for qc in quiz.candidateData %} {% if qc.candidate.id.toString == candidate.id.toString %} {% set quizCandidate = qc %} {% endif %} {% endfor %} {% set givenAnswersCount = 0 %} {% for givenAnswer in candidate.givenAnswers %} {% if givenAnswer.quiz.id.toString == quiz.id.toString %} {% set givenAnswersCount = givenAnswersCount + 1 %} {% endif %} {% endfor %} {% endfor %}
{{ 'Name'|trans }} {{ 'Quiz Status'|trans }} {{ 'Candidate Status'|trans }} {{ 'Actions'|trans }}
{{ candidate.name }} {% if quizCandidate and quizCandidate.started %} {% if givenAnswersCount >= quiz.questions|length %} {{ 'Completed'|trans }} {% else %} {{ 'In Progress'|trans }} ({{ givenAnswersCount }}/{{ quiz.questions|length }}) {% endif %} {% else %} {{ 'Not Started'|trans }} {% endif %} {% if quizCandidate == null or quizCandidate.active %} {{ 'Active'|trans }} {% else %} {{ 'Inactive'|trans }} {% endif %} {% if quizCandidate == null or quizCandidate.active %} {{ 'Deactivate'|trans }} {% else %} {{ 'Activate'|trans }} {% endif %}
{# Modal Clear #} {# Modal Delete #}