diff --git a/BUGS.md b/BUGS.md index 81b6095..2a44e32 100644 --- a/BUGS.md +++ b/BUGS.md @@ -1,16 +1,13 @@ # BUGS -- apos clicar no botao responder, inactivar o input (importante quando o tempo de correcção é grande) - nao esta a seguir o max_tries definido no ficheiro de dependencias. -- initdb da integrity error se no mesmo comando existirem alunos repetidos (p.ex em ficheiros csv diferentes ou entre csv e opcao -a) -- double click submits twice. -- duplo clicks no botao "responder" dessincroniza as questões, ver debounce em https://stackoverflow.com/questions/20281546/how-to-prevent-calling-of-en-event-handler-twice-on-fast-clicks - devia mostrar timeout para o aluno saber a razao. - permitir configuracao para escolher entre static files locais ou remotos - templates question-*.html tem input hidden question_ref que não é usado. remover? - shift-enter não está a funcionar - default prefix should be obtained from each course (yaml conf)? +- initdb da integrity error se no mesmo comando existirem alunos repetidos (p.ex em ficheiros csv diferentes ou entre csv e opcao -a) # TODO @@ -34,6 +31,8 @@ # FIXED +- apos clicar no botao responder, inactivar o input (importante quando o tempo de correcção é grande) +- double click submits twice. - checkbox devia ter correct no intervalo [0,1] tal como radio. em caso de desconto a correccção faz 2*x-1. isto permite a mesma semantica nos dois tipos de perguntas. - marking all options right in a radio question breaks! - implementar servidor http com redirect para https. diff --git a/aprendizations/questions.py b/aprendizations/questions.py index 62fc9d3..93d639f 100644 --- a/aprendizations/questions.py +++ b/aprendizations/questions.py @@ -220,11 +220,11 @@ class QuestionCheckbox(Question): if self['discount'] and not all(0.0 <= x <= 1.0 for x in self['correct']): - msg0 = ('+-------------- BEHAVIOR CHANGE NOTICE --------------+') - msg1 = ('| Correct values must be in the interval [0.0, 1.0]. |') - msg2 = ('| I will convert to the new behavior, but you should |') - msg3 = ('| fix it in the question. |') - msg4 = ('+----------------------------------------------------+') + msg0 = ('+--------------- BEHAVIOR CHANGE NOTICE ---------------+') + msg1 = ('| Correct values in checkbox questions must be in the |') + msg2 = ('| interval [0.0, 1.0]. I will convert to the new |') + msg3 = ('| behavior, for now, but you should fix it. |') + msg4 = ('+------------------------------------------------------+') logger.warning(msg0) logger.warning(msg1) logger.warning(msg2) diff --git a/aprendizations/serve.py b/aprendizations/serve.py index 160d9ff..6767c3d 100644 --- a/aprendizations/serve.py +++ b/aprendizations/serve.py @@ -345,7 +345,7 @@ class QuestionHandler(BaseHandler): return # --- brain hacking ;) - await asyncio.sleep(2) + await asyncio.sleep(1.5) # --- answers are in a list. fix depending on question type qtype = self.learn.get_student_question_type(user) diff --git a/aprendizations/static/js/topic.js b/aprendizations/static/js/topic.js index 532af82..27c6a2b 100644 --- a/aprendizations/static/js/topic.js +++ b/aprendizations/static/js/topic.js @@ -13,7 +13,7 @@ function showTriesLeft(tries) { if (tries > 1) msg = "(" + tries + " tentativas)"; else if (tries == 1) - msg = "(1 tentativa)"; + msg = "(última tentativa)"; else msg = ""; $("#tries").html(msg); @@ -93,6 +93,8 @@ function postAnswer() { success: getFeedback, error: function() {alert("O servidor não responde.");} }); + $("#submit").addClass("disabled").html(''); + $("fieldset").prop("disabled", true); } function getFeedback(response) { @@ -110,7 +112,7 @@ function getFeedback(response) { $('#solution_right').html(params['solution']); MathJax.typeset(); $('#wrong').hide(); - $('#right').show().animateCSS('flipInX'); + $('#right').show().animateCSS('zoomIn'); $("#submit").html("Continuar").off().click(getQuestion); break; @@ -120,6 +122,8 @@ function getFeedback(response) { $('#question_div').animateCSS('shake'); $('#topic_progress').css('width', (100*params["progress"])+'%').attr('aria-valuenow', 100*params["progress"]); showTriesLeft(params["tries"]); + $("fieldset").prop("disabled", false); + $("#submit").html("Responder"); break; case "wrong": @@ -127,10 +131,11 @@ function getFeedback(response) { $('#solution_wrong').html(params['solution']); MathJax.typeset(); $('#right').hide(); - $('#wrong').show().animateCSS('flipInX'); + $('#wrong').show(); //.animateCSS('zoomIn'); $('#topic_progress').css('width', (100*params["progress"])+'%').attr('aria-valuenow', 100*params["progress"]); showTriesLeft(params["tries"]); - $("fieldset").attr("disabled", "disabled"); + $("fieldset").prop("disabled", true); + $('#question_div').animateCSS('shake'); $("#submit").html("Continuar").off().click(getQuestion); break; diff --git a/package-lock.json b/package-lock.json index 406ffc9..a62318f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,9 +40,9 @@ } }, "mdbootstrap": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/mdbootstrap/-/mdbootstrap-4.9.0.tgz", - "integrity": "sha512-6R3j5D9Qmp+Aa90FblOVAwVDSqpAICYW2dpNxh6uaVB9E9MCaBLdaTKLrXCB7xznReHEaA57pNABXgFoi2z7Rg==" + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/mdbootstrap/-/mdbootstrap-4.10.0.tgz", + "integrity": "sha512-jpDSrAv9BbqHGFCHf9iQts7dWAuJYT3VFmElLkKpD6cGJ5Pcjv5oiTvfKvFGjVsxWsjLtj7Y0Rh135EYejkaeg==" }, "mj-context-menu": { "version": "0.2.0", diff --git a/package.json b/package.json index 1414bbe..fc1e45f 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "@fortawesome/fontawesome-free": "^5.11.2", "codemirror": "^5.49.2", "mathjax": "^3", - "mdbootstrap": "^4.9.0" + "mdbootstrap": "^4.10.0" }, "private": true } -- libgit2 0.21.2