{% block content %}
    {% autoescape false %}
        <div class="list-exercise">
            <ul class="list-group list-group-flush">
                {% for item in data %}
                <li class="list-group-item">
                    <div class="row">
                        <div class="col-md-5">
                            <h5>
                                <img src="{{ 'quiz.png'|icon(22) }}">
                                <a href="{{ item.url }}">
                                    {{ item.title }}
                                </a>
                            </h5>
                            {% if item.description %}
                                <div class="description">
                                    {{ item.description }}
                                </div>
                            {% endif %}
                        </div>
                        <div class="col-md-4">

                            <strong>{{ 'Quantity Questions'|trans }}:</strong> {{ item.number_questions }}

                            {% if item.score %}
                                <div class="progress">
                                    <div class="progress-bar" role="progressbar" style="width: {{ item.score.percentage }}%" aria-valuenow="{{ item.score.percentage }}" aria-valuemin="0" aria-valuemax="100">
                                        {{ item.score.percentage }}%
                                    </div>
                                </div>
                            {% else %}
                                <div class="progress">
                                    <div class="progress-bar" role="progressbar" style="width: 0%" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
                                        0%
                                    </div>
                                </div>
                            {% endif %}
                        </div>
                        <div class="col-md-3">
                            {% if is_teacher %}
                                <div class="toolbar">
                                    {{ item.actions }}
                                </div>
                            {% else %}
                                {{ 'Latest Attempt'|trans }}
                                <ul class="score-list">
                                    <li><strong>{{ 'Score obtained'|trans }} :</strong> {{ item.score.score_obtained }}</li>
                                    <li><strong>{{ 'Total score'|trans }} :</strong> {{ item.score.total_score }}</li>
                                </ul>
                            {% endif %}
                        </div>
                    </div>
                </li>
                {% endfor %}
            </ul>
        </div>
    {% endautoescape %}
{% endblock %}