index.html.twig 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. {% block content %}
  2. {% autoescape false %}
  3. <div class="list-exercise">
  4. <ul class="list-group list-group-flush">
  5. {% for item in data %}
  6. <li class="list-group-item">
  7. <div class="row">
  8. <div class="col-md-5">
  9. <h5>
  10. <img src="{{ 'quiz.png'|icon(22) }}">
  11. <a href="{{ item.url }}">
  12. {{ item.title }}
  13. </a>
  14. </h5>
  15. {% if item.description %}
  16. <div class="description">
  17. {{ item.description }}
  18. </div>
  19. {% endif %}
  20. </div>
  21. <div class="col-md-4">
  22. <strong>{{ 'Quantity Questions'|trans }}:</strong> {{ item.number_questions }}
  23. {% if item.score %}
  24. <div class="progress">
  25. <div class="progress-bar" role="progressbar" style="width: {{ item.score.percentage }}%" aria-valuenow="{{ item.score.percentage }}" aria-valuemin="0" aria-valuemax="100">
  26. {{ item.score.percentage }}%
  27. </div>
  28. </div>
  29. {% else %}
  30. <div class="progress">
  31. <div class="progress-bar" role="progressbar" style="width: 0%" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
  32. 0%
  33. </div>
  34. </div>
  35. {% endif %}
  36. </div>
  37. <div class="col-md-3">
  38. {% if is_teacher %}
  39. <div class="toolbar">
  40. {{ item.actions }}
  41. </div>
  42. {% else %}
  43. {{ 'Latest Attempt'|trans }}
  44. <ul class="score-list">
  45. <li><strong>{{ 'Score obtained'|trans }} :</strong> {{ item.score.score_obtained }}</li>
  46. <li><strong>{{ 'Total score'|trans }} :</strong> {{ item.score.total_score }}</li>
  47. </ul>
  48. {% endif %}
  49. </div>
  50. </div>
  51. </li>
  52. {% endfor %}
  53. </ul>
  54. </div>
  55. {% endautoescape %}
  56. {% endblock %}