Commit 7c0e56cadd2e4a8960a462d98e7d6b1648780ba1
1 parent
a96cd2c7
Exists in
master
and in
1 other branch
- allow textarea and text to have initial text defined in the question.
Showing
3 changed files
with
3 additions
and
3 deletions
Show diff stats
BUGS.md
1 | 1 | BUGS: |
2 | 2 | |
3 | 3 | - se students.db não existe, rebenta. |
4 | -- textarea tem codigo para preencher o texto, mas ja não é necessário porque pergunta não é reloaded. | |
5 | 4 | - questions hardcoded in LearnApp. |
6 | 5 | - database hardcoded in LearnApp. |
7 | 6 | - implementar xsrf. Ver [http://www.tornadoweb.org/en/stable/guide/security.html#cross-site-request-forgery-protection]() |
... | ... | @@ -16,6 +15,7 @@ TODO: |
16 | 15 | |
17 | 16 | SOLVED: |
18 | 17 | |
18 | +- textarea tem codigo para preencher o texto, mas ja não é necessário porque pergunta não é reloaded. | |
19 | 19 | - gravar answers -> db |
20 | 20 | - como gerar key para secure cookie. |
21 | 21 | - https. certificados selfsigned, no-ip nao suporta certificados | ... | ... |
templates/question-text.html
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | |
3 | 3 | {% block answer %} |
4 | 4 | <fieldset data-role="controlgroup"> |
5 | - <input type="text" class="form-control" id="answer" name="answer" value="" autofocus> | |
5 | + <input type="text" class="form-control" id="answer" name="answer" value="{{ question['answer'] or '' }}" autofocus> | |
6 | 6 | </fieldset><br /> |
7 | 7 | <input type="hidden" name="question_ref" value="{{ question['ref'] }}"> |
8 | 8 | {% end %} | ... | ... |
templates/question-textarea.html
1 | 1 | {% extends "question.html" %} |
2 | 2 | |
3 | 3 | {% block answer %} |
4 | -<textarea class="form-control" rows="{{ question['lines'] }}" name="answer" autofocus>{{ question['answer'][0] if question['answer'] is not None else '' }}</textarea><br /> | |
4 | +<textarea class="form-control" rows="{{ question['lines'] }}" name="answer" autofocus>{{ question['answer'] or '' }}</textarea><br /> | |
5 | 5 | <input type="hidden" name="question_ref" value="{{ question['ref'] }}"> |
6 | 6 | {% end %} | ... | ... |