{% extends 'TopxiaWebBundle:Question:question-base-layout.html.twig' %}

{% block heading %}
  {% if question.type == 'single_choice' %}（单选）
  {% elseif question.type == 'choice' %}（多选）
  {% endif %}
{{ question.stem|bbCode2Html|raw }}
{% endblock %}

{% block body %}

  {% include 'TopxiaWebBundle:Question:question-choice-options.html.twig' %}

{% if itemResult.answer|default(null) %}
  {% set answerChoiceIndex = itemResult.answer|split(',') %}
{% endif %}
  <div class="question-choices-inputs">
    {% for key, choice in question.metas.choices %}
      {% set choiceIndex = (65+key)|chr %}
      <label class="checkbox-inline">
        <input id="question-{{ question.id }}-input-{{ choiceIndex }}" type="checkbox" name="answer[{{ question.id }}][]" value="{{ key }}"  {% if key in answerChoiceIndex|default(null) %}checked{% endif %}> {{ choiceIndex }}
      </label>
    {% endfor %}
  </div>

{% endblock %}

{% block footer %}

{% endblock %}