zesje issueshttps://gitlab.kwant-project.org/zesje/zesje/-/issues2023-11-15T11:08:48Zhttps://gitlab.kwant-project.org/zesje/zesje/-/issues/695Celery workers still failing2023-11-15T11:08:48ZAnton AkhmerovCelery workers still failingOn v0.4.9 I see the following traceback in celery logs when multiple tasks are running.
```python
[2023-11-15 09:43:47,064: ERROR/ForkPoolWorker-2] Task zesje.scans.process_scan[c0123198-e0ce-4ab4-9707-7815826b7903] raised unexpected: P...On v0.4.9 I see the following traceback in celery logs when multiple tasks are running.
```python
[2023-11-15 09:43:47,064: ERROR/ForkPoolWorker-2] Task zesje.scans.process_scan[c0123198-e0ce-4ab4-9707-7815826b7903] raised unexpected: PendingRollbackError("Can't reconnect until invalid transaction is rolled back.")
Traceback (most recent call last):
File "/app/zesje/scans.py", line 100, in _process_scan
report_progress(f"Processing page {number} / {total}")
File "/app/zesje/scans.py", line 187, in write_scan_status
scan = Scan.query.get(scan_id)
File "<string>", line 2, in get
File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/util/deprecations.py", line 468, in warned
return fn(*args, **kwargs)
File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/orm/query.py", line 947, in get
return self._get_impl(ident, loading.load_on_pk_identity)
File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/orm/query.py", line 951, in _get_impl
return self.session._get_impl(
File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/orm/session.py", line 2942, in _get_impl
instance = self._identity_lookup(
File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/orm/session.py", line 2220, in _identity_lookup
return loading.get_from_identity(self, mapper, key, passive)
File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/orm/loading.py", line 379, in get_from_identity
state._load_expired(state, passive)
File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/orm/state.py", line 712, in _load_expired
self.manager.expired_attribute_loader(self, toload, passive)
File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/orm/loading.py", line 1451, in load_scalar_attributes
result = load_on_ident(
File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/orm/loading.py", line 407, in load_on_ident
return load_on_pk_identity(
File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/orm/loading.py", line 530, in load_on_pk_identity
session.execute(
File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/orm/session.py", line 1717, in execute
result = conn._execute_20(statement, params or {}, execution_options)
File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1710, in _execute_20
return meth(self, args_10style, kwargs_10style, execution_options)
File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/sql/elements.py", line 334, in _execute_on_connection
return connection._execute_clauseelement(
File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1577, in _execute_clauseelement
ret = self._execute_context(
File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1808, in _execute_context
conn = self._revalidate_connection()
File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 650, in _revalidate_connection
self._invalid_transaction()
File "/opt/conda/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 622, in _invalid_transaction
raise exc.PendingRollbackError(
sqlalchemy.exc.PendingRollbackError: Can't reconnect until invalid transaction is rolled back. (Background on this error at: https://sqlalche.me/e/14/8s2b)
```https://gitlab.kwant-project.org/zesje/zesje/-/issues/694App unconditionally executes DB statements on startup2023-11-22T11:03:38ZAnton AkhmerovApp unconditionally executes DB statements on startupWith the current master, running `yarn dev:mysql-init` fails with the error `pymysql.err.ProgrammingError: (1146, "Table 'course.grader' doesn't exist")`. This also occurs in production.
<details><summary>Full traceback</summary>
```
...With the current master, running `yarn dev:mysql-init` fails with the error `pymysql.err.ProgrammingError: (1146, "Table 'course.grader' doesn't exist")`. This also occurs in production.
<details><summary>Full traceback</summary>
```
yarn dev:mysql-init (zesje-dev)
yarn run v1.22.19
$ yarn dev:mysql create && sleep 2 && yarn dev:mysql-migrate
$ ZESJE_SETTINGS=$(pwd)/zesje_dev_cfg.py python3 -m zesje.mysql create
Initializing MySQL...
mysqld --defaults-file=/home/anton/Bot/coding/zesje/mysql.conf --datadir=/home/anton/Bot/coding/zesje/data-dev/mysql --basedir=$CONDA_PREFIX/bin --lc-messages-dir=$CONDA_PREFIX/share/mysql --plugin-dir=$CONDA_PREFIX/lib/plugin --init-file=/home/anton/Bot/coding/zesje/myinit.sql --initialize
$ yarn dev:mysql is-running && (yarn dev:migrate || true) || ((yarn dev:mysql start && sleep 2 && yarn dev:migrate); yarn dev:mysql stop)
$ ZESJE_SETTINGS=$(pwd)/zesje_dev_cfg.py python3 -m zesje.mysql is-running
MySQL is not running
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
$ ZESJE_SETTINGS=$(pwd)/zesje_dev_cfg.py python3 -m zesje.mysql start
mysqld --defaults-file=/home/anton/Bot/coding/zesje/mysql.conf --datadir=/home/anton/Bot/coding/zesje/data-dev/mysql --basedir=$CONDA_PREFIX/bin --lc-messages-dir=$CONDA_PREFIX/share/mysql --plugin-dir=$CONDA_PREFIX/lib/plugin --gdb
$ ZESJE_SETTINGS=$(pwd)/zesje_dev_cfg.py FLASK_APP=zesje.wsgi:app flask db upgrade
Traceback (most recent call last):
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1910, in _execute_context
self.dialect.do_execute(
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
cursor.execute(statement, parameters)
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/pymysql/cursors.py", line 153, in execute
result = self._query(query)
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/pymysql/cursors.py", line 322, in _query
conn.query(q)
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/pymysql/connections.py", line 558, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/pymysql/connections.py", line 822, in _read_query_result
result.read()
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/pymysql/connections.py", line 1200, in read
first_packet = self.connection._read_packet()
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/pymysql/connections.py", line 772, in _read_packet
packet.raise_for_error()
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/pymysql/protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1146, "Table 'course.grader' doesn't exist")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/anton/micromamba/envs/zesje-dev/bin/flask", line 8, in <module>
sys.exit(main())
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/flask/cli.py", line 1064, in main
cli.main()
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/flask/cli.py", line 355, in decorator
app = __ctx.ensure_object(ScriptInfo).load_app()
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/flask/cli.py", line 309, in load_app
app = locate_app(import_name, name)
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/flask/cli.py", line 219, in locate_app
__import__(module_name)
File "/home/anton/Bot/coding/zesje/zesje/wsgi.py", line 4, in <module>
app = factory.create_app(celery=celery)
File "/home/anton/Bot/coding/zesje/zesje/factory.py", line 42, in create_app
if Grader.query.filter(Grader.oauth_id == app.config["OWNER_OAUTH_ID"]).one_or_none() is None:
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/sqlalchemy/orm/query.py", line 2850, in one_or_none
return self._iter().one_or_none()
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/sqlalchemy/orm/query.py", line 2916, in _iter
result = self.session.execute(
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/sqlalchemy/orm/session.py", line 1717, in execute
result = conn._execute_20(statement, params or {}, execution_options)
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1710, in _execute_20
return meth(self, args_10style, kwargs_10style, execution_options)
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/sqlalchemy/sql/elements.py", line 334, in _execute_on_connection
return connection._execute_clauseelement(
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1577, in _execute_clauseelement
ret = self._execute_context(
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1953, in _execute_context
self._handle_dbapi_exception(
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 2134, in _handle_dbapi_exception
util.raise_(
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/sqlalchemy/util/compat.py", line 211, in raise_
raise exception
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1910, in _execute_context
self.dialect.do_execute(
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
cursor.execute(statement, parameters)
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/pymysql/cursors.py", line 153, in execute
result = self._query(query)
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/pymysql/cursors.py", line 322, in _query
conn.query(q)
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/pymysql/connections.py", line 558, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/pymysql/connections.py", line 822, in _read_query_result
result.read()
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/pymysql/connections.py", line 1200, in read
first_packet = self.connection._read_packet()
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/pymysql/connections.py", line 772, in _read_packet
packet.raise_for_error()
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/pymysql/protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "/home/anton/micromamba/envs/zesje-dev/lib/python3.9/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError) (1146, "Table 'course.grader' doesn't exist")
[SQL: SELECT grader.id AS grader_id, grader.name AS grader_name, grader.oauth_id AS grader_oauth_id, grader.internal AS grader_internal
FROM grader
WHERE grader.oauth_id = %(oauth_id_1)s]
[parameters: {'oauth_id_1': 'admin@admin'}]
```
</details>https://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/691graded_at may be empty even if grader is set2023-10-04T10:55:27ZAnton Akhmerovgraded_at may be empty even if grader is setThis causes statistics to failThis causes statistics to failhttps://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/623Navigating back after a login gives 5002022-03-06T16:03:48ZAnton AkhmerovNavigating back after a login gives 500To reproduce:
- Log in
- Use the browser "back" functionalityTo reproduce:
- Log in
- Use the browser "back" functionalityhttps://gitlab.kwant-project.org/zesje/zesje/-/issues/602System slows down during login2022-03-15T12:55:56ZStefan HugtenburgSystem slows down during loginWhen someone logs in (maybe only when for the first time, not sure?) the system slows down. Anton mentioned a full CPU load on the backend while the login was happening.When someone logs in (maybe only when for the first time, not sure?) the system slows down. Anton mentioned a full CPU load on the backend while the login was happening.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/587Race condition in Flask session data2022-10-07T09:32:40ZHugo KerstensRace condition in Flask session dataIt is possible for race conditions to occur in loading and saving the Flask session data, causing data loss.
A solution would be to use an extension to store the session data in a centralized place, instead of client side. The best opti...It is possible for race conditions to occur in loading and saving the Flask session data, causing data loss.
A solution would be to use an extension to store the session data in a centralized place, instead of client side. The best option IMO is `flasksession` with the Redis backend.
This also solves another issue that the session data is not accessible in Celery workers, as the `SECRET_KEY` that is issued to encrypt the session data is random for each instance of a Flask app (Celery workers have their own Flask app instance).
---
### Extra description from !362
After some investigation I found that there is a race condition. It happens more often with the mock server as the request is quicker.
As you open a page, the following happens:
- `GET url/to/view`
- `GET api/oauth/start?userurl=/url/to/view`
- `GET api/oauth/grader`
Both calls to `api/oauth/start` and `api/oauth/grader` are emitted at the same moment, originating from the `componentDidMount` of the `Login` and `NavBar` components respectively. Both requests load the same session data from the request at the same time, but the request that finishes last overwrites the session data from the other. This means that if `api/oauth/grader` finishes later, the session data gets overwritten with unaltered data, undoing the effects of `api/oauth/start`.https://gitlab.kwant-project.org/zesje/zesje/-/issues/524Error with scan: Multiple rows were found for one_or_none()2022-01-18T21:47:22ZzperkoError with scan: Multiple rows were found for one_or_none()I can't seem to process a copy of exam 3C in instance:
https://ap3582.grading.quantumtinkerer.tudelft.nl/exams/15/
I even tried uploading the Zesje generated PDF No.9 and also gives the error "Multiple rows were found for one_or_none()"I can't seem to process a copy of exam 3C in instance:
https://ap3582.grading.quantumtinkerer.tudelft.nl/exams/15/
I even tried uploading the Zesje generated PDF No.9 and also gives the error "Multiple rows were found for one_or_none()"https://gitlab.kwant-project.org/zesje/zesje/-/issues/470Catch celery workers dying2020-05-25T19:58:42ZAnton AkhmerovCatch celery workers dyingA user encountered a malformed PDF provided by third party software (a bunch of syntax errors and whatnot). This causes a segfault somewhere in our image processing pipeline. Since the celery worker just dies, the pdf status never gets w...A user encountered a malformed PDF provided by third party software (a bunch of syntax errors and whatnot). This causes a segfault somewhere in our image processing pipeline. Since the celery worker just dies, the pdf status never gets written into the database, and the processing looks like it got forever stuck.
We could try to use celery callbacks or similar functionality to detect whether it happens, and properly update the PDF status.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/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/376Non-empty answers identified as blank2021-09-19T11:57:42ZFokko van de BultNon-empty answers identified as blankMany answers are pre-graded as blank, when they are not blank. It might have to do with the size of the required answer: "(1,4)", but 90 out of 198 being graded blank is too much (some were actually blank of course, but still). (This is ...Many answers are pre-graded as blank, when they are not blank. It might have to do with the size of the required answer: "(1,4)", but 90 out of 198 being graded blank is too much (some were actually blank of course, but still). (This is question 5b from am1010, midtermupdate)
This can be very dangerous as ideally we do not check if the blank answers are truly blank, thus not grading correct answers.Hugo KerstensHugo Kerstenshttps://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/350Dropdown menus in zesje do not work on Microsoft Edge browser2019-11-16T15:30:34ZMichael WimmerDropdown menus in zesje do not work on Microsoft Edge browserOn the current Edge browser in Windows 10, the drop-down menus on top (such as "Select Grader") do not work, making zesje unusable.On the current Edge browser in Windows 10, the drop-down menus on top (such as "Select Grader") do not work, making zesje unusable.https://gitlab.kwant-project.org/zesje/zesje/-/issues/336Already flattened PDFs cannot be processed2019-11-16T15:35:05ZHugo KerstensAlready flattened PDFs cannot be processedIf you create an exam with a flattened PDF the downloaded copies cannot be processed.
Steps to reproduce:
- Create a new exam with any flattened PDF, for example `tests/data/flattened-a4-2pages.pdf`.
- Finalize the exam and download a c...If you create an exam with a flattened PDF the downloaded copies cannot be processed.
Steps to reproduce:
- Create a new exam with any flattened PDF, for example `tests/data/flattened-a4-2pages.pdf`.
- Finalize the exam and download a copy
- Upload it to the submissions
- It will fail to process: `Failed on all x pages.`
The reason for this is that the original PDF already contains only one image that meets the specifications needed for `pikepdf`. When you download a copy, the data matrix is drawn as an inline image, which does not count towards the total of image resources on the page. When our pipeline tries to extract the image from the PDF with `pikepdf` it sees only the original image, and thinks it is a scan. This original image does of course not contain a data matrix, and thus the processing fails.
Possible solutions I can think of:
- Draw the data matrix as a regular image instead of an inline image. However, this could have possible performance implications, as the PDF now needs a resource table, while it probably didn't have it before.
- Feed the page to Wand after reading a data matrix failed? Unfortunately this solution is a lot more work.
This is a minor issue though, and it is probably only relevant to testing so I'm not sure if we want to fix it.https://gitlab.kwant-project.org/zesje/zesje/-/issues/321PDF uploading fails when page.MediaBox is not present2019-11-16T15:44:11ZHugo KerstensPDF uploading fails when page.MediaBox is not presentWhen uploading a PDF that is exported from a Jupyter notebook, it fails to upload and returns 500. The following error is thrown:
```
[2019-06-05 11:48:42,336] ERROR in app: Exception on /api/exams [POST]
Traceback (most recent call last...When uploading a PDF that is exported from a Jupyter notebook, it fails to upload and returns 500. The following error is thrown:
```
[2019-06-05 11:48:42,336] ERROR in app: Exception on /api/exams [POST]
Traceback (most recent call last):
File "/home/hugo/miniconda3/envs/zesje-dev/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/home/hugo/miniconda3/envs/zesje-dev/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/hugo/miniconda3/envs/zesje-dev/lib/python3.6/site-packages/flask_restful/__init__.py", line 458, in wrapper
resp = resource(*args, **kwargs)
File "/home/hugo/miniconda3/envs/zesje-dev/lib/python3.6/site-packages/flask/views.py", line 88, in view
return self.dispatch_request(*args, **kwargs)
File "/home/hugo/miniconda3/envs/zesje-dev/lib/python3.6/site-packages/flask_restful/__init__.py", line 573, in dispatch_request
resp = meth(*args, **kwargs)
File "/home/hugo/Documents/zesje/zesje/api/exams.py", line 203, in post
if not page_is_size(pdf_data, PAGE_FORMATS[format], tolerance=0.01):
File "/home/hugo/Documents/zesje/zesje/pdf_generation.py", line 328, in page_is_size
invalid = any(page_is_bad(p) for p in exam_pdf.pages)
File "/home/hugo/Documents/zesje/zesje/pdf_generation.py", line 328, in <genexpr>
invalid = any(page_is_bad(p) for p in exam_pdf.pages)
File "/home/hugo/Documents/zesje/zesje/pdf_generation.py", line 325, in page_is_bad
return (abs(float(page.MediaBox[2]) - shape[0]) > tol[0]
TypeError: 'NoneType' object is not subscriptable
```
The property `MediaBox` is not present on the pages in such a PDF. The error is thrown
[here in `pdf_generation.py`](https://gitlab.kwant-project.org/zesje/zesje/blob/cdd2fb7b5c3b88e5ea116ad9aafc5d5ee0f88149/zesje/pdf_generation.py#L325)
To replicate:
- Export a Jupyter notebook as PDF
- Upload it to Zesje
My backend for PDF generation is XeTeX 0.99996https://gitlab.kwant-project.org/zesje/zesje/-/issues/291Assigning multiple rubric items in quick succession leads to white page2019-11-16T15:50:12ZStefan HugtenburgAssigning multiple rubric items in quick succession leads to white pageIf I use the shortcuts to quickly assign multiple grading items in one go (e.g. I hit `1 2 3 4` on my keyboard in rapid succession), the page _sometimes_ goes to white. EDIT: Actually it feels like it happens more frequently when I use t...If I use the shortcuts to quickly assign multiple grading items in one go (e.g. I hit `1 2 3 4` on my keyboard in rapid succession), the page _sometimes_ goes to white. EDIT: Actually it feels like it happens more frequently when I use the arrow keys + space bar, but that might just be a feeling (as I can imagine the underlying behaviour is the same for both use cases).
~~Next time this happens I hope to have the network tab of my console open and will update this issue with more details ;)~~
Got it:
```
NavBar.jsx?e3b9:148 Uncaught (in promise) TypeError: Cannot read property 'submissions' of undefined
at NavBar.render (NavBar.jsx?e3b9:148)
at finishClassComponent (react-dom.development.js?61bb:14695)
at updateClassComponent (react-dom.development.js?61bb:14650)
at beginWork (react-dom.development.js?61bb:15598)
at performUnitOfWork (react-dom.development.js?61bb:19266)
at workLoop (react-dom.development.js?61bb:19306)
at renderRoot (react-dom.development.js?61bb:19389)
at performWorkOnRoot (react-dom.development.js?61bb:20296)
at performWork (react-dom.development.js?61bb:20208)
at performSyncWork (react-dom.development.js?61bb:20182)
```
And the server says:
```
[PYTHON] pony.orm.core.UnrepeatableReadError: Value of Solution.graded_at for Solution[Submission[22],Problem[5]] was updated outside of current transaction (was: datetime.datetime(2019, 3, 21, 15, 49, 31, 851449), now: datetime.datetime(2019, 3, 21, 15, 49, 32, 674871))
```