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

{% block heading %}
  {{ question.stem|fill_question_stem_html|bbCode2Html|raw }}
{% endblock %}

{% block body %}

{% set fileItemResultAnswer = itemResult.answer|split(',') %}

{% if itemResult.status == 'right' %}

  {% set itemResultStatus = '你答对了' %}

{% elseif itemResult.status == 'wrong' %}

  {% set itemResultStatus = '回答错误' %}

{% elseif itemResult.status == 'partRight' %}

  {% set itemResultStatus = '部分回答正确' %}

{% elseif itemResult.status == 'noAnswer' %}

  {% set itemResultStatus = '你未回答' %}

{% endif %}

  <div class="question-fill-inputs ">
    <div class="">
      <div class="homework-question-fill">
         <ul>
          {% for index,rightAnswer in question.answer %}

            <li>
              填空({{index+1}})： 正确答案 
              <strong>{{ rightAnswer|join(' 或 ') }}</strong>
              {% if fileItemResultAnswer[index] is defined %}
              , 回答是

              <strong class={% if itemResult.status == 'right' %}"question-text-success"{% elseif itemResult.status == 'wrong' %}"question-text-danger"{% else %}"text-warning"{% endif %}>{{ fileItemResultAnswer[index] }}</strong>。
              {% else %}
              未回答
              {% endif %}

              {% if itemResult.status == 'right' %}
                  <span class="glyphicon glyphicon-ok question-text-success">
              {% elseif itemResult.status == 'wrong' %}
                  <span class="glyphicon glyphicon-remove question-text-danger">
              {% endif %}
            </li>

          {% endfor %}
         </ul>

         {% if itemResult.status == "right" %}
            <p class="text-success">回答正确。</p>
          {% elseif itemResult.status == "partRight" %}
            <p class="text-warning">回答部分正确。</p>
          {% else %}
            <p class="text-danger">回答错误。</p>
        {% endif %}

      </div>
    </div>
  </div>
{% endblock %}

{% block footer %}

{% endblock %}