<table class="table table-striped table-hover">
  <tbody>
    {% if paperResults|default(null) %}
      {% for key,paperResult in paperResults %}
        {% set homework = testpapers[paperResult.testId]|default(null) %}
        {% set user = users[paperResult.userId]|default(null) %}
        {% set task = tasks[paperResult.lessonId]|default(null) %}
        {% set course = courses[paperResult.courseId]|default(null) %}
        {% set courseSet = courseSets[paperResult.courseSetId]|default(null) %}

        <tr>
          <td width="55%" class="vertical-middle">
            {{ task.title|default(null)|plain_text(60) }}
            <div>
              <small class="color-gray">
                {{ 'come.from'|trans }}<a class="link-primary" href="{{ path('course_show',{id:course.id}) }}" target="_blank">《{{get_formated_course_title(course)}}》</a>
              </small>
              <small class="color-gray mhs">•</small>
              <small class="color-gray">{{ paperResult.beginTime|date('site.date_format'|trans) }}</small>
            </div>
          </td>
          <td width="20%" class="vertical-middle">
            {{ web_macro.user_link(user) }} <br>
            <small class="color-gray">{{ paperResult.endTime|date("Y-n-d H:i") }} {{'my.learning.homework.submit_paper'|trans}}</small>
          </td>
          <td width="30%" class="vertical-middle">
            {% if status == 'reviewing' %}
              <a class="link-primary" href="{{ path('course_manage_homework_check', {id:paperResult.courseId,resultId:paperResult.id,source:source|default('course'),targetId:targetId|default(0),action:'check' }) }}" target="_blank">{{'my.learning.homework.check_paper'|trans}}</a>
            {% else %}
              <a class="link-primary" href="{{ path('homework_result_show',{resultId:paperResult.id,action:'check' }) }}" target="_blank" >{{'my.learning.homework.watch_paper'|trans}}</a>
            {% endif %}
          </td>
        </tr>
      {% endfor %}
    {% else %}
      {% if status == 'reviewing' %}
        <div class="empty">{{'my.learning.homework.reviewing_empty'|trans}}</div>
      {% else %}
        <div class="empty">{{'my.learning.homework.check_finished_empty'|trans}}</div>
      {% endif %}
    {% endif  %}
  </tbody>
</table>
{{ web_macro.paginator(paginator) }}
