{% extends 'admin/layout.html.twig' %}

{% set menu = 'admin_course_data' %}

{% block main %}
    <div class="table-responsive">
        <table class="table table-bordered" style="word-break:break-all;text-align:center;">
          <tr class="active">
            <td>{{'课时名'|trans}}</td>
            <td>{{'课时学习人数'|trans}}</td>
            <td>{{'课时完成人数'|trans}}</td>
            <td>{{'课时平均学习时长(分)'|trans}}</td>
            <td>{{'音视频时长(分)'|trans}}</td>
            <td>{{'音视频平均观看时长(分)'|trans}}</td>
            <td>{{'测试平均得分'|trans}}</td>
          </tr>
          {% if lessons %}
            {% for lesson in lessons %}
              <tr>
                <td>{{lesson.title}}{% if lesson.type == "text" %}（{{'图文'|trans}}）{% elseif lesson.type == 'video' %}（{{'视频'|trans}}）{% elseif lesson.type == 'audio' %}（{{'音频'|trans}}）{% elseif lesson.type == 'testpaper' %}（{{'试卷'|trans}}）{% elseif lesson.type == 'ppt' %}（ppt）{% endif %}</td>
                <td>{{lesson.LearnedNum}}</td>
                <td>{{lesson.finishedNum}}</td>
                <td>{{(lesson.learnTime/60)|round(0, 'floor')}}</td>
                <td>{% if lesson.type =='audio' or lesson.type =='video' %}{{lesson.length}}{% else %}----{% endif %}</td>
                <td>{% if lesson.mediaSource != 'self' and lesson.type == 'video' %}{{'无'|trans}}{% elseif lesson.type =='audio' or lesson.type =='video'%}{{(lesson.watchTime/60)|round(0, 'floor')}}{% else %}----{% endif %}</td>
                <td>{% if lesson.type =='testpaper' %}{{lesson.score}}{% else %}----{% endif %}</td>
              </tr>
            {% endfor %}
          {% endif %}
        </table>
  
    </div>


{% endblock %}