Commit 0946fe79f6376cd4eaf042616fcd329b29f1d024

Authored by Miguel Barão
1 parent 511a122a
Exists in master and in 1 other branch dev

debounce authorization checkboxes

1 1
2 # BUGS 2 # BUGS
3 3
4 -- botao de autorizar desliga-se, fazer debounce.  
5 -e.g. retornar None quando nao ha alteracoes relativamente à última vez. 4 +- retornar None quando nao ha alteracoes relativamente à última vez.
6 ou usar push (websockets?) 5 ou usar push (websockets?)
7 - quando scale_max não é 20, as cores das barras continuam a reflectir a escala 0,20 6 - quando scale_max não é 20, as cores das barras continuam a reflectir a escala 0,20
8 - CRITICAL se answer for `i<n` a revisão de provas mostra apenas i (interpreta `<` como tag?) 7 - CRITICAL se answer for `i<n` a revisão de provas mostra apenas i (interpreta `<` como tag?)
@@ -62,6 +61,7 @@ ou usar push (websockets?) @@ -62,6 +61,7 @@ ou usar push (websockets?)
62 61
63 # FIXED 62 # FIXED
64 63
  64 +- botao de autorizar desliga-se, fazer debounce.
65 - link na pagina com a nota para voltar ao principio. 65 - link na pagina com a nota para voltar ao principio.
66 - default logger config mostrar horas com segundos 66 - default logger config mostrar horas com segundos
67 - test: mostrar duração do teste com progressbar no navbar. 67 - test: mostrar duração do teste com progressbar no navbar.
perguntations/static/js/admin.js
@@ -36,7 +36,7 @@ $(document).ready(function() { @@ -36,7 +36,7 @@ $(document).ready(function() {
36 }); 36 });
37 }); 37 });
38 // authorization checkboxes in the students_table: 38 // authorization checkboxes in the students_table:
39 - $("tbody", "#students_table").on("change", "input", autorizeStudent); 39 + $("tbody", "#students_table").on("change", "input", _.debounce(autorizeStudent));
40 } 40 }
41 41
42 // ---------------------------------------------------------------------- 42 // ----------------------------------------------------------------------
perguntations/templates/admin.html
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 <script defer src="/static/fontawesome-free/js/all.min.js"></script> 25 <script defer src="/static/fontawesome-free/js/all.min.js"></script>
26 <script defer src="/static/bootstrap/js/bootstrap.min.js"></script> 26 <script defer src="/static/bootstrap/js/bootstrap.min.js"></script>
27 <script defer src="/static/datatables/js/jquery.dataTables.min.js"></script> 27 <script defer src="/static/datatables/js/jquery.dataTables.min.js"></script>
28 - 28 + <script defer src="/static/underscore/underscore-min.js"></script>
29 <script defer src="/static/js/admin.js"></script> 29 <script defer src="/static/js/admin.js"></script>
30 <script defer src="/static/js/clock.js"></script> 30 <script defer src="/static/js/clock.js"></script>
31 </head> 31 </head>
perguntations/templates/grade.html
@@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@
45 <strong>{{ f'{round(t["grade"], 1)}' }}</strong> 45 <strong>{{ f'{round(t["grade"], 1)}' }}</strong>
46 valores na escala de {{t['scale'][0]}} a {{t['scale'][1]}}. 46 valores na escala de {{t['scale'][0]}} a {{t['scale'][1]}}.
47 </h1> 47 </h1>
48 - <p>O seu teste foi entregue e está registado.</p> 48 + <p>O seu teste foi correctamente entregue e a nota registada.</p>
49 <p><a href="/" class="btn btn-primary btn-lg active" role="button">Clique aqui para sair do teste</a></p> 49 <p><a href="/" class="btn btn-primary btn-lg active" role="button">Clique aqui para sair do teste</a></p>
50 {% if t['grade'] - t['scale'][0] >= 0.75*(t['scale'][1] - t['scale'][0]) %} 50 {% if t['grade'] - t['scale'][0] >= 0.75*(t['scale'][1] - t['scale'][0]) %}
51 <i class="fas fa-thumbs-up fa-5x text-success" aria-hidden="true"></i> 51 <i class="fas fa-thumbs-up fa-5x text-success" aria-hidden="true"></i>
@@ -90,8 +90,7 @@ @@ -90,8 +90,7 @@
90 aria-valuenow="{{ 100*(g[1] - t['scale'][0])/(t['scale'][1] - t['scale'][0]) }}" 90 aria-valuenow="{{ 100*(g[1] - t['scale'][0])/(t['scale'][1] - t['scale'][0]) }}"
91 aria-valuemin="0" 91 aria-valuemin="0"
92 aria-valuemax="100" 92 aria-valuemax="100"
93 - style="min-width: 2em; width: {{ 100*(g[1]-t['scale'][0])/(t['scale'][1]-t['scale'][0]) }}%;"  
94 - > 93 + style="min-width: 2em; width: {{ 100*(g[1]-t['scale'][0])/(t['scale'][1]-t['scale'][0]) }}%;">
95 94
96 {{ str(round(g[1], 1)) }} 95 {{ str(round(g[1], 1)) }}
97 96