diff --git a/BUGS.md b/BUGS.md index 72aa58a..bb024e3 100644 --- a/BUGS.md +++ b/BUGS.md @@ -1,10 +1,9 @@ # BUGS +- markdown no teste nao funciona - numeracao das perguntas do teste esta a contar com paineis informativos... - servir imagens das perguntas -- review de um teste nao funciona (hardcoded...) -- testar opcao --allow-all - como alterar configuracao para mostrar logs de debug? - hints nao funciona - uniformizar question.py com a de aprendizations... @@ -14,6 +13,14 @@ # TODO +- mathjax-node: + sudo pkg install node npm + npm install mathjax-node mathjax-node-cli # pacotes em ~/node_modules + node_modules/mathjax-node-cli/bin/tex2svg '\sqrt{x}' + usar isto para gerar svg que passa a fazer parte do texto da pergunta (markdown suporta tags svg?) + + + - Gerar pdf's com todos os testes no final (pdfkit). - manter registo dos unfocus durante o teste e de qual a pergunta visivel nesse momento @@ -31,6 +38,7 @@ # FIXED +- review de um teste nao funciona (hardcoded...) - testar SSL - text-numeric não está a gerar a pergunta. faltam templates? - testar perguntas warning/warn diff --git a/demo/questions/questions-tutorial.yaml b/demo/questions/questions-tutorial.yaml index d00d7aa..2e3124c 100644 --- a/demo/questions/questions-tutorial.yaml +++ b/demo/questions/questions-tutorial.yaml @@ -2,19 +2,41 @@ ref: tut-information type: information title: information (ou info) - text: Texto informativo. Não conta para avaliação. + text: | + Texto informativo. Não conta para avaliação. + + $$ p(x) = \frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{(x-\mu)^2}{2\sigma^2}} $$ # --------------------------------------------------------------------------- - ref: tut-success type: success title: success - text: Texto de positivo (sucesso). Não conta para avaliação. + text: | + Texto de positivo (sucesso). Não conta para avaliação. + + ```C + int main() { + printf("Hello world!"); + return 0; // comentario + } + ``` + + Inline `code`. + # --------------------------------------------------------------------------- - ref: tut-warning type: warning title: warning (ou warn) - text: Texto de aviso. Não conta para avaliação. + text: | + Texto de aviso. Não conta para avaliação. + + Left | Center | Right + -----------------|:-------------:|----------: + $\sin(x^2)$ | *hello* | $1600.00 + $\frac{1}{2\pi}$ | **world** | $12.50 + $\sqrt{\pi}$ | `code` | $1.99 + # ---------------------------------------------------------------------------- - ref: tut-alert @@ -48,7 +70,7 @@ - Opção 3 (sim) correct: [1,-1,-1,1] # opcionais e valores por defeito - shuffle: True + shuffle: True # ---------------------------------------------------------------------------- - ref: tut-text @@ -82,8 +104,8 @@ type: textarea title: textarea text: | - Resposta num bloco de texto que pode ser usado para introduzir código. - A resposta é avaliada por um programa externo. + Resposta num bloco de texto que pode ser usado para introduzir código. + A resposta é avaliada por um programa externo. O programa externo, recebe a resposta no stdin e devolve a classificação no stdout. Neste exemplo, o programa de avaliação verifica se a resposta contém as três palavras red, green e blue. correct: correct/correct-question.py diff --git a/demo/questions/questions.yaml b/demo/questions/questions.yaml index b947cb5..9431107 100644 --- a/demo/questions/questions.yaml +++ b/demo/questions/questions.yaml @@ -70,7 +70,7 @@ # --------------------------------------------------------------------------- - ref: fractions - type: text-numeric + type: numeric-interval text: Quanto é 1/4? correct: [0.249, 0.251] # --------------------------------------------------------------------------- diff --git a/serve.py b/serve.py index f822795..a0b65c1 100755 --- a/serve.py +++ b/serve.py @@ -163,7 +163,7 @@ class TestHandler(BaseHandler): # --- REVIEW ------------------------------------------------------------- class ReviewHandler(BaseHandler): - templates = { + _templates = { 'radio': 'review-question-radio.html', 'checkbox': 'review-question-checkbox.html', 'text': 'review-question-text.html', @@ -181,12 +181,13 @@ class ReviewHandler(BaseHandler): @tornado.web.authenticated def get(self): - test_id=45 # FIXME - uid = self.current_user if uid != '0': self.redirect('/') # FIXME 404 not found? + test_id = self.get_query_argument('test_id', None) + # FIXME if test_id does not exist... + fname = self.testapp.get_json_filename_of_test(test_id) try: f = open(path.expanduser(fname)) @@ -197,7 +198,7 @@ class ReviewHandler(BaseHandler): else: with f: t = json.load(f) - self.render('review.html', t=t, md=md_to_html_review, templ=self.templates) + self.render('review.html', t=t, md=md_to_html_review, templ=self._templates) # @cherrypy.expose diff --git a/templates/grade.html b/templates/grade.html index 3be0bf0..19f112d 100644 --- a/templates/grade.html +++ b/templates/grade.html @@ -16,7 +16,7 @@
-