QuizGenerator 0.8.1__py3-none-any.whl → 0.10.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. QuizGenerator/README.md +5 -0
  2. QuizGenerator/canvas/canvas_interface.py +6 -2
  3. QuizGenerator/contentast.py +33 -11
  4. QuizGenerator/generate.py +51 -10
  5. QuizGenerator/logging.yaml +55 -0
  6. QuizGenerator/mixins.py +6 -2
  7. QuizGenerator/premade_questions/basic.py +49 -7
  8. QuizGenerator/premade_questions/cst463/gradient_descent/gradient_calculation.py +92 -82
  9. QuizGenerator/premade_questions/cst463/gradient_descent/gradient_descent_questions.py +68 -45
  10. QuizGenerator/premade_questions/cst463/gradient_descent/loss_calculations.py +238 -162
  11. QuizGenerator/premade_questions/cst463/models/attention.py +0 -1
  12. QuizGenerator/premade_questions/cst463/models/cnns.py +0 -1
  13. QuizGenerator/premade_questions/cst463/models/rnns.py +0 -1
  14. QuizGenerator/premade_questions/cst463/models/text.py +0 -1
  15. QuizGenerator/premade_questions/cst463/models/weight_counting.py +20 -1
  16. QuizGenerator/premade_questions/cst463/neural-network-basics/neural_network_questions.py +51 -45
  17. QuizGenerator/premade_questions/cst463/tensorflow-intro/tensorflow_questions.py +212 -215
  18. QuizGenerator/qrcode_generator.py +116 -54
  19. QuizGenerator/question.py +168 -23
  20. QuizGenerator/regenerate.py +23 -9
  21. {quizgenerator-0.8.1.dist-info → quizgenerator-0.10.0.dist-info}/METADATA +34 -22
  22. {quizgenerator-0.8.1.dist-info → quizgenerator-0.10.0.dist-info}/RECORD +25 -23
  23. {quizgenerator-0.8.1.dist-info → quizgenerator-0.10.0.dist-info}/WHEEL +0 -0
  24. {quizgenerator-0.8.1.dist-info → quizgenerator-0.10.0.dist-info}/entry_points.txt +0 -0
  25. {quizgenerator-0.8.1.dist-info → quizgenerator-0.10.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: QuizGenerator
3
- Version: 0.8.1
3
+ Version: 0.10.0
4
4
  Summary: Generate randomized quiz questions for Canvas LMS and PDF exams
5
5
  Project-URL: Homepage, https://github.com/OtterDen-Lab/QuizGenerator
6
6
  Project-URL: Documentation, https://github.com/OtterDen-Lab/QuizGenerator/tree/main/documentation
@@ -19,9 +19,7 @@ Classifier: Topic :: Education :: Testing
19
19
  Requires-Python: >=3.12
20
20
  Requires-Dist: canvasapi==3.2.0
21
21
  Requires-Dist: cryptography>=41.0.0
22
- Requires-Dist: graphviz>=0.21
23
22
  Requires-Dist: jinja2==3.1.3
24
- Requires-Dist: keras>=3.12.0
25
23
  Requires-Dist: markdown>=3.9
26
24
  Requires-Dist: matplotlib
27
25
  Requires-Dist: pylatex>=1.4.2
@@ -32,7 +30,10 @@ Requires-Dist: pyyaml==6.0.1
32
30
  Requires-Dist: requests==2.32.2
33
31
  Requires-Dist: segno>=1.6.0
34
32
  Requires-Dist: sympy>=1.14.0
35
- Requires-Dist: tensorflow>=2.20.0
33
+ Provides-Extra: cst463
34
+ Requires-Dist: graphviz>=0.21; extra == 'cst463'
35
+ Requires-Dist: keras>=3.12.0; extra == 'cst463'
36
+ Requires-Dist: tensorflow>=2.20.0; extra == 'cst463'
36
37
  Provides-Extra: grading
37
38
  Requires-Dist: pillow>=10.0.0; extra == 'grading'
38
39
  Requires-Dist: pyzbar>=0.1.9; extra == 'grading'
@@ -60,18 +61,24 @@ pip install QuizGenerator
60
61
  ### System Requirements
61
62
 
62
63
  - Python 3.12+
63
- - LaTeX distribution with `latexmk` (for PDF generation)
64
- - Optional: [Typst](https://typst.app/) (alternative to LaTeX)
64
+ - [Typst](https://typst.app/) (default PDF renderer)
65
+ - Optional: LaTeX distribution with `latexmk` (if using `--latex`)
66
+ - Recommended: [Pandoc](https://pandoc.org/) (for markdown conversion)
65
67
 
66
68
  ### Optional Dependencies
67
69
 
68
70
  ```bash
69
71
  # For QR code grading support
70
72
  pip install QuizGenerator[grading]
73
+
74
+ # For CST463 machine learning questions
75
+ pip install QuizGenerator[cst463]
71
76
  ```
72
77
 
73
78
  ## Quick Start
74
79
 
80
+ Need a 2‑minute setup? See `documentation/quickstart.md`.
81
+
75
82
  ### 1. Create a quiz configuration (YAML)
76
83
 
77
84
  ```yaml
@@ -94,7 +101,7 @@ questions:
94
101
  ### 2. Generate PDFs
95
102
 
96
103
  ```bash
97
- python -m generate_quiz --quiz_yaml my_quiz.yaml --num_pdfs 3
104
+ quizgen --yaml my_quiz.yaml --num_pdfs 3
98
105
  ```
99
106
 
100
107
  PDFs will be created in the `out/` directory.
@@ -106,8 +113,8 @@ PDFs will be created in the `out/` directory.
106
113
  # CANVAS_API_URL=https://canvas.instructure.com
107
114
  # CANVAS_API_KEY=your_api_key_here
108
115
 
109
- python -m generate_quiz \
110
- --quiz_yaml my_quiz.yaml \
116
+ quizgen \
117
+ --yaml my_quiz.yaml \
111
118
  --num_canvas 5 \
112
119
  --course_id 12345
113
120
  ```
@@ -150,26 +157,29 @@ All questions follow the same three‑method flow:
150
157
 
151
158
  ```python
152
159
  class MyQuestion(Question):
153
- def _build_context(self, *, rng_seed=None, **kwargs):
160
+ @classmethod
161
+ def _build_context(cls, *, rng_seed=None, **kwargs):
154
162
  context = super()._build_context(rng_seed=rng_seed, **kwargs)
155
- rng = context["rng"]
163
+ rng = context.rng
156
164
  context["value"] = rng.randint(1, 10)
157
165
  return context
158
166
 
159
- def _build_body(self, context):
167
+ @classmethod
168
+ def _build_body(cls, context):
160
169
  body = ca.Section()
161
170
  body.add_element(ca.Paragraph([f"Value: {context['value']}"]))
162
171
  body.add_element(ca.AnswerTypes.Int(context["value"], label="Value"))
163
172
  return body
164
173
 
165
- def _build_explanation(self, context):
174
+ @classmethod
175
+ def _build_explanation(cls, context):
166
176
  explanation = ca.Section()
167
177
  explanation.add_element(ca.Paragraph([f"Answer: {context['value']}"]))
168
178
  return explanation
169
179
  ```
170
180
 
171
181
  Notes:
172
- - Always use `context["rng"]` for deterministic randomness.
182
+ - Always use `context.rng` (or `context["rng"]`) for deterministic randomness.
173
183
  - Avoid `refresh()`; it is no longer part of the API.
174
184
 
175
185
  ## Built-in Question Types
@@ -191,10 +201,9 @@ Notes:
191
201
 
192
202
  ## Documentation
193
203
 
194
- - [Getting Started Guide](documentation/getting_started.md) (coming soon)
204
+ - [Getting Started Guide](documentation/getting_started.md)
195
205
  - [Custom Questions Guide](documentation/custom_questions.md)
196
- - [YAML Configuration Reference](documentation/yaml_config_guide.md) (coming soon)
197
- - [PyPI Release Plan](documentation/pypi_release_plan.md)
206
+ - [YAML Configuration Reference](documentation/yaml_config_guide.md)
198
207
 
199
208
  ## Canvas Setup
200
209
 
@@ -213,25 +222,28 @@ CANVAS_API_KEY_prod=your_prod_api_key
213
222
  2. Use `--prod` flag for production Canvas instance:
214
223
 
215
224
  ```bash
216
- python -m generate_quiz --prod --num_canvas 5 --course_id 12345
225
+ quizgen --prod --num_canvas 5 --course_id 12345
217
226
  ```
218
227
 
219
228
  ## Advanced Features
220
229
 
221
230
  ### Typst Support
222
231
 
223
- Use Typst instead of LaTeX for faster compilation:
232
+ Typst is the default for faster compilation. Use `--latex` to force LaTeX:
224
233
 
225
234
  ```bash
226
- python -m generate_quiz --typst --num_pdfs 3
235
+ quizgen --latex --num_pdfs 3
227
236
  ```
228
237
 
238
+ Experimental: `--typst_measurement` uses Typst to measure question height for tighter layout.
239
+ It can change pagination and ordering, so use with care on finalized exams.
240
+
229
241
  ### Deterministic Generation
230
242
 
231
243
  Use seeds for reproducible quizzes:
232
244
 
233
245
  ```bash
234
- python -m generate_quiz --seed 42 --num_pdfs 3
246
+ quizgen --seed 42 --num_pdfs 3
235
247
  ```
236
248
 
237
249
  ### QR Code Regeneration
@@ -255,7 +267,7 @@ QuizGenerator/
255
267
  │ └── canvas/ # Canvas LMS integration
256
268
  ├── example_files/ # Example quiz configurations
257
269
  ├── documentation/ # User guides
258
- └── generate_quiz.py # CLI entry point
270
+ └── quizgen # CLI entry point
259
271
  ```
260
272
 
261
273
  ## Contributing
@@ -1,21 +1,23 @@
1
+ QuizGenerator/README.md,sha256=4n16gKyhIAKRBX4VKlpfcK0pyUYJ6Ht08MUsnwgxrZo,145
1
2
  QuizGenerator/__init__.py,sha256=8EV-k90A3PNC8Cm2-ZquwNyVyvnwW1gs6u-nGictyhs,840
2
3
  QuizGenerator/__main__.py,sha256=Dd9w4R0Unm3RiXztvR4Y_g9-lkWp6FHg-4VN50JbKxU,151
3
4
  QuizGenerator/constants.py,sha256=AO-UWwsWPLb1k2JW6KP8rl9fxTcdT0rW-6XC6zfnDOs,4386
4
- QuizGenerator/contentast.py,sha256=uTql3nvNg8DZnPxOg7S31vXbifSNfb3rFK5c_ihLsbg,87615
5
- QuizGenerator/generate.py,sha256=dqF-WWmWxyJmPHl0gTYr3gNNxyF877fvXYaMvYA3uA8,15790
5
+ QuizGenerator/contentast.py,sha256=NY6Y9gWbdinXaVGdgwN61UBF2nz_L2urqr-IPfR6tV0,88475
6
+ QuizGenerator/generate.py,sha256=qKYT-7HLUS1WSViDDSuJOIb5RwsTT3BuoUUZkoqSSus,17363
7
+ QuizGenerator/logging.yaml,sha256=VJCdh26D8e_PNUs4McvvP1ojz9EVjQNifJzfhEk1Mbo,1114
6
8
  QuizGenerator/misc.py,sha256=MXrguUhhdrWSV4Hqdl4G21ktowODu1AcKy6-5mvy3aI,454
7
- QuizGenerator/mixins.py,sha256=B9Ee52wUCeclmBTgonasHNo0WHvVOcnILsz0iecrf78,15705
9
+ QuizGenerator/mixins.py,sha256=zXj2U94qNbIEusbwTnzRM1Z_zSybpvozWhveq-t5q2Q,15771
8
10
  QuizGenerator/performance.py,sha256=CM3zLarJXN5Hfrl4-6JRBqD03j4BU1B2QW699HAr1Ds,7002
9
- QuizGenerator/qrcode_generator.py,sha256=S3mzZDk2UiHiw6ipSCpWPMhbKvSRR1P5ordZJUTo6ug,10776
10
- QuizGenerator/question.py,sha256=QsLKFEM8LzLkH1_5MOwMFRuqtTkEd7-a_eoaTKcttpU,33602
11
+ QuizGenerator/qrcode_generator.py,sha256=VMbAXFxJ_3KryqrgynCUPR5myeiu5CoroBfwwBsinCc,13386
12
+ QuizGenerator/question.py,sha256=BSopEaosCkJZ76etMv3Ue1zjzJpho-WnqS_8cQlZeac,38199
11
13
  QuizGenerator/quiz.py,sha256=CEWy7FB7BZiK33s_wYs6MqGKDetc6htUaqvP3--2HzI,21621
12
- QuizGenerator/regenerate.py,sha256=ZAs1mtERmO8JXza2tBqJpd-uJs9V7gS1jJ9A9gSb8jo,19764
14
+ QuizGenerator/regenerate.py,sha256=cDYZ9LwOSkX9P7W72O0c6RI8ORzS-DFnYhAdC5-7UrI,20375
13
15
  QuizGenerator/typst_utils.py,sha256=JGQn_u5bEHd8HAtjAHuZoVJwLkx-Rd4ZCBWffwFZa3o,3136
14
16
  QuizGenerator/canvas/__init__.py,sha256=TwFP_zgxPIlWtkvIqQ6mcvBNTL9swIH_rJl7DGKcvkQ,286
15
- QuizGenerator/canvas/canvas_interface.py,sha256=StMcdXgLvTA1EayQ44m_le2GXGQpDQnduYXVeUYsqW0,24618
17
+ QuizGenerator/canvas/canvas_interface.py,sha256=5PS7sZeIwRuOGK9gXmfgP4eUYtgCqZ1JKD-S4mNvsbk,24798
16
18
  QuizGenerator/canvas/classes.py,sha256=v_tQ8t_JJplU9sv2p4YctX45Fwed1nQ2HC1oC9BnDNw,7594
17
19
  QuizGenerator/premade_questions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
- QuizGenerator/premade_questions/basic.py,sha256=F_Qsu14b2xERyibCAMP1NPgnmi1h2G2DDkKJoU_RS8g,3284
20
+ QuizGenerator/premade_questions/basic.py,sha256=u6Viv__5HYWjLOknYt_jsBJTej5-cPd9FM1xsuwUQcQ,4613
19
21
  QuizGenerator/premade_questions/cst334/__init__.py,sha256=BTz-Os1XbwIRKqAilf2UIva2NlY0DbA_XbSIggO2Tdk,36
20
22
  QuizGenerator/premade_questions/cst334/languages.py,sha256=ctemEAMkI8C6ASMIf59EHAW1ndFWi7hXzdEt-zOByUE,14114
21
23
  QuizGenerator/premade_questions/cst334/math_questions.py,sha256=aUYbQxneL5MXE7Xo3tZX9-xcg71CXwvG3rrxcoh0l7A,8638
@@ -25,26 +27,26 @@ QuizGenerator/premade_questions/cst334/persistence_questions.py,sha256=9mgsX-3oW
25
27
  QuizGenerator/premade_questions/cst334/process.py,sha256=0SqXkvdxaEJZXJA8fBqheh7F0PL8I6xgO5a8u2s2po4,37238
26
28
  QuizGenerator/premade_questions/cst463/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
29
  QuizGenerator/premade_questions/cst463/gradient_descent/__init__.py,sha256=sH2CUV6zK9FT3jWTn453ys6_JTrUKRtZnU8hK6RmImU,240
28
- QuizGenerator/premade_questions/cst463/gradient_descent/gradient_calculation.py,sha256=laBeC0tMc2EaLzCotGHQNzePPPOKS1EGgQirigNyi9M,13479
29
- QuizGenerator/premade_questions/cst463/gradient_descent/gradient_descent_questions.py,sha256=_2HlC0sqfGy__Qyzbw0PwMD_OkQiiQukl72LQFyPYx0,10939
30
- QuizGenerator/premade_questions/cst463/gradient_descent/loss_calculations.py,sha256=8GtJX1DNNox-AgMvABFkRgmHB-lvrxMZKzv-3Ils_Jg,22380
30
+ QuizGenerator/premade_questions/cst463/gradient_descent/gradient_calculation.py,sha256=y_R26wUt7AIZVUoe3e_qpzkPdwMyo3mZjxLI504-YQw,13840
31
+ QuizGenerator/premade_questions/cst463/gradient_descent/gradient_descent_questions.py,sha256=OssybIkHx4l8ryHGT9rqHUecta9qpItK4QYVHuuQLeo,11525
32
+ QuizGenerator/premade_questions/cst463/gradient_descent/loss_calculations.py,sha256=PMuEAUJmN12t4ffHF0FoSbQNCLDfW5BKozWNHvoC6GU,24276
31
33
  QuizGenerator/premade_questions/cst463/gradient_descent/misc.py,sha256=0R-nFeD3zsqJyde5CXWrF6Npjmpx6_HbzfCbThLi3os,2657
32
34
  QuizGenerator/premade_questions/cst463/math_and_data/__init__.py,sha256=EbIaUrx7_aK9j3Gd8Mk08h9GocTq_0OoNu2trfNwaU8,202
33
35
  QuizGenerator/premade_questions/cst463/math_and_data/matrix_questions.py,sha256=4DLdo_8XDS_xtPA8R-wH4K0cKnMn4r5727Vszz8keTc,15565
34
36
  QuizGenerator/premade_questions/cst463/math_and_data/vector_questions.py,sha256=VXQCLQEeNKxRDPn_fGW5nAPX-0betrZ8mURh0ElbNz0,12668
35
37
  QuizGenerator/premade_questions/cst463/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
- QuizGenerator/premade_questions/cst463/models/attention.py,sha256=iECxOoR0LEJAH_d7ZE3MoLOkdYVbGOKo4Dwf8Pww0tM,5443
37
- QuizGenerator/premade_questions/cst463/models/cnns.py,sha256=_HSjgClNBBid5t52CDQfPUMdKOHFOXjy7VQ3sW-zW-Y,6030
38
+ QuizGenerator/premade_questions/cst463/models/attention.py,sha256=hb0sLVddxSKr4-bsIpAUyxITfcNaAGT-FppwwXXu52I,5430
39
+ QuizGenerator/premade_questions/cst463/models/cnns.py,sha256=p3hvQEsTsI2urPrZ-MZ63eIq0Dm6aarrLATVIiECc2A,6017
38
40
  QuizGenerator/premade_questions/cst463/models/matrices.py,sha256=21eNXUcIjFNZTGH18oH-x3MbCa4buNGQGer3a5yL85c,1938
39
- QuizGenerator/premade_questions/cst463/models/rnns.py,sha256=5fKQuWnpSAoznZVJuCY4nICQ5KzB04Cz17hpccYiiVc,6673
40
- QuizGenerator/premade_questions/cst463/models/text.py,sha256=BnW6qIB8pnQiFRyXxtX9cdsIfmjw99p6TI0WqI0AQzk,6605
41
- QuizGenerator/premade_questions/cst463/models/weight_counting.py,sha256=sFnEvSs7ZwR4RZPltiMEElKJgoxHTaY427_g8Abi2uk,6912
41
+ QuizGenerator/premade_questions/cst463/models/rnns.py,sha256=9pPzkrNviKD479NVgVvkoMhXtaLX0m17IIGpYKXXAwk,6660
42
+ QuizGenerator/premade_questions/cst463/models/text.py,sha256=j6ClSF4AztgFWyvuhjBCW5mKvQL1AdizfhpF3iCjtt4,6592
43
+ QuizGenerator/premade_questions/cst463/models/weight_counting.py,sha256=NriO0cukIw3HKYkm62p4PPm1qdH9wmDepEfoBzrmxR4,7402
42
44
  QuizGenerator/premade_questions/cst463/neural-network-basics/__init__.py,sha256=pmyCezO-20AFEQC6MR7KnAsaU9TcgZYsGQOMVkRZ-U8,149
43
- QuizGenerator/premade_questions/cst463/neural-network-basics/neural_network_questions.py,sha256=bit_HfAG4K6yh9SZZw_HAPhFUVFkOBdZ2odwt-Cdvmo,42868
45
+ QuizGenerator/premade_questions/cst463/neural-network-basics/neural_network_questions.py,sha256=j2f5LFmme-2rSgJzcb8nZJ1_hnZaL-S4lXSnIbpoH_E,43010
44
46
  QuizGenerator/premade_questions/cst463/tensorflow-intro/__init__.py,sha256=G1gEHtG4KakYgi8ZXSYYhX6bQRtnm2tZVGx36d63Nmo,173
45
- QuizGenerator/premade_questions/cst463/tensorflow-intro/tensorflow_questions.py,sha256=jZRbEqb65BAtliv_V9VR4kvpwOt-o10ApN7RmOIg3XI,30464
46
- quizgenerator-0.8.1.dist-info/METADATA,sha256=Ef_TPUm2UKYIXnBMiaip6SaAyRjMD4G1MNdVejagfRw,8113
47
- quizgenerator-0.8.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
48
- quizgenerator-0.8.1.dist-info/entry_points.txt,sha256=aOIdRdw26xY8HkxOoKHBnUPe2mwGv5Ti3U1zojb6zxQ,98
49
- quizgenerator-0.8.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
50
- quizgenerator-0.8.1.dist-info/RECORD,,
47
+ QuizGenerator/premade_questions/cst463/tensorflow-intro/tensorflow_questions.py,sha256=t0ghv6o8AsZaIwVHFu07Ozebwuv6Rf18D3g_-Jz4O74,31309
48
+ quizgenerator-0.10.0.dist-info/METADATA,sha256=zxcZ0akBMSH9jjA-sdpO55tZUlN4pfeSpIqFs9m864M,8483
49
+ quizgenerator-0.10.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
50
+ quizgenerator-0.10.0.dist-info/entry_points.txt,sha256=aOIdRdw26xY8HkxOoKHBnUPe2mwGv5Ti3U1zojb6zxQ,98
51
+ quizgenerator-0.10.0.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
52
+ quizgenerator-0.10.0.dist-info/RECORD,,