Commit 5efd9c3c39f164b089251db8430623edc8ac6106
1 parent
b20bb0a8
Exists in
master
and in
1 other branch
- tab behavior in textarea fixed. Tabs are now supported.
Showing
4 changed files
with
29 additions
and
3 deletions
Show diff stats
BUGS.md
... | ... | @@ -2,7 +2,6 @@ |
2 | 2 | |
3 | 3 | # BUGS |
4 | 4 | |
5 | -- textarea monospace, disable tab behavior. | |
6 | 5 | - information points é definido onde? test.y ou questions.py? |
7 | 6 | - hash das passwords obtidas da concatenacao do numero de aluno com password (evita que passwords repetidas sejam detectadas). |
8 | 7 | - mostrar erro quando nao consegue importar questions files |
... | ... | @@ -12,10 +11,9 @@ |
12 | 11 | |
13 | 12 | # TODO |
14 | 13 | |
15 | -- command line options --debug --show_points --show_hints --practice_mode | |
16 | 14 | - testar envio de parametros para stdin para perguntas tipo generator |
17 | 15 | - permitir enviar varios testes, aluno escolhe qual o teste que quer fazer. |
18 | -- alterar o script json2md.py em conformidade | |
16 | +- criar script json2md.py ou outra forma de gerar um teste ja realizado | |
19 | 17 | - Menu para professor com link para /results e /students |
20 | 18 | - implementar singlepage/multipage. Fazer uma class para single page que trate de andar gerir o avanco e correcao das perguntas |
21 | 19 | - permitir adicionar imagens nas perguntas |
... | ... | @@ -24,6 +22,9 @@ |
24 | 22 | |
25 | 23 | # FIXED |
26 | 24 | |
25 | +- textarea monospace | |
26 | +- disable tab behavior in textarea. | |
27 | +- command line options --debug --show_points --show_hints --practice_mode | |
27 | 28 | - manual de utilizacao. |
28 | 29 | - criar pergunta gerada por script externo. |
29 | 30 | - debug mode | ... | ... |
static/.DS_Store
No preview for this file type
... | ... | @@ -0,0 +1,21 @@ |
1 | +$("textarea").keydown(function(e) { | |
2 | + if(e.keyCode === 9) { // tab was pressed | |
3 | + // get caret position/selection | |
4 | + var start = this.selectionStart; | |
5 | + var end = this.selectionEnd; | |
6 | + | |
7 | + var $this = $(this); | |
8 | + var value = $this.val(); | |
9 | + | |
10 | + // set textarea value to: text before caret + tab + text after caret | |
11 | + $this.val(value.substring(0, start) | |
12 | + + "\t" | |
13 | + + value.substring(end)); | |
14 | + | |
15 | + // put caret at right position again (add one for the tab) | |
16 | + this.selectionStart = this.selectionEnd = start + 1; | |
17 | + | |
18 | + // prevent the focus lose | |
19 | + e.preventDefault(); | |
20 | + } | |
21 | +}); | |
0 | 22 | \ No newline at end of file | ... | ... |
templates/test.html
... | ... | @@ -51,6 +51,9 @@ |
51 | 51 | box-shadow: 0px 2px 10px 3px rgba(0, 0, 0, .2); |
52 | 52 | border-radius:5px; |
53 | 53 | } |
54 | + textarea { | |
55 | + font-family: monospace !important; | |
56 | + } | |
54 | 57 | </style> |
55 | 58 | </head> |
56 | 59 | <!-- ===================================================================== --> |
... | ... | @@ -280,5 +283,6 @@ |
280 | 283 | </div> |
281 | 284 | </div> |
282 | 285 | |
286 | +<script src="/js/tabkey_in_textarea.js"></script> | |
283 | 287 | </body> |
284 | 288 | </html> | ... | ... |