zesje issueshttps://gitlab.kwant-project.org/zesje/zesje/-/issues2023-11-08T14:53:42Zhttps://gitlab.kwant-project.org/zesje/zesje/-/issues/692Uncaught error in oauth2023-11-08T14:53:42ZAnton AkhmerovUncaught error in oauthI have observed the following error message in the logs on the current master branch:
```
Traceback (most recent call last):
File "/opt/conda/lib/python3.9/site-packages/flask/app.py", line 1484, in full_dispatch_request
rv = self....I have observed the following error message in the logs on the current master branch:
```
Traceback (most recent call last):
File "/opt/conda/lib/python3.9/site-packages/flask/app.py", line 1484, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/conda/lib/python3.9/site-packages/flask/app.py", line 1469, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/opt/conda/lib/python3.9/site-packages/flask/views.py", line 109, in view
return current_app.ensure_sync(self.dispatch_request)(**kwargs)
File "/opt/conda/lib/python3.9/site-packages/flask/views.py", line 190, in dispatch_request
return current_app.ensure_sync(meth)(**kwargs)
File "/app/zesje/api/oauth.py", line 56, in get
user_url = session["oauth_userurl"]
```
While the users did not report disruptions, this warrants investigation.https://gitlab.kwant-project.org/zesje/zesje/-/issues/679Score of feedback options is nullable in the database2022-11-16T11:44:52ZHugo KerstensScore of feedback options is nullable in the databaseThe field `FeedbackOption.score` should not be nullable:
- A null value is not used anywhere in the code
- The front-end doesn't like it and throws errors.
- The root feedback option has score 0
- This originates from before SQLAlchemy
...The field `FeedbackOption.score` should not be nullable:
- A null value is not used anywhere in the code
- The front-end doesn't like it and throws errors.
- The root feedback option has score 0
- This originates from before SQLAlchemy
We should:
- Make it no longer nullable
- Add a migration that fills all null values with `0`.https://gitlab.kwant-project.org/zesje/zesje/-/issues/674More back-end checks for merging copies2022-10-27T13:15:51ZHugo KerstensMore back-end checks for merging copiesThe following discussion from !380 should be addressed:
- [ ] @Hugo started a [discussion](https://gitlab.kwant-project.org/zesje/zesje/-/merge_requests/380#note_56105):
> This MR exactly mimicks the old front-end checks. While wr...The following discussion from !380 should be addressed:
- [ ] @Hugo started a [discussion](https://gitlab.kwant-project.org/zesje/zesje/-/merge_requests/380#note_56105):
> This MR exactly mimicks the old front-end checks. While writing the tests, I realized we only warn the user whether we will modify the newly merged submission.
>
> However, when transferring a copy from submission A to B, submission A will be modified and thus ungraded, but it won't trigger any warning. IMO we should catch this as well and warn the user.
>
> We could either fix it in this MR, or make a new issue for it.https://gitlab.kwant-project.org/zesje/zesje/-/issues/656Automatically rebase MR2022-06-08T14:42:44ZAdriĆ LabayAutomatically rebase MRhttps://medium.com/ovrsea/how-to-automatically-rebase-all-your-merge-requests-on-gitlab-when-pushing-on-master-9b7c5119ac5fhttps://medium.com/ovrsea/how-to-automatically-rebase-all-your-merge-requests-on-gitlab-when-pushing-on-master-9b7c5119ac5fhttps://gitlab.kwant-project.org/zesje/zesje/-/issues/632Cover student number validation with tests2022-03-07T09:20:03ZAnton AkhmerovCover student number validation with tests#630 (fixed by !396) was not caught by tests, and therefore identifies a gap in our coverage.#630 (fixed by !396) was not caught by tests, and therefore identifies a gap in our coverage.https://gitlab.kwant-project.org/zesje/zesje/-/issues/628Drop SQLite migration support2022-03-06T16:07:10ZHugo KerstensDrop SQLite migration supportWe should remove all support for running migrations on/from SQLite. This significantly cleans up the migration environment.
- Almost 50% of the code in the migration environment consists of legacy SQLite backups code. This code will nev...We should remove all support for running migrations on/from SQLite. This significantly cleans up the migration environment.
- Almost 50% of the code in the migration environment consists of legacy SQLite backups code. This code will never be used again.
- The initial migration reads data from SQLite using the current db metadata. Will never be used again, and will break in the future if we ever add new tables.https://gitlab.kwant-project.org/zesje/zesje/-/issues/627Migration for naming database constraints2022-02-07T18:33:57ZHugo KerstensMigration for naming database constraintsThe following discussion from !385 should be addressed:
- [ ] @anton-akhmerov started a [discussion](https://gitlab.kwant-project.org/zesje/zesje/-/merge_requests/385#note_56290): (+1 comment)
> Adding naming conventions is releva...The following discussion from !385 should be addressed:
- [ ] @anton-akhmerov started a [discussion](https://gitlab.kwant-project.org/zesje/zesje/-/merge_requests/385#note_56290): (+1 comment)
> Adding naming conventions is relevant for migrations, is that correct?
Correct, otherwise MySQL uses the default naming convention for constraints, which depends on the order constraints were added. Also, the convention is not guaranteed to be the same for all MySQL servers. This means we do not have a reliable way to access the constraints in migrations.
Even after the current migration, there are tons of constraints which still have the default naming convention, shown by `%_ibfk_%` in the table below. (Apparently alembic only detects renaming unique constraints, not foreign key constraints). **Maybe it's better to solve this in a separate MR with its own migration.** This migration would drop *ALL* constraints and recreate them accordingly.
| TABLE | COLUMN | CONSTRAINT | REFERENCED_TABLE | REFERENCED_COLUMN |
|---|---|---|---|---|
| copy | number | uq_copy__exam_id | | |
| copy | _exam_id | uq_copy__exam_id | | |
| copy | submission_id | **copy_ibfk_1** | submission | id |
| copy | _exam_id | fk_copy__exam_id_exam | exam | id |
| exam | token | uq_exam_token | | |
| exam_widget | exam_id | exam_widget_ibfk_1 | exam | id |
| exam_widget | id | exam_widget_ibfk_2 | widget | id |
| feedback_option | problem_id | **feedback_option_ibfk_1** | problem | id |
| feedback_option | parent_id | fk_parent_feedback | feedback_option | id |
| grader | oauth_id | uq_grader_oauth_id | | |
| mc_option | feedback_id | **mc_option_ibfk_1** | feedback_option | id |
| mc_option | id | **mc_option_ibfk_2** | widget | id |
| page | copy_id | uq_page_copy_id | | |
| page | number | uq_page_copy_id | | |
| page | copy_id | **page_ibfk_1** | copy | id |
| problem | exam_id | **problem_ibfk_1** | exam | id |
| problem_widget | id | **problem_widget_ibfk_1** | widget | id |
| problem_widget | problem_id | **problem_widget_ibfk_2** | problem | id |
| scan | exam_id | **scan_ibfk_1** | exam | id |
| solution | grader_id | **solution_ibfk_1** | grader | id |
| solution | problem_id | **solution_ibfk_2** | problem | id |
| solution | submission_id | **solution_ibfk_3** | submission | id |
| solution_feedback | feedback_option_id | **solution_feedback_ibfk_1** | feedback_option | id |
| solution_feedback | solution_id | **solution_feedback_ibfk_2** | solution | id |
| student | email | uq_student_email | | |
| submission | exam_id | **submission_ibfk_1** | exam | id |
| submission | student_id | **submission_ibfk_2** | student | id |https://gitlab.kwant-project.org/zesje/zesje/-/issues/613Use declarative mixin for feedback option tree structure2021-11-22T20:10:13ZHugo KerstensUse declarative mixin for feedback option tree structureThe following discussion from !375 should be addressed:
- [ ] @Hugo started a [discussion](https://gitlab.kwant-project.org/zesje/zesje/-/merge_requests/375#note_56258): (+2 comments)
> Since a lot of functions currently existing ...The following discussion from !375 should be addressed:
- [ ] @Hugo started a [discussion](https://gitlab.kwant-project.org/zesje/zesje/-/merge_requests/375#note_56258): (+2 comments)
> Since a lot of functions currently existing for `FeedbackOption` are general for tree structures, we might create a `TreeMixin` that implements `parents`, `childrens`, `all_descendants`, `all_ancestors`, `siblings`. Even the `parent_id` and `id` columns could be part of this mixin.
>
> EDIT: And *of course* SQLAlchemy has thought of this: https://docs.sqlalchemy.org/en/14/orm/declarative_mixins.html. Seriously though, almost every little thing you want to do with SQLAlchemy is possible natively.https://gitlab.kwant-project.org/zesje/zesje/-/issues/612Add unique constraint for validated submission per student per exam2021-11-20T17:06:21ZHugo KerstensAdd unique constraint for validated submission per student per examWe have wanted to add a unique constraint for `(submission.student_id, submission.exam_id)` for some time, but only for validated submissions (thus with `submission.validated = TRUE`). Adding such a constraint on the MySQL is not possibl...We have wanted to add a unique constraint for `(submission.student_id, submission.exam_id)` for some time, but only for validated submissions (thus with `submission.validated = TRUE`). Adding such a constraint on the MySQL is not possible naturally, but I just realized we can exploit the fact that MySQL ignores `NULL` values for the unique constraint. See the [MySQL docs](https://dev.mysql.com/doc/refman/8.0/en/create-index.html) under 'Unique Indexes'.
For this, we will store unvalidated submissions with `submission.validated = NULL`, and validated submissions with `submission.validated = TRUE`. After that it's as simple as adding a unique constraint on `(submission.student_id, submission.exam_id, submission.validated)`.https://gitlab.kwant-project.org/zesje/zesje/-/issues/611Add test fixture for database with (partially) graded exam2021-11-22T08:29:43ZHugo KerstensAdd test fixture for database with (partially) graded examWe should have a test fixture which produces a database with a (partially) graded exam, similar to what the `example_data.py` script produces. This can help to more easily write tests for different endpoints, for example the export endpo...We should have a test fixture which produces a database with a (partially) graded exam, similar to what the `example_data.py` script produces. This can help to more easily write tests for different endpoints, for example the export endpoint.https://gitlab.kwant-project.org/zesje/zesje/-/issues/590auto Dockerfile is broken2023-10-20T21:08:29ZHugo Kerstensauto Dockerfile is brokenThere are 2 problems:
- Mysql cannot find shared libraries as the conda environment is not activated
- The mysql init file is not created in the data directory, but in the root dir, causing permission issues.There are 2 problems:
- Mysql cannot find shared libraries as the conda environment is not activated
- The mysql init file is not created in the data directory, but in the root dir, causing permission issues.https://gitlab.kwant-project.org/zesje/zesje/-/issues/584Upload issues when running Zesje as Docker container2021-10-01T09:52:27ZOtto VisserUpload issues when running Zesje as Docker containerZesje uses nginx for proxy, but the upload size limit is the default for nginx. For most uploads of scanned exams, this is not enough. I changed line 7 in auto.Dockerfile to:
`RUN echo "server { client_max_body_size 128M; listen 80; loc...Zesje uses nginx for proxy, but the upload size limit is the default for nginx. For most uploads of scanned exams, this is not enough. I changed line 7 in auto.Dockerfile to:
`RUN echo "server { client_max_body_size 128M; listen 80; location / { proxy_pass http://127.0.0.1:5000; } }" > /etc/nginx/sites-enabled/proxy.conf` to resolve this issue.https://gitlab.kwant-project.org/zesje/zesje/-/issues/536Restructure project folder2020-11-08T17:56:25ZAdriĆ LabayRestructure project folderMove docker files into a single `docker` folder, configuration files into single `config` folder...Move docker files into a single `docker` folder, configuration files into single `config` folder...https://gitlab.kwant-project.org/zesje/zesje/-/issues/507Javascript errors on overview page2022-02-14T18:41:13ZHugo KerstensJavascript errors on overview pageThree points from this [discussion](https://gitlab.kwant-project.org/zesje/zesje/-/merge_requests/297#note_44320) from !297 should be addressed:
- [x] err.json is not a function
> I'm seeing on this branch:
> ```
> Uncaught ...Three points from this [discussion](https://gitlab.kwant-project.org/zesje/zesje/-/merge_requests/297#note_44320) from !297 should be addressed:
- [x] err.json is not a function
> I'm seeing on this branch:
> ```
> Uncaught (in promise) TypeError: err.json is not a function
> at eval (webpack-internal:///./client/views/Overview.jsx:723)
> ```
>
> Didn't try on master.
- [ ] NaN is not a length
> I also see some more errors for the Overview page (the traceback is useless, just happens when the new state is set):
> ![image](/uploads/8d4b59a7607f1b0dbb2d6e97d464f5fe/image.png)
- [x] clicking on the histogram
> There is also another error in the overview when clicking anywhere on the histogram:
> ```error
> Overview.jsx:482 Uncaught TypeError: Cannot read property 'results' of undefined
> at onClick (Overview.jsx:482)
> at plotly-cartesian.js:366
> at o.emit (plotly-cartesian.js:444)
> at HTMLDivElement.t.emit (plotly-cartesian.js:38363)
> at o (plotly-cartesian.js:22170)
> at Object.e.exports [as click] (plotly-cartesian.js:22175)
> at Object.Ot [as clickFn] (plotly-cartesian.js:56846)
> at HTMLDocument.M (plotly-cartesian.js:19579)
> onClick @ 18.index_bundle.js:1
> (anonymous) @ 11.index_bundle.js:1
> o.emit @ 11.index_bundle.js:1
> t.emit @ plotly-cartesian.js:11767
> o @ plotly-cartesian.js:11767
> e.exports @ plotly-cartesian.js:11767
> Ot @ plotly-cartesian.js:11767
> M @ plotly-cartesian.js:11767
> ```https://gitlab.kwant-project.org/zesje/zesje/-/issues/481Split import and processing pipeline2022-06-03T14:31:32ZHugo KerstensSplit import and processing pipelineWhen a user uploads a file:
1. We save the file to the disk, create a `Scan` entry, and start the importing task.
2. In the importing task, we extract every image we can find in the file. We store this image information the `Image` table...When a user uploads a file:
1. We save the file to the disk, create a `Scan` entry, and start the importing task.
2. In the importing task, we extract every image we can find in the file. We store this image information the `Image` table, containing: `path`, `origin`, `status` and `scan_id`.
3. After the import task is finished, we start the processing task for the `scan_id`.
4. The processing task reads all `Image` entries from the database, and processes them according to `status`, creating `Page` entries in the process.
The `Image` table:
- `id`: primary key
- `path`: path to the image on disk
- `origin`: path to the image in the original scan file
- `status`: one of `normal`, `raw`, `failed`.
- `scan_id`: points to the scan
The `Page` table:
- Add `image_id`
- Remove `path`
We can deduce what to do with an `Image` the following way (related to #455):
- The status `normal`/`raw` without a `Page` entry means: waiting for processing with the normal/raw pipeline.
- The status `normal` with a `Page` entry means: processed successfully with the normal pipeline, immutable.
- The status `raw` with a `Page` entry means: processed successfully with the raw pipeline, we still allow assigning a different student, page and copy manually.
- The status `failed` without a `Page` entry indicates the user can either manually assign student, page and copy, or delete the image altogether.Image Processing Pipelinehttps://gitlab.kwant-project.org/zesje/zesje/-/issues/473Option for ignoring MySQL state in example data script2020-05-09T22:02:54ZHugo KerstensOption for ignoring MySQL state in example data scriptThe current example data script checks if MySQL is running, initializes it, starts/stops it. For this it uses the development configuration of the MySQL database, making it incompatible with a production database.
We should add an optio...The current example data script checks if MySQL is running, initializes it, starts/stops it. For this it uses the development configuration of the MySQL database, making it incompatible with a production database.
We should add an option `--no-mysql` to run the script independently of the MySQL server configuration, but simply assuming it's running.https://gitlab.kwant-project.org/zesje/zesje/-/issues/437Webpack production build never finishes on Windows (WSL)2020-04-11T12:04:47ZHugo KerstensWebpack production build never finishes on Windows (WSL)Using the latest master, the webpack production build (`yarn build`) hangs on `92% chunk asset optimization UglifyJSPlugin`.
I'm on Windows 10 using WSL Debian.Using the latest master, the webpack production build (`yarn build`) hangs on `92% chunk asset optimization UglifyJSPlugin`.
I'm on Windows 10 using WSL Debian.Hugo KerstensHugo Kerstenshttps://gitlab.kwant-project.org/zesje/zesje/-/issues/424Uploading wrong scans2020-03-20T20:21:22ZJakobUploading wrong scansI accidentally uploaded model solutions written on Zesje exam paper. This caused some trouble when I wanted to send emails to the students. When I tried to send the emails I got the error message "All submissions must be validated befor...I accidentally uploaded model solutions written on Zesje exam paper. This caused some trouble when I wanted to send emails to the students. When I tried to send the emails I got the error message "All submissions must be validated before sending emails." I solved this by creating a fake student with a nonexistent email and assigning that submission to that student. Then I could send emails again. This issue is about implementing a better solution for the future.https://gitlab.kwant-project.org/zesje/zesje/-/issues/422Autoapprove one answer excluding blanks2022-10-31T15:02:57ZOtto KaaijAutoapprove one answer excluding blanksCurrently the "One answer" option for the also auto approves blanks.
From recent experience grading large multiple choice exams:
- Solutions still sometimes get recognized as blank, even though they're not.
- Solutions for which only o...Currently the "One answer" option for the also auto approves blanks.
From recent experience grading large multiple choice exams:
- Solutions still sometimes get recognized as blank, even though they're not.
- Solutions for which only one answer is detected are always correct.
If there were to be an option that auto approved 'one answer', but not the blanks, this would be perfect.
The auto approve options "One answer and blanks" should also stay, IMO.https://gitlab.kwant-project.org/zesje/zesje/-/issues/415Does anyone know trick to solve problem of matrix-codes/QR-codes not being pr...2021-09-19T11:59:19ZEric VerschuurDoes anyone know trick to solve problem of matrix-codes/QR-codes not being printedWe just had an exam today, but during the exam we found out that the printer did not print the matrix-code/QR-code on each page (although they are present in the original Zesje-generated PDF file).
Apparently our printer was not doing a ...We just had an exam today, but during the exam we found out that the printer did not print the matrix-code/QR-code on each page (although they are present in the original Zesje-generated PDF file).
Apparently our printer was not doing a proper job....
Solution that I have tried: scan the exam, copy the matrix-code from exactly the same page of the original PDF and paste it graphically (e.g. using Adobe Acrobat) on the scanned exam page. This has worked in a test.
We suspect ~50 of such erroneous pages, so that's still a lot of work.
Does anyone know another trick to solve this issue?
Regards Eric Verschuur