QuizGenerator 0.4.2__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 (52) hide show
  1. QuizGenerator/README.md +5 -0
  2. QuizGenerator/__init__.py +27 -0
  3. QuizGenerator/__main__.py +7 -0
  4. QuizGenerator/canvas/__init__.py +13 -0
  5. QuizGenerator/canvas/canvas_interface.py +627 -0
  6. QuizGenerator/canvas/classes.py +235 -0
  7. QuizGenerator/constants.py +149 -0
  8. QuizGenerator/contentast.py +1955 -0
  9. QuizGenerator/generate.py +253 -0
  10. QuizGenerator/logging.yaml +55 -0
  11. QuizGenerator/misc.py +579 -0
  12. QuizGenerator/mixins.py +548 -0
  13. QuizGenerator/performance.py +202 -0
  14. QuizGenerator/premade_questions/__init__.py +0 -0
  15. QuizGenerator/premade_questions/basic.py +103 -0
  16. QuizGenerator/premade_questions/cst334/__init__.py +1 -0
  17. QuizGenerator/premade_questions/cst334/languages.py +391 -0
  18. QuizGenerator/premade_questions/cst334/math_questions.py +297 -0
  19. QuizGenerator/premade_questions/cst334/memory_questions.py +1400 -0
  20. QuizGenerator/premade_questions/cst334/ostep13_vsfs.py +572 -0
  21. QuizGenerator/premade_questions/cst334/persistence_questions.py +451 -0
  22. QuizGenerator/premade_questions/cst334/process.py +648 -0
  23. QuizGenerator/premade_questions/cst463/__init__.py +0 -0
  24. QuizGenerator/premade_questions/cst463/gradient_descent/__init__.py +3 -0
  25. QuizGenerator/premade_questions/cst463/gradient_descent/gradient_calculation.py +369 -0
  26. QuizGenerator/premade_questions/cst463/gradient_descent/gradient_descent_questions.py +305 -0
  27. QuizGenerator/premade_questions/cst463/gradient_descent/loss_calculations.py +650 -0
  28. QuizGenerator/premade_questions/cst463/gradient_descent/misc.py +73 -0
  29. QuizGenerator/premade_questions/cst463/math_and_data/__init__.py +2 -0
  30. QuizGenerator/premade_questions/cst463/math_and_data/matrix_questions.py +631 -0
  31. QuizGenerator/premade_questions/cst463/math_and_data/vector_questions.py +534 -0
  32. QuizGenerator/premade_questions/cst463/models/__init__.py +0 -0
  33. QuizGenerator/premade_questions/cst463/models/attention.py +192 -0
  34. QuizGenerator/premade_questions/cst463/models/cnns.py +186 -0
  35. QuizGenerator/premade_questions/cst463/models/matrices.py +24 -0
  36. QuizGenerator/premade_questions/cst463/models/rnns.py +202 -0
  37. QuizGenerator/premade_questions/cst463/models/text.py +203 -0
  38. QuizGenerator/premade_questions/cst463/models/weight_counting.py +227 -0
  39. QuizGenerator/premade_questions/cst463/neural-network-basics/__init__.py +6 -0
  40. QuizGenerator/premade_questions/cst463/neural-network-basics/neural_network_questions.py +1314 -0
  41. QuizGenerator/premade_questions/cst463/tensorflow-intro/__init__.py +6 -0
  42. QuizGenerator/premade_questions/cst463/tensorflow-intro/tensorflow_questions.py +936 -0
  43. QuizGenerator/qrcode_generator.py +293 -0
  44. QuizGenerator/question.py +715 -0
  45. QuizGenerator/quiz.py +467 -0
  46. QuizGenerator/regenerate.py +472 -0
  47. QuizGenerator/typst_utils.py +113 -0
  48. quizgenerator-0.4.2.dist-info/METADATA +265 -0
  49. quizgenerator-0.4.2.dist-info/RECORD +52 -0
  50. quizgenerator-0.4.2.dist-info/WHEEL +4 -0
  51. quizgenerator-0.4.2.dist-info/entry_points.txt +3 -0
  52. quizgenerator-0.4.2.dist-info/licenses/LICENSE +674 -0
@@ -0,0 +1,265 @@
1
+ Metadata-Version: 2.4
2
+ Name: QuizGenerator
3
+ Version: 0.4.2
4
+ Summary: Generate randomized quiz questions for Canvas LMS and PDF exams
5
+ Project-URL: Homepage, https://github.com/OtterDen-Lab/QuizGenerator
6
+ Project-URL: Documentation, https://github.com/OtterDen-Lab/QuizGenerator/tree/main/documentation
7
+ Project-URL: Repository, https://github.com/OtterDen-Lab/QuizGenerator
8
+ Project-URL: Bug Tracker, https://github.com/OtterDen-Lab/QuizGenerator/issues
9
+ Author-email: Sam Ogden <samuel.s.ogden@gmail.com>
10
+ License: GPL-3.0-or-later
11
+ License-File: LICENSE
12
+ Keywords: assessment,canvas,education,exam,lms,quiz,teaching,testing
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Education
15
+ Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Education :: Testing
19
+ Requires-Python: >=3.12
20
+ Requires-Dist: canvasapi==3.2.0
21
+ Requires-Dist: cryptography>=41.0.0
22
+ Requires-Dist: graphviz>=0.21
23
+ Requires-Dist: jinja2==3.1.3
24
+ Requires-Dist: keras>=3.12.0
25
+ Requires-Dist: markdown>=3.9
26
+ Requires-Dist: matplotlib
27
+ Requires-Dist: pylatex>=1.4.2
28
+ Requires-Dist: pypandoc~=1.6.3
29
+ Requires-Dist: pytablewriter~=1.2.0
30
+ Requires-Dist: python-dotenv==1.0.1
31
+ Requires-Dist: pyyaml==6.0.1
32
+ Requires-Dist: requests==2.32.2
33
+ Requires-Dist: segno>=1.6.0
34
+ Requires-Dist: sympy>=1.14.0
35
+ Requires-Dist: tensorflow>=2.20.0
36
+ Provides-Extra: grading
37
+ Requires-Dist: pillow>=10.0.0; extra == 'grading'
38
+ Requires-Dist: pyzbar>=0.1.9; extra == 'grading'
39
+ Description-Content-Type: text/markdown
40
+
41
+ # QuizGenerator
42
+
43
+ Generate randomized quiz questions for Canvas LMS and PDF exams with support for multiple question types, automatic variation generation, and QR code-based answer keys.
44
+
45
+ ## Features
46
+
47
+ - **Multiple Output Formats**: Generate PDFs (LaTeX or Typst) and Canvas LMS quizzes
48
+ - **Automatic Variations**: Create unique versions for each student
49
+ - **Extensible**: Plugin system for custom question types
50
+ - **Built-in Question Library**: Memory management, process scheduling, calculus, linear algebra, and more
51
+ - **QR Code Answer Keys**: Regenerate exact exam versions from QR codes
52
+ - **Canvas Integration**: Direct upload to Canvas with variation support
53
+
54
+ ## Installation
55
+
56
+ ```bash
57
+ pip install QuizGenerator
58
+ ```
59
+
60
+ ### System Requirements
61
+
62
+ - Python 3.12+
63
+ - LaTeX distribution with `latexmk` (for PDF generation)
64
+ - Optional: [Typst](https://typst.app/) (alternative to LaTeX)
65
+
66
+ ### Optional Dependencies
67
+
68
+ ```bash
69
+ # For QR code grading support
70
+ pip install QuizGenerator[grading]
71
+ ```
72
+
73
+ ## Quick Start
74
+
75
+ ### 1. Create a quiz configuration (YAML)
76
+
77
+ ```yaml
78
+ # my_quiz.yaml
79
+ name: "Midterm Exam"
80
+
81
+ questions:
82
+ 10: # 10-point questions
83
+ "Process Scheduling":
84
+ class: FIFOScheduling
85
+
86
+ 5: # 5-point questions
87
+ "Memory Paging":
88
+ class: PagingQuestion
89
+
90
+ "Vector Math":
91
+ class: VectorAddition
92
+ ```
93
+
94
+ ### 2. Generate PDFs
95
+
96
+ ```bash
97
+ python -m generate_quiz --quiz_yaml my_quiz.yaml --num_pdfs 3
98
+ ```
99
+
100
+ PDFs will be created in the `out/` directory.
101
+
102
+ ### 3. Upload to Canvas
103
+
104
+ ```bash
105
+ # Set up Canvas credentials in ~/.env first:
106
+ # CANVAS_API_URL=https://canvas.instructure.com
107
+ # CANVAS_API_KEY=your_api_key_here
108
+
109
+ python -m generate_quiz \
110
+ --quiz_yaml my_quiz.yaml \
111
+ --num_canvas 5 \
112
+ --course_id 12345
113
+ ```
114
+
115
+ ## Creating Custom Questions
116
+
117
+ QuizGenerator supports two approaches for adding custom question types:
118
+
119
+ ### Option 1: Entry Points (Recommended for Distribution)
120
+
121
+ Create a pip-installable package:
122
+
123
+ ```toml
124
+ # pyproject.toml
125
+ [project.entry-points."quizgenerator.questions"]
126
+ my_question = "my_package.questions:MyCustomQuestion"
127
+ ```
128
+
129
+ After `pip install`, your questions are automatically available!
130
+
131
+ ### Option 2: Direct Import (Quick & Easy)
132
+
133
+ Add to your quiz YAML:
134
+
135
+ ```yaml
136
+ custom_modules:
137
+ - my_questions # Import my_questions.py
138
+
139
+ questions:
140
+ 10:
141
+ "My Question":
142
+ class: MyCustomQuestion
143
+ ```
144
+
145
+ See [documentation/custom_questions.md](documentation/custom_questions.md) for complete guide.
146
+
147
+ ## Built-in Question Types
148
+
149
+ ### Operating Systems (CST334)
150
+ - `FIFOScheduling`, `SJFScheduling`, `RoundRobinScheduling`
151
+ - `PagingQuestion`, `TLBQuestion`
152
+ - `SemaphoreQuestion`, `MutexQuestion`
153
+
154
+ ### Machine Learning / Math (CST463)
155
+ - `VectorAddition`, `VectorDotProduct`, `VectorMagnitude`
156
+ - `MatrixAddition`, `MatrixMultiplication`, `MatrixTranspose`
157
+ - `DerivativeBasic`, `DerivativeChain`
158
+ - `GradientDescentStep`
159
+
160
+ ### General
161
+ - `FromText` - Custom text questions
162
+ - `FromGenerator` - Programmatically generated questions
163
+
164
+ ## Documentation
165
+
166
+ - [Getting Started Guide](documentation/getting_started.md) (coming soon)
167
+ - [Custom Questions Guide](documentation/custom_questions.md)
168
+ - [YAML Configuration Reference](documentation/yaml_config_guide.md) (coming soon)
169
+ - [PyPI Release Plan](documentation/pypi_release_plan.md)
170
+
171
+ ## Canvas Setup
172
+
173
+ 1. Create a `~/.env` file with your Canvas credentials:
174
+
175
+ ```bash
176
+ # For testing/development
177
+ CANVAS_API_URL=https://canvas.test.instructure.com
178
+ CANVAS_API_KEY=your_test_api_key
179
+
180
+ # For production
181
+ CANVAS_API_URL_prod=https://canvas.instructure.com
182
+ CANVAS_API_KEY_prod=your_prod_api_key
183
+ ```
184
+
185
+ 2. Use `--prod` flag for production Canvas instance:
186
+
187
+ ```bash
188
+ python -m generate_quiz --prod --num_canvas 5 --course_id 12345
189
+ ```
190
+
191
+ ## Advanced Features
192
+
193
+ ### Typst Support
194
+
195
+ Use Typst instead of LaTeX for faster compilation:
196
+
197
+ ```bash
198
+ python -m generate_quiz --typst --num_pdfs 3
199
+ ```
200
+
201
+ ### Deterministic Generation
202
+
203
+ Use seeds for reproducible quizzes:
204
+
205
+ ```bash
206
+ python -m generate_quiz --seed 42 --num_pdfs 3
207
+ ```
208
+
209
+ ### QR Code Regeneration
210
+
211
+ Each generated exam includes a QR code that stores:
212
+ - Question types and parameters
213
+ - Random seed
214
+ - Version information
215
+
216
+ Use the grading tools to scan QR codes and regenerate exact exam versions.
217
+
218
+ ## Project Structure
219
+
220
+ ```
221
+ QuizGenerator/
222
+ ├── QuizGenerator/ # Main package
223
+ │ ├── question.py # Question base classes and registry
224
+ │ ├── quiz.py # Quiz generation logic
225
+ │ ├── contentast.py # Content AST for cross-format rendering
226
+ │ ├── premade_questions/ # Built-in question library
227
+ │ └── canvas/ # Canvas LMS integration
228
+ ├── example_files/ # Example quiz configurations
229
+ ├── documentation/ # User guides
230
+ └── generate_quiz.py # CLI entry point
231
+ ```
232
+
233
+ ## Contributing
234
+
235
+ Contributions welcome! Areas of interest:
236
+ - New question types
237
+ - Additional LMS integrations
238
+ - Documentation improvements
239
+ - Bug fixes
240
+
241
+ ## License
242
+
243
+ GNU General Public License v3.0 or later (GPLv3+) - see LICENSE file for details
244
+
245
+ ## Citation
246
+
247
+ If you use QuizGenerator in academic work, please cite:
248
+
249
+ ```
250
+ @software{quizgenerator,
251
+ author = {Ogden, Sam},
252
+ title = {QuizGenerator: Automated Quiz Generation for Education},
253
+ year = {2024},
254
+ url = {https://github.com/OtterDen-Lab/QuizGenerator}
255
+ }
256
+ ```
257
+
258
+ ## Support
259
+
260
+ - Issues: https://github.com/OtterDen-Lab/QuizGenerator/issues
261
+ - Documentation: https://github.com/OtterDen-Lab/QuizGenerator/tree/main/documentation
262
+
263
+ ---
264
+
265
+ **Note**: This tool is designed for educational use. Ensure compliance with your institution's academic integrity policies when using automated quiz generation.
@@ -0,0 +1,52 @@
1
+ QuizGenerator/README.md,sha256=4n16gKyhIAKRBX4VKlpfcK0pyUYJ6Ht08MUsnwgxrZo,145
2
+ QuizGenerator/__init__.py,sha256=8EV-k90A3PNC8Cm2-ZquwNyVyvnwW1gs6u-nGictyhs,840
3
+ QuizGenerator/__main__.py,sha256=Dd9w4R0Unm3RiXztvR4Y_g9-lkWp6FHg-4VN50JbKxU,151
4
+ QuizGenerator/constants.py,sha256=AO-UWwsWPLb1k2JW6KP8rl9fxTcdT0rW-6XC6zfnDOs,4386
5
+ QuizGenerator/contentast.py,sha256=nx0-y3LTyInzX9QheweHhA90zNsdtXie7X-ckYu1_rM,68318
6
+ QuizGenerator/generate.py,sha256=o2XezoSE0u-qjxYu1_Ofm9Lpkza7M2Tg47C-ClMcPsE,7197
7
+ QuizGenerator/logging.yaml,sha256=VJCdh26D8e_PNUs4McvvP1ojz9EVjQNifJzfhEk1Mbo,1114
8
+ QuizGenerator/misc.py,sha256=2vEztj-Kt_0Q2OnynJKC4gL_w7l1MqWsBhhIDOuVD1s,18710
9
+ QuizGenerator/mixins.py,sha256=zUKTkswq7aoDZ_nGPUdRuvnza8iH8ZCi6IH2Uw-kCvs,18492
10
+ QuizGenerator/performance.py,sha256=CM3zLarJXN5Hfrl4-6JRBqD03j4BU1B2QW699HAr1Ds,7002
11
+ QuizGenerator/qrcode_generator.py,sha256=S3mzZDk2UiHiw6ipSCpWPMhbKvSRR1P5ordZJUTo6ug,10776
12
+ QuizGenerator/question.py,sha256=pyDQJzqqyEwhnqCl0PqdTNvM7bTPy7m31qdzGfYC0j4,28269
13
+ QuizGenerator/quiz.py,sha256=toPodXea2UYGgAf4jyor3Gz-gtXYN1YUJFJFQ5u70v4,18718
14
+ QuizGenerator/regenerate.py,sha256=EvtFhDUXYaWEBCGJ4RW-zN65qj3cMxWa_Y_Rn44WU6c,14282
15
+ QuizGenerator/typst_utils.py,sha256=XtMEO1e4_Tg0G1zR9D1fmrYKlUfHenBPdGoCKR0DhZg,3154
16
+ QuizGenerator/canvas/__init__.py,sha256=TwFP_zgxPIlWtkvIqQ6mcvBNTL9swIH_rJl7DGKcvkQ,286
17
+ QuizGenerator/canvas/canvas_interface.py,sha256=wsEWh2lonUMgmbtXF-Zj59CAM_0NInoaERqsujlYMfc,24501
18
+ QuizGenerator/canvas/classes.py,sha256=v_tQ8t_JJplU9sv2p4YctX45Fwed1nQ2HC1oC9BnDNw,7594
19
+ QuizGenerator/premade_questions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
+ QuizGenerator/premade_questions/basic.py,sha256=wAvVZED6a7VToIvSCdAx6SrExmR0xVRo5dL40kycdXI,3402
21
+ QuizGenerator/premade_questions/cst334/__init__.py,sha256=BTz-Os1XbwIRKqAilf2UIva2NlY0DbA_XbSIggO2Tdk,36
22
+ QuizGenerator/premade_questions/cst334/languages.py,sha256=MTqprY8VUWgNlP0zRRpZXOAP2dd6ocx_XWVqcNlxYg8,14390
23
+ QuizGenerator/premade_questions/cst334/math_questions.py,sha256=za8lNqhM0RB8qefmPP-Ww0WB_SQn0iRcBKOrZgyHCQQ,9290
24
+ QuizGenerator/premade_questions/cst334/memory_questions.py,sha256=B4hpnMliJY-x65hNbjwbf22m-jiTi3WEXmauKv_YA84,51598
25
+ QuizGenerator/premade_questions/cst334/ostep13_vsfs.py,sha256=d9jjrynEw44vupAH_wKl57UoHooCNEJXaC5DoNYualk,16163
26
+ QuizGenerator/premade_questions/cst334/persistence_questions.py,sha256=hIOi-_K-0B_owWtV_YnXXW8Bb51uQF_lpVcXQkAlbXc,16520
27
+ QuizGenerator/premade_questions/cst334/process.py,sha256=EB0iuT9Q8FfOnmlQoXL7gkfsPyVJP55cRFOe2mWfamc,23647
28
+ QuizGenerator/premade_questions/cst463/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
+ QuizGenerator/premade_questions/cst463/gradient_descent/__init__.py,sha256=sH2CUV6zK9FT3jWTn453ys6_JTrUKRtZnU8hK6RmImU,240
30
+ QuizGenerator/premade_questions/cst463/gradient_descent/gradient_calculation.py,sha256=ssj6Xkpw6vDiL4qwVOiHUhly3TX50oX4KJtouj7qN6g,12809
31
+ QuizGenerator/premade_questions/cst463/gradient_descent/gradient_descent_questions.py,sha256=VjmNDpV3YgeYKqyYp4wQXZIViZVvC1GcnjVUl7valhU,9724
32
+ QuizGenerator/premade_questions/cst463/gradient_descent/loss_calculations.py,sha256=TnhcD9OBsYgVDdSY5qPrSovnYB6r90wiGcg934czIrY,21500
33
+ QuizGenerator/premade_questions/cst463/gradient_descent/misc.py,sha256=iB3obG6-uXr_yrLVT7L_9j1H54f7oe5Rk9w45yW-lnw,2654
34
+ QuizGenerator/premade_questions/cst463/math_and_data/__init__.py,sha256=EbIaUrx7_aK9j3Gd8Mk08h9GocTq_0OoNu2trfNwaU8,202
35
+ QuizGenerator/premade_questions/cst463/math_and_data/matrix_questions.py,sha256=sq27xv7X9aa0axFxomusZRwM-ICj9grbhD_Bv3n3gJg,28947
36
+ QuizGenerator/premade_questions/cst463/math_and_data/vector_questions.py,sha256=tNxfR6J1cZHsHG9GfwVyl6lxxN_TEnhKDmMq4aVLwow,20793
37
+ QuizGenerator/premade_questions/cst463/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
+ QuizGenerator/premade_questions/cst463/models/attention.py,sha256=i8h6DihzJTc_QFrdm1eaYhnuhlXKRUv_vIDg3jk_LZ8,5502
39
+ QuizGenerator/premade_questions/cst463/models/cnns.py,sha256=M0_9wlPhQICje1UdwIbDoBA4qzjmJtmP9VVVneYM5Mc,5766
40
+ QuizGenerator/premade_questions/cst463/models/matrices.py,sha256=H61_8cF1DGCt4Z4Ssoi4SMClf6tD5wHkOqY5bMdsSt4,699
41
+ QuizGenerator/premade_questions/cst463/models/rnns.py,sha256=-tXeGgqPkctBBUy4RvEPqhv2kfPqoyO2wk-lNJLNWmY,6697
42
+ QuizGenerator/premade_questions/cst463/models/text.py,sha256=bUiDIzOBEzilUKQjm2yO9ufcvJGY6Gt3qfeNP9UZOrc,6400
43
+ QuizGenerator/premade_questions/cst463/models/weight_counting.py,sha256=acygK-MobvdmwS4UYKVVL4Ey59M1qmq8dITWOT6V-aI,6793
44
+ QuizGenerator/premade_questions/cst463/neural-network-basics/__init__.py,sha256=pmyCezO-20AFEQC6MR7KnAsaU9TcgZYsGQOMVkRZ-U8,149
45
+ QuizGenerator/premade_questions/cst463/neural-network-basics/neural_network_questions.py,sha256=gd5zI-6gmXUiK8GaCOCq0IlOwDg4YS0NlOdoN9v_flo,44810
46
+ QuizGenerator/premade_questions/cst463/tensorflow-intro/__init__.py,sha256=G1gEHtG4KakYgi8ZXSYYhX6bQRtnm2tZVGx36d63Nmo,173
47
+ QuizGenerator/premade_questions/cst463/tensorflow-intro/tensorflow_questions.py,sha256=dPn8Sj0yk4m02np62esMKZ7CvcljhYq3Tq51nY9aJnA,29781
48
+ quizgenerator-0.4.2.dist-info/METADATA,sha256=DDpI82uz-oqvKRYLPgF8O6-Cuv6g39So65_I82DBxFk,7212
49
+ quizgenerator-0.4.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
50
+ quizgenerator-0.4.2.dist-info/entry_points.txt,sha256=aOIdRdw26xY8HkxOoKHBnUPe2mwGv5Ti3U1zojb6zxQ,98
51
+ quizgenerator-0.4.2.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
52
+ quizgenerator-0.4.2.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.28.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ quizgen = QuizGenerator.generate:main
3
+ quizregen = QuizGenerator.regenerate:main