{% set errors = item.errors|default([]) %}
<div class="subject-item js-subject-item js-subject-main-item" id="{% if token|default(null) %}{{token}}{% else %}{{ key }}{% endif %}">
  <div class="subject-item__title">
    <span class="subject-item__number js-subject-item-number {% if errors is not empty %}subject-item__number--danger{% endif %}">
    {% if seq|default(null) %}
      {{ seq }}
    {% else %}
      {{ loop.index }}
    {% endif %}
    </span>
    {% if errors.stem is not defined %}
      <div class="subject-item__stem">{{ item.stem|bbCode2Html|raw|nl2br }}</div>
    {% elseif errors.stem.code == 100001 %}
      <span class="single-item__text--danger">{{ 'course.testpaper_manage.import.re_edit.error_no_stem'|trans }}</span>
    {% endif %}
  </div>
  <div class="subject-item__body">
    {% if errors.answer is not defined %}
      <div class="subject-table">
        <span class="subject-table-label">{{ 'course.testpaper_manage.import.re_edit.answer'|trans }}：</span>
        <div class="subject-table-cell">{{ item.answer|striptags('<br><img>')|bbCode2Html|raw|nl2br }}</div>
      </div>
    {% elseif errors.answer.code == 100003 %}
      <span class="single-item__text--danger">{{ 'course.testpaper_manage.import.re_edit.error_no_answer'|trans }}</span>
    {% endif %}
    {% if item.analysis is not empty %}
      <div class="subject-item__explain cd-mt8"><span class="subject-explain-label">{{ 'course.testpaper_manage.import.re_edit.explain'|trans }}：</span>{{ item.analysis|striptags('<br><img>')|bbCode2Html|raw|nl2br }}</div>
    {% endif %}
  </div>
  {% include 'testpaper/subject/common.html.twig' with { type: 'essay', difficulty: item.difficulty, score: item.score, category: item.category|default() } %}
</div>