diff --git a/aprendizations/__init__.py b/aprendizations/__init__.py index 3c029b5..0881ff1 100644 --- a/aprendizations/__init__.py +++ b/aprendizations/__init__.py @@ -30,7 +30,7 @@ are progressively uncovered as the students progress. ''' APP_NAME = 'aprendizations' -APP_VERSION = '2021.07.dev1' +APP_VERSION = '2021.08.dev1' APP_DESCRIPTION = __doc__ __author__ = 'Miguel Barão' diff --git a/aprendizations/learnapp.py b/aprendizations/learnapp.py index f43765f..c526532 100644 --- a/aprendizations/learnapp.py +++ b/aprendizations/learnapp.py @@ -288,10 +288,7 @@ class LearnApp(): logger.info('User "%s" finished "%s" (level=%.2f)', uid, topic_id, level) - query = select(StudentTopic).where( - StudentTopic.student_id == uid and - StudentTopic.topic_id == topic_id - ) + query = select(StudentTopic).where(StudentTopic.student_id == uid).where(StudentTopic.topic_id == topic_id) with Session(self._engine, future=True) as session: student_topic = session.execute(query).scalar_one_or_none() diff --git a/aprendizations/static/js/topic.js b/aprendizations/static/js/topic.js index 6f905e5..07e3adc 100644 --- a/aprendizations/static/js/topic.js +++ b/aprendizations/static/js/topic.js @@ -1,8 +1,8 @@ $.fn.extend({ animateCSS: function (animation, run_on_end) { var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend'; - this.addClass('animated ' + animation).one(animationEnd, function() { - $(this).removeClass('animated ' + animation); + this.addClass('animate__animated ' + animation).one(animationEnd, function() { + $(this).removeClass('animate__animated ' + animation); if (run_on_end !== undefined) { run_on_end(); } @@ -46,7 +46,7 @@ function updateQuestion(response) { break; case "finished_topic": $('#submit, #comments, #solution').remove(); - $("#content").html(params["question"]).animateCSS('tada'); + $("#content").html(params["question"]).animateCSS('animate__tada'); $('#topic_progress').css('width', '100%').attr('aria-valuenow', 100); setTimeout(function(){window.location.replace('/course/');}, 2000); break; @@ -57,10 +57,10 @@ function new_question(type, question, tries, progress) { window.scrollTo(0, 0); $("#submit").hide(); - $("#question_div").animateCSS('fadeOut', function() { + $("#question_div").animateCSS('animate__fadeOut', function() { $("#question_div").html(question); MathJax.typeset(); - $("#question_div").animateCSS('fadeIn', function() { + $("#question_div").animateCSS('animate__fadeIn', function() { showTriesLeft(tries); $("#submit").removeClass("disabled").show(); @@ -120,7 +120,7 @@ function getFeedback(response) { $('#comments').html(params['comments']).show(); $('#solution_right').html(params['solution']); MathJax.typeset(); - $('#right').show().animateCSS('zoomIn', function(){ + $('#right').show().animateCSS('animate__zoomIn', function(){ $("#submit").html("Continuar").removeClass("disabled").off().click(getQuestion); }); break; @@ -129,7 +129,10 @@ function getFeedback(response) { $('#comments').html(params['comments']).show(); MathJax.typeset(); $('#topic_progress').css('width', (100*params["progress"])+'%').attr('aria-valuenow', 100*params["progress"]); - $('#question_div').animateCSS('shake', function() { + + + + $('#question_div').animateCSS('animate__shakeX', function() { showTriesLeft(params["tries"]); $("fieldset").prop("disabled", false); $("#submit").html("Responder").removeClass("disabled"); @@ -142,9 +145,9 @@ function getFeedback(response) { $('#comments').html(params['comments']).show(); $('#solution_wrong').html(params['solution']); MathJax.typeset(); - $('#question_div').animateCSS('shake', function() { + $('#question_div').animateCSS('animate__shakeX', function() { showTriesLeft(params["tries"]); - $('#wrong').show().animateCSS('zoomIn', function() { + $('#wrong').show().animateCSS('animate__zoomIn', function() { $("#submit").html("Continuar").removeClass("disabled").off().click(getQuestion); }); }); diff --git a/aprendizations/static/signin.css b/aprendizations/static/signin.css new file mode 100644 index 0000000..4732d1f --- /dev/null +++ b/aprendizations/static/signin.css @@ -0,0 +1,39 @@ +html, +body { + height: 100%; +} + +body { + display: flex; + align-items: center; + padding-top: 40px; + padding-bottom: 40px; + background-color: #f5f5f5; +} + +.form-signin { + width: 100%; + max-width: 330px; + padding: 15px; + margin: auto; +} + +.form-signin .checkbox { + font-weight: 400; +} + +.form-signin .form-floating:focus-within { + z-index: 2; +} + +.form-signin input[type="email"] { + margin-bottom: -1px; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} + +.form-signin input[type="password"] { + margin-bottom: 10px; + border-top-left-radius: 0; + border-top-right-radius: 0; +} diff --git a/aprendizations/templates/courses.html b/aprendizations/templates/courses.html index 2a8508e..677ae0a 100644 --- a/aprendizations/templates/courses.html +++ b/aprendizations/templates/courses.html @@ -1,108 +1,120 @@ {% autoescape %} - - -
-