Create a file global variables
This is issue is related to #332 (closed). Some functions make use of the same variables but declare them again in every function that makes use of them. This could not only be made cleaner by using the same variable, but also provides flexibility to change. This mostly comes to mind when looking at scans.py
and pdf_generation.py
. pdf_generation.py
uses variables declared in the functions, for example when generating a student number box, the box and text size are hardcoded in to the function. And then when going to guess_student_number
and attempt is made to make use of a global config, only this config is not passed as parameter when calling the function and then defaults to hardcoded values declared in the function.
At the WOMM fork we have these global variables declared in pdf generation:
- corner marker dimensions
- checkbox dimensions
- page format dimensions (it used to be declared in
api/exams.py
, but other functions now also make use of it)
Some variables that could also be made global would be:
- student number box dimensions, such as the height and width
- datamatrix dimensions, such as the height and width
I'm sure that there are more.