diff --git a/BUGS.md b/BUGS.md index 0ad4c29..bf2d5fd 100644 --- a/BUGS.md +++ b/BUGS.md @@ -1,6 +1,7 @@ # BUGS +- permitir configuracao para escolher entre static files locais ou remotos - sqlalchemy.pool.impl.NullPool: Exception during reset or similar sqlite3.ProgrammingError: SQLite objects created in a thread can only be used in that same thread. diff --git a/README.md b/README.md index c124968..358c9d1 100644 --- a/README.md +++ b/README.md @@ -85,8 +85,9 @@ At this point aprendizations is installed in ~/.local/bin # FreeBSD/Linux ``` -and can be run with the command `aprendizations` (make sure this directory is -in your `$PATH`). +Make sure this directory is in your `$PATH`. + +The server can be run with the command `aprendizations` from the terminal. ## Configuration @@ -121,7 +122,7 @@ have a registered publicly accessible domain name. #### Selfsigned -Generate a selfsigned certificate and place it in `aprendizations/certs`. +Generate a selfsigned certificate and place it in `~/.local/share/certs`. ```sh openssl req -x509 -newkey rsa:4096 -keyout privkey.pem -out cert.pem -days 365 -nodes @@ -141,7 +142,7 @@ sudo certbot certonly --standalone -d www.example.com sudo service pf start # enable pf firewall ``` -Certificates are saved under `/usr/local/etc/letsencrypt/live/www.example.com/`. Copy them to `aprendizations/certs` and change permissions to be readable: +Certificates are saved under `/usr/local/etc/letsencrypt/live/www.example.com/`. Copy them to `~/.local/share/certs` and change permissions to be readable: ```sh sudo cp /usr/local/etc/letsencrypt/live/www.example.com/cert.pem . @@ -157,7 +158,7 @@ sudo certbot renew sudo service pf start # start firewall ``` -and then copy the `cert.pem` and `privkey.pem` files to `aprendizations/certs` directory. Change permissions and ownership as appropriate. +and then copy the `cert.pem` and `privkey.pem` files to `~/.local/share/certs` directory. Change permissions and ownership as appropriate. ### Testing @@ -169,7 +170,8 @@ cd demo aprendizations demo.yaml ``` -and open a browser at [https://127.0.0.1:8443](). If it everything looks good, +and open a browser at [https://127.0.0.1:8443](https://127.0.0.1:8443). +If it everything looks good, check at the correct address `https://www.example.com` (requires port forward in the firewall). The option `--debug` provides more verbose logging and might be useful during testing. The option `--check` generates all the questions once diff --git a/aprendizations/learnapp.py b/aprendizations/learnapp.py index 1d3fb98..02df6d5 100644 --- a/aprendizations/learnapp.py +++ b/aprendizations/learnapp.py @@ -459,3 +459,5 @@ class LearnApp(object): for uid, name in students if uid != '0'] return sorted(rankings, key=lambda x: x[2], reverse=True) + + # ------------------------------------------------------------------------ diff --git a/aprendizations/questions.py b/aprendizations/questions.py index fc83b70..3bbc7df 100644 --- a/aprendizations/questions.py +++ b/aprendizations/questions.py @@ -28,9 +28,9 @@ class QuestionException(Exception): # =========================================================================== class Question(dict): ''' - Classes derived from this base class are meant to instantiate a question - to a student. - Instances can shuffle options, or automatically generate questions. + Classes derived from this base class are meant to instantiate questions + for each student. + Instances can shuffle options or automatically generate questions. ''' def __init__(self, q: QDict) -> None: super().__init__(q) @@ -125,7 +125,7 @@ class QuestionRadio(Question): self['correct'] = [float(correct[i]) for i in perm] # ------------------------------------------------------------------------ - # can return negative values for wrong answers + # can assign negative grades for wrong answers def correct(self) -> None: super().correct() diff --git a/config/logger.yaml b/config/logger.yaml index 4a5def2..bf54e54 100644 --- a/config/logger.yaml +++ b/config/logger.yaml @@ -5,7 +5,7 @@ formatters: void: format: '' standard: - format: '%(asctime)s | %(thread)-15d | %(levelname)-9s | %(name)-24s | %(message)s' + format: '%(asctime)s | %(thread)-15d | %(levelname)-9s | %(message)s' datefmt: '%Y-%m-%d %H:%M:%S' handlers: -- libgit2 0.21.2