{% 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-result.html.twig' %}

{% if itemResult.answer|default(null) or itemResult.answer == 0 %}
  {% set choiceIndex = itemResult.answer %}
{% endif %}
  <div class="homework-question-result">

    {% if itemResult.status == 'right' %}
     <span class="glyphicon glyphicon-ok question-text-success"></span> 你答对了!
    {% elseif itemResult.status == 'wrong' %}
       <span class="glyphicon glyphicon-remove question-text-danger"></span> 你答错了,你选择了<strong class="question-text-danger">
       {% for key,choice in choiceIndex %}
          {% if choice != '-1' %}
          {{ (65+choice)|chr }}
          {% endif %}
        {% endfor %}
       </strong>
  {% elseif itemResult.status == 'partRight' %}
       <span class="glyphicon glyphicon-remove question-text-danger"></span> 你部分答对,你选择了<strong class="question-text-danger">
           {% for key,choice in choiceIndex %}
          {% if choice != '-1' %}
          {{ (65+choice)|chr }}
          {% endif %}
        {% endfor %}
       </strong>
    {% elseif itemResult.status == 'noAnswer' %}
　　　  <span class="glyphicon glyphicon-remove question-text-danger pull-left">你未答题</span>
    {% endif %}
</div>

{% endblock %}

{% block footer %}

{% endblock %}