Commit 7dac4894bf20feaa72c081183333fcb564ff4e5a
1 parent
1b9491c2
Exists in
master
and in
1 other branch
fix mypy and pyright warnings
review explicitly indicates that a test was not corrected instead of grade=NaN
Showing
11 changed files
with
23 additions
and
19 deletions
Show diff stats
demo/demo.yaml
| ... | ... | @@ -32,7 +32,7 @@ autosubmit: false |
| 32 | 32 | # shown to the student. If false, the test is saved but not corrected. |
| 33 | 33 | # No grade is shown to the student. |
| 34 | 34 | # (default: true) |
| 35 | -autocorrect: false | |
| 35 | +autocorrect: true | |
| 36 | 36 | |
| 37 | 37 | # Show points for each question (min and max). |
| 38 | 38 | # (default: true) | ... | ... |
demo/questions/questions-tutorial.yaml
perguntations/__init__.py
| ... | ... | @@ -33,7 +33,7 @@ proof of submission and for review. |
| 33 | 33 | |
| 34 | 34 | APP_NAME = 'perguntations' |
| 35 | 35 | APP_VERSION = '2022.01.dev1' |
| 36 | -APP_DESCRIPTION = __doc__ | |
| 36 | +APP_DESCRIPTION = str(__doc__) | |
| 37 | 37 | |
| 38 | 38 | __author__ = 'Miguel Barão' |
| 39 | 39 | __copyright__ = 'Copyright 2022, Miguel Barão' | ... | ... |
perguntations/app.py
| ... | ... | @@ -20,9 +20,9 @@ from sqlalchemy.orm import Session |
| 20 | 20 | import yaml |
| 21 | 21 | |
| 22 | 22 | # this project |
| 23 | -from perguntations.models import Student, Test, Question | |
| 24 | -from perguntations.tools import load_yaml | |
| 25 | -from perguntations.testfactory import TestFactory, TestFactoryException | |
| 23 | +from .models import Student, Test, Question | |
| 24 | +from .tools import load_yaml | |
| 25 | +from .testfactory import TestFactory, TestFactoryException | |
| 26 | 26 | |
| 27 | 27 | # setup logger for this module |
| 28 | 28 | logger = logging.getLogger(__name__) | ... | ... |
perguntations/initdb.py
| ... | ... | @@ -18,7 +18,7 @@ from sqlalchemy.orm import Session |
| 18 | 18 | from sqlalchemy.exc import IntegrityError |
| 19 | 19 | |
| 20 | 20 | # this project |
| 21 | -from perguntations.models import Base, Student | |
| 21 | +from .models import Base, Student | |
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | # ============================================================================ | ... | ... |
perguntations/main.py
| ... | ... | @@ -14,10 +14,10 @@ import ssl |
| 14 | 14 | import sys |
| 15 | 15 | |
| 16 | 16 | # this project |
| 17 | -from perguntations.app import App, AppException | |
| 18 | -from perguntations.serve import run_webserver | |
| 19 | -from perguntations.tools import load_yaml | |
| 20 | -from perguntations import APP_NAME, APP_VERSION | |
| 17 | +from .app import App, AppException | |
| 18 | +from .serve import run_webserver | |
| 19 | +from .tools import load_yaml | |
| 20 | +from . import APP_NAME, APP_VERSION | |
| 21 | 21 | |
| 22 | 22 | # ---------------------------------------------------------------------------- |
| 23 | 23 | def parse_cmdline_arguments() -> argparse.Namespace: | ... | ... |
perguntations/questions.py
| ... | ... | @@ -15,7 +15,7 @@ from typing import Any, Dict, NewType |
| 15 | 15 | import uuid |
| 16 | 16 | |
| 17 | 17 | # this project |
| 18 | -from perguntations.tools import run_script, run_script_async | |
| 18 | +from .tools import run_script, run_script_async | |
| 19 | 19 | |
| 20 | 20 | # setup logger for this module |
| 21 | 21 | logger = logging.getLogger(__name__) | ... | ... |
perguntations/serve.py
perguntations/templates/review.html
| ... | ... | @@ -97,9 +97,12 @@ |
| 97 | 97 | <div class="row"> |
| 98 | 98 | <label for="nota" class="col-sm-2">Nota:</label> |
| 99 | 99 | <div class="col-sm-10" id="nota"> |
| 100 | - <span class="badge badge-primary">{{ round(t['grade'], 2) }}</span> valores | |
| 101 | - {% if t['state'] == 'QUIT' %} | |
| 102 | - (DESISTÊNCIA) | |
| 100 | + {% if t['state'] == 'CORRECTED' %} | |
| 101 | + <span class="badge badge-primary">{{ round(t['grade'], 2) }}</span> valores | |
| 102 | + {% elif t['state'] == 'SUBMITTED' %} | |
| 103 | + (não corrigido) | |
| 104 | + {% elif t['state'] == 'QUIT' %} | |
| 105 | + (DESISTIU) | |
| 103 | 106 | {% end %} |
| 104 | 107 | </div> |
| 105 | 108 | </div> | ... | ... |
perguntations/testfactory.py
| ... | ... | @@ -11,9 +11,9 @@ import logging |
| 11 | 11 | import schema |
| 12 | 12 | |
| 13 | 13 | # this project |
| 14 | -from perguntations.questions import QFactory, QuestionException, QDict | |
| 15 | -from perguntations.test import Test | |
| 16 | -from perguntations.tools import load_yaml | |
| 14 | +from .questions import QFactory, QuestionException, QDict | |
| 15 | +from .test import Test | |
| 16 | +from .tools import load_yaml | |
| 17 | 17 | |
| 18 | 18 | # Logger configuration |
| 19 | 19 | logger = logging.getLogger(__name__) | ... | ... |