templates/evaluation/liststudents.html.twig line 1

Open in your IDE?
  1. {% if courses is defined%}
  2.     <div class="col-12 col-sm-1 col-md-1 col-lg-2 ">
  3.     </div>
  4.     <div class="col-12 col-sm-10 col-md-10 col-lg-8  ">
  5.         <select id="evaluation_course"  required="required" class="ChoiceCourse form-control" name="ChoiceCourse">
  6.             {%for course in courses%}
  7.                 <option value="{{course.id}}">{{course.wording}}</option>
  8.             {% endfor %}
  9.         </select>
  10.         <br/>
  11.         
  12.     </div>
  13.     <div class="col-12 col-sm-1 col-md-1 col-lg-2  ">
  14.     </div>
  15. {% endif %}
  16. {% if students is defined%}
  17.     
  18.     <div class="col-12">
  19.         
  20.         
  21.                         
  22.         <table class="table table-bordered table-hover table-sortable table-responsive" id="tab_logic">
  23.             <thead>
  24.                 <tr>
  25.                     <th  class="text-center col-12 col-sm-5 col-md-5 col-lg-3" >Nom et prénom</th>
  26.                     <th  class="text-center col-12 col-sm-5 col-md-5 col-lg-3" >Note de session</th>
  27.                     <th class="text-center col-12 col-sm-3 col-md-3 col-lg-3" >Appr.</th>
  28.                     <th  class="text-center col-12 col-sm-3 col-md-3 col-lg-3" >Poids</th>
  29.                 </tr>
  30.             </thead>
  31.             
  32.             <tbody>
  33.                 {%for student in students%}
  34.                     <tr id='addr0' data-id="0" class="hidden">
  35.                        
  36.                         <td data-name="name">
  37.                             {{student.lastname}} {{student.firstname}}
  38.                         </td>
  39.                         <td data-name="desc">
  40.                             <input type="number" id="{{student.matricule}}"  placeholder="0...20"
  41.                                    min="0" max="20" class="form-control value" name="{{student.matricule}}note"/>
  42.                         </td>
  43.                         <td data-name="desc">
  44.                             <input type="text" placeholder="Appréciation" class="form-control appreciation" name="{{student.matricule}}appr"/>
  45.                         </td>
  46.                         <td data-name="desc">
  47.                             <input type="number" min="0" max="1" class="form-control appreciation" value="1" name="{{student.matricule}}appr"/>
  48.                         </td>
  49.                     </tr>
  50.                 {% endfor %}
  51.             </tbody>
  52.         </table>
  53.     </div>
  54.    
  55. {% endif %}
  56. {% block javascripts %}
  57.     <script type="text/javascript" src="{{ asset('assets/js/jquery.js') }}"></script>
  58.     <script type="text/javascript" >
  59.         
  60.         $(function () {
  61.             
  62.             $("td input.value").change(function () {
  63.                 var note = $(this).val();
  64.                 note = parseInt(note);
  65.                if (note >= 0 && note < 10) {
  66.                     $(this).parent().next().children().val("NA");
  67.                 }
  68.                 if (note >= 10 && note < 14) {
  69.                     $(this).parent().next().children().val("EA/IA");
  70.                 }
  71.                 if (note >= 14 && note < 17) {
  72.                     $(this).parent().next().children().val("A");
  73.                 }
  74.                 if (note >= 17 && note <= 20) {
  75.                     $(this).parent().next().children().val("E");
  76.                 }
  77.             });
  78.         });
  79.     </script>
  80. {% endblock javascripts %}