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 %} - - - - {{appname}} - - - + + + + + + - - + - - - - + + - - - - + +
-
-
Legenda:
-
-
-
Material de estudo
-
-
Exercícios
-
-
Não faz parte deste curso mas é necessário saber
-
-
Milestone (terminou um certo conjunto de tópicos)
-
- -
- -

{{ course['title'] }}

+

{{ course['title'] }}

- + - - + + + {% for t in state %} {% if t['level'] is None %} - + + - + @@ -150,34 +165,5 @@
TópicoNívelTópicoEstado
+ {% if t['type']=='chapter' %} + + {% elif t['type']=='learn' %} +   + {% else %} +   + {% end %} +
{% if t['ref'] not in course['goals'] %} {% end %} - {% if t['type']=='chapter' %} - - {% elif t['type']=='learn' %} -   - {% else %} -   - {% end %} {{ t['name'] }}
@@ -116,11 +130,7 @@ {% else %}
- {% if t['ref'] not in course['goals'] %} - - {% end %} - + {% if t['type']=='chapter' %}   {% elif t['type']=='learn' %} @@ -128,6 +138,11 @@ {% else %}   {% end %} + + {% if t['ref'] not in course['goals'] %} + + {% end %} {{ t['name'] }}
- - - - - diff --git a/aprendizations/templates/question-checkbox.html b/aprendizations/templates/question-checkbox.html index b16f7a7..612ceed 100644 --- a/aprendizations/templates/question-checkbox.html +++ b/aprendizations/templates/question-checkbox.html @@ -3,20 +3,14 @@ {% block answer %}
-
- {% for n,opt in enumerate(question['options']) %} - -
- - -
-
- {% end %} -
+
+ {% for n,opt in enumerate(question['options']) %} + + {% end %} +
- -{% end %} \ No newline at end of file +{% end %} diff --git a/aprendizations/templates/question-information.html b/aprendizations/templates/question-information.html index 8f6a67d..03e80fd 100644 --- a/aprendizations/templates/question-information.html +++ b/aprendizations/templates/question-information.html @@ -1,6 +1,6 @@ {% autoescape %} - +

{{ question['title'] }}

{{ md(question['text']) }} diff --git a/aprendizations/templates/question-radio.html b/aprendizations/templates/question-radio.html index 763c5b8..6a7c175 100644 --- a/aprendizations/templates/question-radio.html +++ b/aprendizations/templates/question-radio.html @@ -3,19 +3,14 @@ {% block answer %}
-
- {% for n,opt in enumerate(question['options']) %} - -
- - -
-
- {% end %} -
+
+ {% for n,opt in enumerate(question['options']) %} + + {% end %} +
-{% end %} \ No newline at end of file +{% end %} diff --git a/aprendizations/templates/question.html b/aprendizations/templates/question.html index 00275eb..1de5627 100644 --- a/aprendizations/templates/question.html +++ b/aprendizations/templates/question.html @@ -1,6 +1,6 @@ {% autoescape %} - +

{{ md(question['title']) }}

{{ md(question['text']) }} @@ -8,4 +8,4 @@ {% block answer %}{% end %} -

+

diff --git a/aprendizations/templates/rankings.html b/aprendizations/templates/rankings.html index 44aa730..c96ee95 100644 --- a/aprendizations/templates/rankings.html +++ b/aprendizations/templates/rankings.html @@ -1,123 +1,90 @@ {% autoescape %} - + - {{appname}} - - - - + + - - - - + + + - - - - - - + + + {{appname}} -