<div>
    <div>
        <label>{{ 'number_of_respondents'|trans({}, 'survey') }} :</label>
        <span>{{ nbRespondents }}</span>
    </div>

    {% if choices|length > 0 %}
        <br>
        <table class="table table-responsive text-center">
            <tr>
                <th class="text-center">{{ 'choice'|trans({}, 'survey') }}</th>
                <th class="text-center">{{ 'number_of_responses'|trans({}, 'survey') }}</th>
                <th class="text-center">{{ 'ratio'|trans({}, 'survey') }}</th>
            </tr>

            {% for choice in choices %}
                {% set choiceId = choice.getId() %}
                <tr>
                    <td>{{ choice.getContent()|raw }}</td>
                    <td>
                        {% if choicesCount[choiceId] is defined %}
                            {{ choicesCount[choiceId] }}
                        
                            {% if choice.isOther() and choicesCount[choiceId] > 0 %}
                                &nbsp;
                                <i id="show-other-answers-btn"
                                   class="fa fa-file-text-o pointer-hand"
                                   data-survey-id="{{ survey.getId() }}"
                                   data-question-id="{{ question.getId() }}"
                                   data-choice-id="{{ choice.getId() }}"
                                   data-other-max="{{ otherMax }}"
                                >
                                </i>
                            {% endif %}
                        {% else %}
                            0
                        {% endif %}
                    </td>
                    <td>
                        {% if choicesRatio[choiceId] is defined %}
                            {{ choicesRatio[choiceId] }} %
                        {% else %}
                            0 %
                        {% endif %}
                    </td>
                </tr>
            {% endfor %}
        </table>
    {% endif %}
</div>

{% block javascripts %}
    <script
        src='{{ asset('bundles/clarolinesurvey/js/showMultipleChoiceQuestionResults.js') }}'
        type="text/javascript">
    </script>
{% endblock %}