{{ js_template|safe }}
<div class="poll-block themed-xblock" data-private="{% if private_results %}1{% endif %}"
     data-can-vote="{% if can_vote %}1{% endif %}">
    <div class="poll-block-form-wrapper">
        <h3 class="poll-header">{{block_name}}</h3>
        <form>
            <table class="survey-table">
                <thead>
                  <tr>
                      <td></td>
                      {% for answer, label in answers %}
                        <th id="{{block_id}}-{{answer}}" class="survey-answer">{{label}}</th>
                      {% endfor %}
                  </tr>
                </thead>
            {% for key, question in questions %}
                <tr class="survey-row" role="group" aria-labelledby="{{block_id}}-{{key}}">
                    <th id="{{block_id}}-{{key}}" class="survey-question">
                        {% if question.img %}
                            <div class="poll-image-td">
                                <img src="{{question.img}}" alt="{{question.img_alt|default_if_none:''}}"/>
                            </div>
                        {% endif %}
                      {{question.label|safe}}
                    </th>
                {% for answer, label in answers %}
                    <td class="survey-option">
                      <label>
                        <input type="radio"
                               name="{{key}}"
                               value="{{answer}}"{% if question.choice == answer %} checked{% endif %}
                               aria-labelledby="{{block_id}}-{{answer}}"
                               />
                      </label>
                    </td>
                {% endfor %}
                </tr>
            {% endfor %}
            </table>
            <input class="input-main" type="button" name="poll-submit" value="Submit" disabled />
        </form>
        <div class="poll-voting-thanks{% if not choices or can_vote %} poll-hidden{% endif %}"><span>Thank you.</span></div>
        <div class="poll-submissions-count poll-hidden">
            You have used <span class="poll-current-count">{{ submissions_count }}</span>
            out of <span class="poll-max-submissions">{{ max_submissions }}</span> submissions.
        </div>
        {% if feedback %}
            <div class="poll-feedback-container{% if not choices %} poll-hidden{% endif %}">
                <hr />
                <h3 class="poll-header">Feedback</h3>
                <div class="poll-feedback">
                    {{feedback|safe}}
                </div>
            </div>
        {% endif %}

        {% if can_view_private_results %}
            <div class="view-results-button-wrapper"><button class="view-results-button">View results</button></div>
        {% endif %}
    </div>
</div>
