<commit_before>{% extends '::base.html.twig' %}

{% block title %}{{ survey.title }} Results{% endblock %}

{% block body -%}
    {% set surveyCount = survey.users|length %}
    <div class="page-header">
        <h1>{{ survey.title }} <small>{{ surveyCount }} {{ (surveyCount == 1) ? 'participant' : 'participants' }}</small></h1>
    </div>

    {% for question in survey.questions %}
        <h3>{{ question.title }}</h3>
        <dl class="dl-horizontal">
            {% for answer in question.answers %}
                {%- set other = [] -%}
                {%- for vote in answer.votes -%}
                    {%- if vote.other -%}
                        {%- set other = other|merge([vote.other]) -%}
                    {%- endif -%}
                {%- endfor -%}

                <dt>{{ answer.title|raw }}</dt>
                <dd>
                    {%- set count = answer.votes|length -%}
                    {{ count }} {{ (count == 1) ? 'vote' : 'votes' }}
                    {% if other is not empty -%}
                        (
                        {%- for response in other -%}
                            <code>{{ response }}</code>
                            {{- not loop.last ? ', '}}
                        {%- endfor -%}
                        )
                    {%- endif -%}
                </dd>
            {% endfor %}
            {% if not question.required %}
                <dd>
                    {{ surveyCount - question.voterCount }} didn't answer
                </dd>
            {% endif %}
        </dl>
        <hr>
    {% endfor %}

    <a class="btn btn-default" href="{{ path('survey') }}">
        Back to the list
    </a>
{% endblock %}<commit_msg>Allow seeing the full answer in case it gets truncated in the results<commit_after>{% extends '::base.html.twig' %}

{% block title %}{{ survey.title }} Results{% endblock %}

{% block body -%}
    {% set surveyCount = survey.users|length %}
    <div class="page-header">
        <h1>{{ survey.title }} <small>{{ surveyCount }} {{ (surveyCount == 1) ? 'participant' : 'participants' }}</small></h1>
    </div>

    {% for question in survey.questions %}
        <h3>{{ question.title }}</h3>
        <dl class="dl-horizontal">
            {% for answer in question.answers %}
                {%- set other = [] -%}
                {%- for vote in answer.votes -%}
                    {%- if vote.other -%}
                        {%- set other = other|merge([vote.other]) -%}
                    {%- endif -%}
                {%- endfor -%}

                <dt title="{{ answer.title|striptags }}">
                    {{- answer.title|raw -}}
                </dt>
                <dd>
                    {%- set count = answer.votes|length -%}
                    {{ count }} {{ (count == 1) ? 'vote' : 'votes' }}
                    {% if other is not empty -%}
                        (
                        {%- for response in other -%}
                            <code>{{ response }}</code>
                            {{- not loop.last ? ', '}}
                        {%- endfor -%}
                        )
                    {%- endif -%}
                </dd>
            {% endfor %}
            {% if not question.required %}
                <dd>
                    {{ surveyCount - question.voterCount }} didn't answer
                </dd>
            {% endif %}
        </dl>
        <hr>
    {% endfor %}

    <a class="btn btn-default" href="{{ path('survey') }}">
        Back to the list
    </a>
{% endblock %}
{'fraction_non_alphanumeric': 0.17159763313609466, 'fraction_numerical': 0.0033812341504649195, 'mean_word_length': 1.1346963319302465, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1551082', 'n_tokens_mistral': 1086, 'n_tokens_neox': 943, 'n_words': 224}