diff --git a/BUGS.md b/BUGS.md index ce818f8..52d821e 100644 --- a/BUGS.md +++ b/BUGS.md @@ -1,6 +1,8 @@ # BUGS +- esta a permitir 2 logins em simultaneo do mesmo user. fica tudo baralhado... +- shift-enter não está a funcionar - falha intermitent no file handler quando o browser envia 2 GET requests ao mesmo tempo (porquê?) - nos topicos learn.yaml, qd falha acrescenta no fim. nao faz sentido. - ocorreu uma vez o sqlalchemy dar mesg erro a indicar que as threads sao diferents quando se faz o get da primeira pergunta do topico. Muitas vezes nao mostar erro, mas a pagina da erro ou fica em branco... diff --git a/static/MDB b/static/MDB new file mode 120000 index 0000000..671f269 --- /dev/null +++ b/static/MDB @@ -0,0 +1 @@ +libs/MDB-Free_4/ \ No newline at end of file diff --git a/static/js/topic.js b/static/js/topic.js index 810471c..6a97ba8 100644 --- a/static/js/topic.js +++ b/static/js/topic.js @@ -24,6 +24,9 @@ function updateQuestion(response) { var method = response["method"]; var params = response["params"]; + $('#right').hide(); + $('#wrong').hide(); + switch (method) { case "new_question": new_question(params["type"], params["question"], params["tries"], params["progress"]); @@ -58,13 +61,15 @@ function new_question(type, question, tries, progress) { $('#question_div').animateCSS('bounceInDown'); - // enable shift+enter to submit - $("input:text, input:radio, input:checkbox").keydown(function (e) { - if (e.keyCode == 13) { - e.preventDefault(); - if (e.shiftKey) postQuestion(); - return false; - }}); + // enable shift+enter to submit + // $("input:text, input:radio, input:checkbox").keydown(function (e) { + // if (e.keyCode == 13) { + // e.preventDefault(); + // if (e.shiftKey) { + // $("#submit").click(); + // } + // return false; + // }}); } // =========================================================================== @@ -96,10 +101,11 @@ function getFeedback(response) { switch (method) { case "right": + $('#right').show(); + $('#wrong').hide(); $('#comments').html(params['comments']); MathJax.Hub.Queue(["Typeset", MathJax.Hub, "#comments"]); $("#submit").html("Continuar"); - // $("#submit").toggleClass("btn-info btn-primary"); $("#submit").off(); $("#submit").click(getQuestion); break; @@ -113,13 +119,16 @@ function getFeedback(response) { break; case "wrong": - $('#question_div').animateCSS('shake'); + $('#right').hide(); + $('#wrong').show(); + // $('#question_div').animateCSS('shake'); $('#topic_progress').css('width', (100*params["progress"])+'%').attr('aria-valuenow', 100*params["progress"]); $("#tries").html(params["tries"]); $('#comments').html(params['comments']); MathJax.Hub.Queue(["Typeset", MathJax.Hub, "#comments"]); $('#solution').html(params['solution']); MathJax.Hub.Queue(["Typeset", MathJax.Hub, "#solution"]); + $('#solution').animateCSS('flipInX'); $("fieldset").attr("disabled", "disabled"); $("#submit").html("Continuar"); $("#submit").off(); diff --git a/templates/comments-right.html b/templates/comments-right.html index b96c61a..229bfb1 100644 --- a/templates/comments-right.html +++ b/templates/comments-right.html @@ -1,9 +1,7 @@ {% autoescape %} +{% if comments %}