Commit f749fa174c87e75e4f7a392786f9504e2d3d3144
1 parent
778c815e
Exists in
master
and in
1 other branch
- fixed browser unfocus detection.
Showing
4 changed files
with
45 additions
and
6 deletions
Show diff stats
BUGS.md
| @@ -2,12 +2,12 @@ | @@ -2,12 +2,12 @@ | ||
| 2 | # BUGS | 2 | # BUGS |
| 3 | 3 | ||
| 4 | - usar thread.Lock para aceder a variaveis de estado? | 4 | - usar thread.Lock para aceder a variaveis de estado? |
| 5 | -- permitir adicionar imagens nas perguntas. | ||
| 6 | -- detect_unfocus.js so funciona se estiver inline no html. porquê??? | ||
| 7 | 5 | ||
| 8 | # TODO | 6 | # TODO |
| 9 | 7 | ||
| 8 | +- lidar com focus. aviso em /admin | ||
| 10 | - implementar practice mode. | 9 | - implementar practice mode. |
| 10 | +- permitir adicionar imagens nas perguntas. | ||
| 11 | - abrir o teste numa janela maximizada e que nao permite que o aluno a redimensione/mova. | 11 | - abrir o teste numa janela maximizada e que nao permite que o aluno a redimensione/mova. |
| 12 | - detectar scroll e enviar posição para servidor (analise de scroll para detectar copianço? ou simplesmente para analisar como os alunos percorrem o teste) | 12 | - detectar scroll e enviar posição para servidor (analise de scroll para detectar copianço? ou simplesmente para analisar como os alunos percorrem o teste) |
| 13 | - detectar se janela perde focus e alertar o prof (http://stackoverflow.com/questions/1060008/is-there-a-way-to-detect-if-a-browser-window-is-not-currently-active) | 13 | - detectar se janela perde focus e alertar o prof (http://stackoverflow.com/questions/1060008/is-there-a-way-to-detect-if-a-browser-window-is-not-currently-active) |
| @@ -24,6 +24,7 @@ | @@ -24,6 +24,7 @@ | ||
| 24 | 24 | ||
| 25 | # FIXED | 25 | # FIXED |
| 26 | 26 | ||
| 27 | +- detect_unfocus.js so funciona se estiver inline no html. porquê??? | ||
| 27 | - inserir novo aluno /admin não fecha. | 28 | - inserir novo aluno /admin não fecha. |
| 28 | - se aluno desistir, ainda fica marcado como online | 29 | - se aluno desistir, ainda fica marcado como online |
| 29 | - give dá None em vez de 0.0 | 30 | - give dá None em vez de 0.0 |
static/js/admin.js
| @@ -113,9 +113,9 @@ $(document).ready(function() { | @@ -113,9 +113,9 @@ $(document).ready(function() { | ||
| 113 | rows += '\ | 113 | rows += '\ |
| 114 | <td><input type="checkbox" name="' + uid + '" value="true"' + (d['allowed'] ? 'checked' : '') + '></td>\ | 114 | <td><input type="checkbox" name="' + uid + '" value="true"' + (d['allowed'] ? 'checked' : '') + '></td>\ |
| 115 | <td>' + uid + '</td>\ | 115 | <td>' + uid + '</td>\ |
| 116 | - <td>' + d['name'] + '</td>\ | 116 | + <td>' + d['name'] + (d['password_defined'] ? ' <span class="label label-default">pw</span>' : '') +'</td>\ |
| 117 | <td>' + | 117 | <td>' + |
| 118 | - (d['password_defined'] ? '<span class="label label-default">pw</span>' : '') + | 118 | + |
| 119 | // (d['online'] ? '<span class="label label-warning">online</span>' : '') + | 119 | // (d['online'] ? '<span class="label label-warning">online</span>' : '') + |
| 120 | (d['start_time']==''?'':'<span class="label label-success">teste</span>') + | 120 | (d['start_time']==''?'':'<span class="label label-success">teste</span>') + |
| 121 | '</td>\ | 121 | '</td>\ |
| @@ -0,0 +1,36 @@ | @@ -0,0 +1,36 @@ | ||
| 1 | +$(document).ready(function() { | ||
| 2 | + $(window).focus(function(){ | ||
| 3 | + $.ajax({ | ||
| 4 | + type: "POST", | ||
| 5 | + url: "/adminwebservice", | ||
| 6 | + data: { | ||
| 7 | + "cmd": "focus", | ||
| 8 | + "name": $("#number").text() | ||
| 9 | + } | ||
| 10 | + }); | ||
| 11 | + }); | ||
| 12 | + | ||
| 13 | + $(window).blur(function(e){ | ||
| 14 | + $.ajax({ | ||
| 15 | + type: "POST", | ||
| 16 | + url: "/adminwebservice", | ||
| 17 | + data: { | ||
| 18 | + "cmd": "blur", | ||
| 19 | + "name": $("#number").text() | ||
| 20 | + } | ||
| 21 | + }); | ||
| 22 | + }); | ||
| 23 | + | ||
| 24 | + $(window).resize(function(){ | ||
| 25 | + var n = $(window).scrollTop(); | ||
| 26 | + $.ajax({ | ||
| 27 | + type: "POST", | ||
| 28 | + url: "/adminwebservice", | ||
| 29 | + data: { | ||
| 30 | + "cmd": "resize", | ||
| 31 | + "name": $("#number").text(), | ||
| 32 | + "scroll": n | ||
| 33 | + } | ||
| 34 | + }); | ||
| 35 | + }); | ||
| 36 | +}); | ||
| 0 | \ No newline at end of file | 37 | \ No newline at end of file |
templates/test.html
| @@ -74,8 +74,10 @@ | @@ -74,8 +74,10 @@ | ||
| 74 | <ul class="nav navbar-nav navbar-right"> | 74 | <ul class="nav navbar-nav navbar-right"> |
| 75 | <li class="dropdown"> | 75 | <li class="dropdown"> |
| 76 | <a class="dropdown-toggle" data-toggle="dropdown" href="#"> | 76 | <a class="dropdown-toggle" data-toggle="dropdown" href="#"> |
| 77 | - <span class="glyphicon glyphicon-user" aria-hidden="true"></span> | ||
| 78 | - ${t['student']['name']} (${t['student']['number']}) <span class="caret"></span> | 77 | + <span class="glyphicon glyphicon-user" aria-hidden="true"></span> |
| 78 | + <span id="name">${t['student']['name']}</span> | ||
| 79 | + (<span id="number">${t['student']['number']}</span>) | ||
| 80 | + <span class="caret"></span> | ||
| 79 | </a> | 81 | </a> |
| 80 | <ul class="dropdown-menu"> | 82 | <ul class="dropdown-menu"> |
| 81 | <li class="active"><a href="/test">Teste</a></li> | 83 | <li class="active"><a href="/test">Teste</a></li> |