templates/evaluation/edit.html.twig line 1

Open in your IDE?
  1. {% extends "layout/backEndLayout.html.twig" %}
  2. {% form_theme edit_form 'bootstrap_4_layout.html.twig' %}
  3. {% block content %}
  4. <div class="row mt-4">
  5. <div class="col-12 jumbotron mx-auto">
  6. <article class="text-center">
  7. <br/>
  8. <div class="card-header">
  9. <h4 class="my-0 font-weight-normal text-center text-justify text-uppercase"> Modifier evaluation {{ evaluation.id }} </h4>
  10. </div>
  11. <div class="example-wrapper">
  12. <h1 class="center">Edition évaluation N°
  13. {{evaluation.id}}
  14. Sequence
  15. {{evaluation.sequence.code}}
  16. Cours
  17. {{evaluation.classRoom.name}}
  18. Cours
  19. {{evaluation.course.wording}}</h1>
  20. <div class="row">
  21. <div class="col-lg-4 mar-bot30"></div>
  22. <div class="col-lg-4 mar-bot30">
  23. {{ form_start(edit_form) }}
  24. {{ form_widget(edit_form) }}
  25. </div>
  26. <div class="col-lg-4 mar-bot30"></div>
  27. </div>
  28. <div class="row">
  29. <div class="col-lg-1 mar-bot30"></div>
  30. <div class="col-lg-10 mar-bot30">
  31. {% if students is defined %}
  32. <table class="table table-bordered table-hover table-sortable" id="tab_logic">
  33. <thead>
  34. <tr>
  35. <th class="text-center" style="width:10%;">Matricule</th>
  36. <th class="text-center" style="width:35%;">Nom et prénom</th>
  37. <th class="text-center" style="width:15%;">Note</th>
  38. <th class="text-center" style="width:25%;">Appréciation</th>
  39. <th class="text-center" style="width:10%;">Poids</th>
  40. </tr>
  41. </thead>
  42. <tbody>
  43. {% for student in students %}
  44. <tr class="hidden" data-id="0" id='addr0'>
  45. <td data-name="name">
  46. {{student.matricule}}
  47. </td>
  48. <td data-name="name">
  49. {{student.lastname}}
  50. {{student.firstname}}
  51. </td>
  52. {% if marks[student.matricule] is defined %}
  53. <td data-name="desc">
  54. <input type="float" id="{{ student.matricule }}" placeholder="0...20" value="{{ marks[student.matricule].value }}" min="0" max="20" class="form-control value" name="{{student.matricule}}note"/>
  55. </td>
  56. <td data-name="desc">
  57. <input type="text" value="{{marks[student.matricule].appreciation}}" placeholder="Appréciation" class="form-control appreciation" name="{{student.matricule}}appr"/>
  58. </td>
  59. <td data-name="desc">
  60. <input type="text" value="{{marks[student.matricule].weight}}" placeholder="Poids" class="form-control appreciation" name="{{student.matricule}}weight"/>
  61. </td>
  62. {% else %}
  63. <td data-name="desc">
  64. <input type="float" id="{{ student.matricule }}" placeholder="0...20" value="0" min="0" max="20" class="form-control value" name="{{student.matricule}}note"/>
  65. </td>
  66. <td data-name="desc">
  67. <input type="text" value="ABSCENT" placeholder="Appréciation" class="form-control appreciation" name="{{student.matricule}}appr"/>
  68. </td>
  69. <td data-name="desc">
  70. <input type="text" value="0" placeholder="Poids" class="form-control appreciation" name="{{student.matricule}}weight"/>
  71. </td>
  72. {% endif %}
  73. </tr>
  74. {% endfor %}
  75. </tbody>
  76. </table>
  77. {% endif %}
  78. </div>
  79. <div class="col-lg-1 mar-bot30"></div>
  80. </div>
  81. <div class="btn-group center record_actions">
  82. <a class="btn btn-info" href="{{ path('admin_evaluations') }}">
  83. <i class="fa fa-list"></i>
  84. {{ 'Back to the list'|trans({}, 'admin') }}
  85. </a>
  86. <button class="btn btn-warning" type="submit">
  87. <i class="fa fa-edit"></i>
  88. {{ 'Update'|trans({}, 'admin') }}</button>
  89. </div>
  90. </div>
  91. </article>
  92. </div>
  93. </div>
  94. {% endblock %}
  95. {% block javascripts %}
  96. {{parent()}}
  97. <script type="text/javascript" src="{{ asset('assets/js/jquery.js') }}"></script>
  98. <script type="text/javascript">
  99. $(function () {
  100. $("td input.value").change(function () {
  101. var note = $(this).val();
  102. note = parseInt(note);
  103. if (note >= 0 && note < 11) {
  104. $(this).parent().next().children().val("NA");
  105. }
  106. if (note >= 11 && note < 14) {
  107. $(this).parent().next().children().val("EA/IA");
  108. }
  109. if (note >= 14 && note < 17) {
  110. $(this).parent().next().children().val("A");
  111. }
  112. if (note >= 17 && note <= 20) {
  113. $(this).parent().next().children().val("E");
  114. }
  115. });
  116. });
  117. </script>
  118. {% endblock javascripts %}