zesje issueshttps://gitlab.kwant-project.org/zesje/zesje/-/issues2022-11-16T11:44:52Zhttps://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/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/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/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 Verschuurhttps://gitlab.kwant-project.org/zesje/zesje/-/issues/367Server default values for booleans in the database schema2020-01-26T13:35:00ZHugo KerstensServer default values for booleans in the database schemaThe `server_default` values of booleans are set to `'f'` in the database schema. The correct value is `0` for SQLite, SQLAlchemy provides [`false()`](https://docs.sqlalchemy.org/en/13/core/sqlelement.html#sqlalchemy.sql.expression.false)...The `server_default` values of booleans are set to `'f'` in the database schema. The correct value is `0` for SQLite, SQLAlchemy provides [`false()`](https://docs.sqlalchemy.org/en/13/core/sqlelement.html#sqlalchemy.sql.expression.false) for this. Currently, we don't notice this mistake since we do not rely on the database engine to set our defaults, but rather on SQLAlchemy. Still, we should use fix our current schema to set the correct defaults. For this we need to:
* [ ] Add a migration script for this
* [ ] Change the values in `database.py`
* [ ] Check if this change does not cause unintended behaviorhttps://gitlab.kwant-project.org/zesje/zesje/-/issues/364Inconsistent graded_at and graded_by2019-11-16T15:28:56ZOtto KaaijInconsistent graded_at and graded_byProblems can currently have a graded_at, but not a graded_by. This results in a nullpointer in grade.jsx:349.
This happens (sometimes) when first a requests removes the last feedback option, and very quickly after a request adds a new ...Problems can currently have a graded_at, but not a graded_by. This results in a nullpointer in grade.jsx:349.
This happens (sometimes) when first a requests removes the last feedback option, and very quickly after a request adds a new option, resetting it to graded. Something goes wrong here, and results in a state where `graded_at != null and graded_by == null`https://gitlab.kwant-project.org/zesje/zesje/-/issues/213replace arrow functions consisting of a single `return` statement with an exp...2019-11-16T16:58:11ZJoseph Westonreplace arrow functions consisting of a single `return` statement with an expression```javascript
const f = () => {
return (
<expr>
)
}
```
VS.
```javascript
const f = () => (
<expr>
)
```
##### Advantages
+ 1 less level of indentation
+ 2 fewer lines
##### Disadvantages
+ Requires refactoring if we need t...```javascript
const f = () => {
return (
<expr>
)
}
```
VS.
```javascript
const f = () => (
<expr>
)
```
##### Advantages
+ 1 less level of indentation
+ 2 fewer lines
##### Disadvantages
+ Requires refactoring if we need to add additional statements (e.g. for defining `const` values that are used several timeshttps://gitlab.kwant-project.org/zesje/zesje/-/issues/681Catch errors in uploaded csv2023-04-14T09:15:46ZAnton AkhmerovCatch errors in uploaded csvTrying to upload an invalid csv results in a 500 with this error.
```
Traceback (most recent call last):
File "/opt/conda/envs/zesje-dev/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispa...Trying to upload an invalid csv results in a 500 with this error.
```
Traceback (most recent call last):
File "/opt/conda/envs/zesje-dev/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/conda/envs/zesje-dev/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/opt/conda/envs/zesje-dev/lib/python3.8/site-packages/flask_restful/__init__.py", line 467, in wrapper
resp = resource(*args, **kwargs)
File "/opt/conda/envs/zesje-dev/lib/python3.8/site-packages/flask/views.py", line 84, in view
return current_app.ensure_sync(self.dispatch_request)(*args, **kwargs)
File "/opt/conda/envs/zesje-dev/lib/python3.8/site-packages/flask_restful/__init__.py", line 582, in dispatch_request
resp = meth(*args, **kwargs)
File "/app/zesje/api/students.py", line 136, in post
student = _row_to_student(row)
File "/app/zesje/api/students.py", line 175, in _row_to_student
first_name=row['First Name'],
File "/opt/conda/envs/zesje-dev/lib/python3.8/site-packages/pandas/core/series.py", line 981, in __getitem__
return self._get_value(key)
File "/opt/conda/envs/zesje-dev/lib/python3.8/site-packages/pandas/core/series.py", line 1089, in _get_value
loc = self.index.get_loc(label)
File "/opt/conda/envs/zesje-dev/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 3805, in get_loc
raise KeyError(key) from err
KeyError: 'First Name'
```
we catch it and be more informativehttps://gitlab.kwant-project.org/zesje/zesje/-/issues/671Searching students in grade view is broken2022-10-31T16:58:44ZHugo KerstensSearching students in grade view is brokenSearching student relies using the grade navigation in the grade view relies on the front-end having the full student data available for each submission. This data is requested from the `api/exams/<exam_id>/?only_metadata=true` endpoint ...Searching student relies using the grade navigation in the grade view relies on the front-end having the full student data available for each submission. This data is requested from the `api/exams/<exam_id>/?only_metadata=true` endpoint in the `Grade` component, but since commit a8e6e83708912687dfbf445c0f0b6e09547fb290, this no longer returns the full student data per submission, just the submission id and student id.
**_Note: this only applies to exams which have anonymous grading set to false._**
I see two options:
1. Add the student names back to the exam metadata endpoint. (How large is the performance impact?)
2. Add a separate API call in the grade navigation endpoint once it is focused, which loads the student names. Could add `only_metadata` option to the `api/submissions/<exam_id>` endpoint, which excludes solution data.https://gitlab.kwant-project.org/zesje/zesje/-/issues/662Show warning when looking at answer with multiple submissions assigned2022-10-31T11:05:25ZStefan HugtenburgShow warning when looking at answer with multiple submissions assignedIn some browsers the scrollbar only shows up when you hover over the image, meaning it is easy to miss that this exam has two (or more) submissions assigned. Especially for longer problems that can lead to incorrectly marking the answer ...In some browsers the scrollbar only shows up when you hover over the image, meaning it is easy to miss that this exam has two (or more) submissions assigned. Especially for longer problems that can lead to incorrectly marking the answer as blank.
Even with the scrollbar, noticing that this is actually 2 is not obvious :smile:
![image](/uploads/845fdab3843938b400b3f0365aca3487/image.png)