flashexam 2.0.1__tar.gz

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 (154) hide show
  1. flashexam-2.0.1/LICENSE +20 -0
  2. flashexam-2.0.1/MANIFEST.in +14 -0
  3. flashexam-2.0.1/PKG-INFO +402 -0
  4. flashexam-2.0.1/README.md +351 -0
  5. flashexam-2.0.1/flashexam/__init__.py +198 -0
  6. flashexam-2.0.1/flashexam/admin.py +198 -0
  7. flashexam-2.0.1/flashexam/answer_preservation_system.py +770 -0
  8. flashexam-2.0.1/flashexam/api.py +392 -0
  9. flashexam-2.0.1/flashexam/auth.py +337 -0
  10. flashexam-2.0.1/flashexam/cli.py +186 -0
  11. flashexam-2.0.1/flashexam/code_executor.py +209 -0
  12. flashexam-2.0.1/flashexam/database.py +2591 -0
  13. flashexam-2.0.1/flashexam/encoding_detector.py +294 -0
  14. flashexam-2.0.1/flashexam/english_questions.py +574 -0
  15. flashexam-2.0.1/flashexam/exam_reliability_system.py +728 -0
  16. flashexam-2.0.1/flashexam/grading_engine.py +769 -0
  17. flashexam-2.0.1/flashexam/improved_grading_system.py +690 -0
  18. flashexam-2.0.1/flashexam/intelligent_grading_enhanced.py +127 -0
  19. flashexam-2.0.1/flashexam/intelligent_grading_ollama.py +718 -0
  20. flashexam-2.0.1/flashexam/intelligent_grading_qwen.py +1218 -0
  21. flashexam-2.0.1/flashexam/keyword_focused_grader.py +84 -0
  22. flashexam-2.0.1/flashexam/main.py +34 -0
  23. flashexam-2.0.1/flashexam/models.py +82 -0
  24. flashexam-2.0.1/flashexam/new_exam_creation_api.py +347 -0
  25. flashexam-2.0.1/flashexam/new_question_system.py +386 -0
  26. flashexam-2.0.1/flashexam/quick_test.py +160 -0
  27. flashexam-2.0.1/flashexam/reading_passage_database.py +377 -0
  28. flashexam-2.0.1/flashexam/reading_passage_models.py +98 -0
  29. flashexam-2.0.1/flashexam/reading_passages.py +343 -0
  30. flashexam-2.0.1/flashexam/redis_store.py +245 -0
  31. flashexam-2.0.1/flashexam/reset_system.py +351 -0
  32. flashexam-2.0.1/flashexam/run.py +74 -0
  33. flashexam-2.0.1/flashexam/setup_database.py +370 -0
  34. flashexam-2.0.1/flashexam/smart_import_manager.py +463 -0
  35. flashexam-2.0.1/flashexam/static/css/app.css +240 -0
  36. flashexam-2.0.1/flashexam/static/css/libs/bootstrap/bootstrap-5.1.3.min.css +7 -0
  37. flashexam-2.0.1/flashexam/static/css/libs/bootstrap/bootstrap-5.3.0.min.css +6 -0
  38. flashexam-2.0.1/flashexam/static/css/libs/bootstrap/bootstrap-5.3.2.min.css +6 -0
  39. flashexam-2.0.1/flashexam/static/css/libs/bootstrap/bootstrap.min.css +796 -0
  40. flashexam-2.0.1/flashexam/static/css/libs/bootstrap-icons/bootstrap-icons-1.10.0.css +2018 -0
  41. flashexam-2.0.1/flashexam/static/css/libs/bootstrap-icons/bootstrap-icons-1.11.0.css +2078 -0
  42. flashexam-2.0.1/flashexam/static/css/libs/bootstrap-icons/bootstrap-icons-1.7.2.css +1556 -0
  43. flashexam-2.0.1/flashexam/static/css/libs/bootstrap-icons/bootstrap-icons-1.8.1.css +1704 -0
  44. flashexam-2.0.1/flashexam/static/css/libs/bootstrap-icons/bootstrap-icons.min.css +77 -0
  45. flashexam-2.0.1/flashexam/static/css/libs/bootstrap-icons/fonts/1.10.0/bootstrap-icons.woff +0 -0
  46. flashexam-2.0.1/flashexam/static/css/libs/bootstrap-icons/fonts/1.10.0/bootstrap-icons.woff2 +0 -0
  47. flashexam-2.0.1/flashexam/static/css/libs/bootstrap-icons/fonts/1.11.0/bootstrap-icons.woff +0 -0
  48. flashexam-2.0.1/flashexam/static/css/libs/bootstrap-icons/fonts/1.11.0/bootstrap-icons.woff2 +0 -0
  49. flashexam-2.0.1/flashexam/static/css/libs/bootstrap-icons/fonts/1.7.2/bootstrap-icons.woff +0 -0
  50. flashexam-2.0.1/flashexam/static/css/libs/bootstrap-icons/fonts/1.7.2/bootstrap-icons.woff2 +0 -0
  51. flashexam-2.0.1/flashexam/static/css/libs/bootstrap-icons/fonts/1.8.1/bootstrap-icons.woff +0 -0
  52. flashexam-2.0.1/flashexam/static/css/libs/bootstrap-icons/fonts/1.8.1/bootstrap-icons.woff2 +0 -0
  53. flashexam-2.0.1/flashexam/static/css/libs/bootstrap-icons/fonts/bootstrap-icons.woff +0 -0
  54. flashexam-2.0.1/flashexam/static/css/libs/bootstrap-icons/fonts/bootstrap-icons.woff2 +0 -0
  55. flashexam-2.0.1/flashexam/static/css/libs/prism/prism-tomorrow.min.css +1 -0
  56. flashexam-2.0.1/flashexam/static/css/libs/prism/prism.min.css +1 -0
  57. flashexam-2.0.1/flashexam/static/css/libs/sweetalert2.min.css +1 -0
  58. flashexam-2.0.1/flashexam/static/css/student_info_display.css +207 -0
  59. flashexam-2.0.1/flashexam/static/js/app.js +161 -0
  60. flashexam-2.0.1/flashexam/static/js/exam_monitoring.js +198 -0
  61. flashexam-2.0.1/flashexam/static/js/exam_optimized.js +576 -0
  62. flashexam-2.0.1/flashexam/static/js/libs/bootstrap/bootstrap-5.1.3.bundle.min.js +7 -0
  63. flashexam-2.0.1/flashexam/static/js/libs/bootstrap/bootstrap-5.3.0.bundle.min.js +7 -0
  64. flashexam-2.0.1/flashexam/static/js/libs/bootstrap/bootstrap-5.3.2.bundle.min.js +7 -0
  65. flashexam-2.0.1/flashexam/static/js/libs/bootstrap/bootstrap.bundle.min.js +391 -0
  66. flashexam-2.0.1/flashexam/static/js/libs/bootstrap-shim.js +59 -0
  67. flashexam-2.0.1/flashexam/static/js/libs/chart/chart.js +20 -0
  68. flashexam-2.0.1/flashexam/static/js/libs/chart/chart.min.js +20 -0
  69. flashexam-2.0.1/flashexam/static/js/libs/init.js +156 -0
  70. flashexam-2.0.1/flashexam/static/js/libs/jquery/jquery-3.7.1.min.js +2 -0
  71. flashexam-2.0.1/flashexam/static/js/libs/jquery/jquery.min.js +2 -0
  72. flashexam-2.0.1/flashexam/static/js/libs/prism/components/prism-bash.min.js +1 -0
  73. flashexam-2.0.1/flashexam/static/js/libs/prism/components/prism-c.min.js +1 -0
  74. flashexam-2.0.1/flashexam/static/js/libs/prism/components/prism-clike.min.js +1 -0
  75. flashexam-2.0.1/flashexam/static/js/libs/prism/components/prism-core.min.js +1 -0
  76. flashexam-2.0.1/flashexam/static/js/libs/prism/components/prism-cpp.min.js +1 -0
  77. flashexam-2.0.1/flashexam/static/js/libs/prism/components/prism-csharp.min.js +1 -0
  78. flashexam-2.0.1/flashexam/static/js/libs/prism/components/prism-css.min.js +1 -0
  79. flashexam-2.0.1/flashexam/static/js/libs/prism/components/prism-go.min.js +1 -0
  80. flashexam-2.0.1/flashexam/static/js/libs/prism/components/prism-java.min.js +1 -0
  81. flashexam-2.0.1/flashexam/static/js/libs/prism/components/prism-javascript.min.js +1 -0
  82. flashexam-2.0.1/flashexam/static/js/libs/prism/components/prism-json.min.js +1 -0
  83. flashexam-2.0.1/flashexam/static/js/libs/prism/components/prism-markdown.min.js +1 -0
  84. flashexam-2.0.1/flashexam/static/js/libs/prism/components/prism-markup.min.js +1 -0
  85. flashexam-2.0.1/flashexam/static/js/libs/prism/components/prism-php.min.js +1 -0
  86. flashexam-2.0.1/flashexam/static/js/libs/prism/components/prism-python.min.js +1 -0
  87. flashexam-2.0.1/flashexam/static/js/libs/prism/components/prism-ruby.min.js +1 -0
  88. flashexam-2.0.1/flashexam/static/js/libs/prism/components/prism-rust.min.js +1 -0
  89. flashexam-2.0.1/flashexam/static/js/libs/prism/components/prism-sql.min.js +1 -0
  90. flashexam-2.0.1/flashexam/static/js/libs/prism/components/prism-typescript.min.js +1 -0
  91. flashexam-2.0.1/flashexam/static/js/libs/prism/plugins/autoloader/prism-autoloader.min.js +1 -0
  92. flashexam-2.0.1/flashexam/static/js/libs/prism/prism-core.min.js +1 -0
  93. flashexam-2.0.1/flashexam/static/js/libs/sweetalert2/sweetalert2.min.js +5 -0
  94. flashexam-2.0.1/flashexam/static/js/offline-detection.js +68 -0
  95. flashexam-2.0.1/flashexam/static/js/prism-init.js +53 -0
  96. flashexam-2.0.1/flashexam/static/js/prism-local-config.js +16 -0
  97. flashexam-2.0.1/flashexam/storage/.gitkeep +0 -0
  98. flashexam-2.0.1/flashexam/stress_test_submission.py +163 -0
  99. flashexam-2.0.1/flashexam/student.py +1670 -0
  100. flashexam-2.0.1/flashexam/teacher.py +8947 -0
  101. flashexam-2.0.1/flashexam/teacher_fix.py +1 -0
  102. flashexam-2.0.1/flashexam/templates/admin/index.html +180 -0
  103. flashexam-2.0.1/flashexam/templates/admin/settings.html +214 -0
  104. flashexam-2.0.1/flashexam/templates/admin/teachers.html +354 -0
  105. flashexam-2.0.1/flashexam/templates/auth/login.html +267 -0
  106. flashexam-2.0.1/flashexam/templates/auth/login_conflict.html +83 -0
  107. flashexam-2.0.1/flashexam/templates/auth/setup_password.html +339 -0
  108. flashexam-2.0.1/flashexam/templates/base.html +217 -0
  109. flashexam-2.0.1/flashexam/templates/errors/404.html +25 -0
  110. flashexam-2.0.1/flashexam/templates/errors/500.html +25 -0
  111. flashexam-2.0.1/flashexam/templates/index.html +236 -0
  112. flashexam-2.0.1/flashexam/templates/student/dashboard.html +315 -0
  113. flashexam-2.0.1/flashexam/templates/student/exam_continue_choice.html +131 -0
  114. flashexam-2.0.1/flashexam/templates/student/exam_result.html +412 -0
  115. flashexam-2.0.1/flashexam/templates/student/exam_result_detail.html +244 -0
  116. flashexam-2.0.1/flashexam/templates/student/exam_result_detail_secure.html +427 -0
  117. flashexam-2.0.1/flashexam/templates/student/exams.html +211 -0
  118. flashexam-2.0.1/flashexam/templates/student/profile.html +224 -0
  119. flashexam-2.0.1/flashexam/templates/student/results.html +293 -0
  120. flashexam-2.0.1/flashexam/templates/student/take_exam.html +964 -0
  121. flashexam-2.0.1/flashexam/templates/student/take_exam_new.html +2243 -0
  122. flashexam-2.0.1/flashexam/templates/student/take_exam_tpo.html +1025 -0
  123. flashexam-2.0.1/flashexam/templates/teacher/dashboard.html +375 -0
  124. flashexam-2.0.1/flashexam/templates/teacher/english_questions.html +1227 -0
  125. flashexam-2.0.1/flashexam/templates/teacher/exam_edit.html +1009 -0
  126. flashexam-2.0.1/flashexam/templates/teacher/exam_monitoring_config.html +288 -0
  127. flashexam-2.0.1/flashexam/templates/teacher/exam_submissions.html +1334 -0
  128. flashexam-2.0.1/flashexam/templates/teacher/exams.html +2534 -0
  129. flashexam-2.0.1/flashexam/templates/teacher/grading.html +372 -0
  130. flashexam-2.0.1/flashexam/templates/teacher/grading_detail.html +1967 -0
  131. flashexam-2.0.1/flashexam/templates/teacher/new_exam_interface.html +2105 -0
  132. flashexam-2.0.1/flashexam/templates/teacher/questions.html +1609 -0
  133. flashexam-2.0.1/flashexam/templates/teacher/reading_passages.html +592 -0
  134. flashexam-2.0.1/flashexam/templates/teacher/results.html +895 -0
  135. flashexam-2.0.1/flashexam/templates/teacher/student_exam_details.html +295 -0
  136. flashexam-2.0.1/flashexam/templates/teacher/students.html +1360 -0
  137. flashexam-2.0.1/flashexam/templates/teacher/test_export.html +127 -0
  138. flashexam-2.0.1/flashexam/templates/teacher/test_update_score.html +179 -0
  139. flashexam-2.0.1/flashexam/templates/teacher/unified_grading.html +276 -0
  140. flashexam-2.0.1/flashexam/tools.py +1 -0
  141. flashexam-2.0.1/flashexam/user.py +172 -0
  142. flashexam-2.0.1/flashexam/utils.py +1397 -0
  143. flashexam-2.0.1/flashexam/verify_submission_queue.py +86 -0
  144. flashexam-2.0.1/flashexam.egg-info/PKG-INFO +402 -0
  145. flashexam-2.0.1/flashexam.egg-info/SOURCES.txt +152 -0
  146. flashexam-2.0.1/flashexam.egg-info/dependency_links.txt +1 -0
  147. flashexam-2.0.1/flashexam.egg-info/entry_points.txt +2 -0
  148. flashexam-2.0.1/flashexam.egg-info/requires.txt +21 -0
  149. flashexam-2.0.1/flashexam.egg-info/top_level.txt +1 -0
  150. flashexam-2.0.1/pyproject.toml +96 -0
  151. flashexam-2.0.1/requirements.txt +36 -0
  152. flashexam-2.0.1/setup.cfg +4 -0
  153. flashexam-2.0.1/tests/test_api.py +44 -0
  154. flashexam-2.0.1/tests/test_code_executor.py +66 -0
@@ -0,0 +1,20 @@
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2024 FlashExam Contributors
5
+
6
+ This program is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU General Public License as published by
8
+ the Free Software Foundation, either version 3 of the License, or
9
+ (at your option) any later version.
10
+
11
+ This program is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU General Public License for more details.
15
+
16
+ You should have received a copy of the GNU General Public License
17
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
18
+
19
+ The full text of the GNU General Public License v3.0 is available at:
20
+ https://www.gnu.org/licenses/gpl-3.0.txt
@@ -0,0 +1,14 @@
1
+ include LICENSE
2
+ include README.md
3
+ include requirements.txt
4
+ include pyproject.toml
5
+
6
+ recursive-include flashexam/templates *.html *.j2
7
+ recursive-include flashexam/static *.css *.js *.png *.jpg *.ico *.svg
8
+ recursive-include flashexam/storage .gitkeep
9
+
10
+ global-exclude __pycache__
11
+ global-exclude *.py[cod]
12
+ global-exclude *.so
13
+ global-exclude .DS_Store
14
+ global-exclude Thumbs.db
@@ -0,0 +1,402 @@
1
+ Metadata-Version: 2.4
2
+ Name: flashexam
3
+ Version: 2.0.1
4
+ Summary: Intelligent Online Examination System with AI Grading
5
+ Author: FlashExam Contributors
6
+ License-Expression: GPL-3.0-or-later
7
+ Project-URL: Homepage, https://github.com/cycleuser/flashexam
8
+ Project-URL: Repository, https://github.com/cycleuser/flashexam
9
+ Project-URL: Issues, https://github.com/cycleuser/flashexam/issues
10
+ Keywords: exam,education,ai-grading,flask,online-exam,qwen
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Web Environment
13
+ Classifier: Framework :: Flask
14
+ Classifier: Intended Audience :: Education
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Operating System :: MacOS
18
+ Classifier: Operating System :: Microsoft :: Windows
19
+ Classifier: Operating System :: POSIX :: Linux
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Topic :: Education
26
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
27
+ Requires-Python: >=3.10
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE
30
+ Requires-Dist: flask>=3.0
31
+ Requires-Dist: flask-login>=0.6.0
32
+ Requires-Dist: flask-session>=0.5.0
33
+ Requires-Dist: werkzeug>=3.0
34
+ Requires-Dist: pandas>=2.0
35
+ Requires-Dist: openpyxl>=3.1
36
+ Requires-Dist: xlrd>=2.0
37
+ Requires-Dist: numpy>=1.24
38
+ Requires-Dist: requests>=2.31
39
+ Requires-Dist: chardet>=5.0
40
+ Requires-Dist: psutil>=5.9
41
+ Requires-Dist: waitress>=2.1
42
+ Requires-Dist: jieba>=0.42
43
+ Requires-Dist: python-dateutil>=2.8
44
+ Provides-Extra: dev
45
+ Requires-Dist: pytest>=7.0; extra == "dev"
46
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
47
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
48
+ Requires-Dist: build>=1.0; extra == "dev"
49
+ Requires-Dist: twine>=4.0; extra == "dev"
50
+ Dynamic: license-file
51
+
52
+ # FlashExam
53
+
54
+ [![PyPI version](https://badge.fury.io/py/flashexam.svg)](https://badge.fury.io/py/flashexam)
55
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
56
+ [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
57
+ [![macOS](https://img.shields.io/badge/macOS-supported-green.svg)]()
58
+ [![Linux](https://img.shields.io/badge/Linux-supported-green.svg)]()
59
+ [![Windows](https://img.shields.io/badge/Windows-supported-green.svg)]()
60
+
61
+ **English** | [中文](#中文文档)
62
+
63
+ ---
64
+
65
+ ## FlashExam - Intelligent Online Examination System with AI Grading
66
+
67
+ A Flask-based intelligent online examination system with AI grading support, compatible with macOS, Linux, and Windows.
68
+
69
+ ### Features
70
+
71
+ - **Multiple Question Types**: Multiple choice, true/false, short answer, fill-in-the-blank, programming, code execution
72
+ - **AI Intelligent Grading**: Subjective question grading based on Qwen model
73
+ - **Code Execution**: Online execution support for Python, C, Java, Shell, JavaScript
74
+ - **Reading Comprehension**: TOEFL-style reading comprehension exams
75
+ - **Real-time Monitoring**: Tab switch detection and anti-cheating features
76
+ - **Batch Import**: Import questions and students via Excel/CSV
77
+ - **Admin Panel**: Teacher account management and system configuration
78
+ - **Cross-platform**: Supports macOS, Linux, Windows
79
+
80
+ ### Quick Start
81
+
82
+ #### Installation
83
+
84
+ ```bash
85
+ # Install from PyPI
86
+ pip install flashexam
87
+
88
+ # Or install from source
89
+ git clone https://github.com/cycleuser/flashexam.git
90
+ cd flashexam
91
+ pip install -e .
92
+ ```
93
+
94
+ #### Initialize Database
95
+
96
+ ```bash
97
+ flashexam --init-db
98
+ ```
99
+
100
+ #### Start Server
101
+
102
+ ```bash
103
+ # Development mode (default)
104
+ flashexam
105
+
106
+ # Production mode
107
+ flashexam --mode prod
108
+
109
+ # High-performance mode
110
+ flashexam --mode high-perf --workers 8
111
+
112
+ # Custom port
113
+ flashexam --port 8080
114
+ ```
115
+
116
+ #### Access the System
117
+
118
+ - Homepage: http://localhost:5000
119
+ - Teacher Portal: http://localhost:5000/teacher
120
+ - Student Portal: http://localhost:5000/student
121
+ - Admin Panel: http://localhost:5000/admin
122
+
123
+ First startup requires setting up an administrator account.
124
+
125
+ ### Command Line Arguments
126
+
127
+ ```
128
+ flashexam [options]
129
+
130
+ Options:
131
+ --mode {dev,prod,high-perf} Run mode (default: dev)
132
+ --host HOST Bind address (default: 0.0.0.0)
133
+ --port PORT Port number (default: 5000)
134
+ --workers N Worker processes (default: 4)
135
+ --init-db Initialize database
136
+ --version Show version information
137
+ ```
138
+
139
+ ### Project Structure
140
+
141
+ ```
142
+ flashexam/
143
+ ├── __init__.py # Application factory
144
+ ├── cli.py # CLI entry point
145
+ ├── database.py # Database operations
146
+ ├── teacher.py # Teacher endpoints
147
+ ├── student.py # Student endpoints
148
+ ├── auth.py # Authentication module
149
+ ├── admin.py # Admin module
150
+ ├── api.py # API endpoints
151
+ ├── code_executor.py # Code executor
152
+ ├── models.py # Data models
153
+ ├── utils.py # Utility functions
154
+ ├── templates/ # HTML templates
155
+ │ ├── base.html
156
+ │ ├── index.html
157
+ │ ├── auth/
158
+ │ ├── student/
159
+ │ ├── teacher/
160
+ │ └── admin/
161
+ ├── static/ # Static resources
162
+ │ ├── css/
163
+ │ └── js/
164
+ └── storage/ # Data storage
165
+ └── exam_database.db
166
+ ```
167
+
168
+ ### Development
169
+
170
+ #### Install Development Dependencies
171
+
172
+ ```bash
173
+ pip install -e ".[dev]"
174
+ ```
175
+
176
+ #### Run Tests
177
+
178
+ ```bash
179
+ # Run all tests
180
+ pytest
181
+
182
+ # Run with coverage
183
+ pytest --cov=flashexam
184
+
185
+ # Run specific test file
186
+ pytest tests/test_code_executor.py -v
187
+ ```
188
+
189
+ #### Code Style
190
+
191
+ ```bash
192
+ ruff check .
193
+ ruff format .
194
+ ```
195
+
196
+ ### Publish to PyPI
197
+
198
+ ```bash
199
+ # Linux/macOS
200
+ ./upload_pypi.sh
201
+
202
+ # Windows
203
+ upload_pypi.bat
204
+ ```
205
+
206
+ ### Tech Stack
207
+
208
+ - **Backend**: Flask, SQLite, Flask-Login, Flask-Session
209
+ - **Frontend**: Bootstrap 5, jQuery
210
+ - **AI**: PyTorch, Transformers, Qwen (optional)
211
+ - **Server**: Waitress (production)
212
+
213
+ ### License
214
+
215
+ This project is licensed under the [GNU General Public License v3.0](LICENSE).
216
+
217
+ ### Contributing
218
+
219
+ Issues and Pull Requests are welcome!
220
+
221
+ 1. Fork this repository
222
+ 2. Create a feature branch (`git checkout -b feature/AmazingFeature`)
223
+ 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
224
+ 4. Push to the branch (`git push origin feature/AmazingFeature`)
225
+ 5. Create a Pull Request
226
+
227
+ ### Author
228
+
229
+ FlashExam Contributors
230
+
231
+ ### Links
232
+
233
+ - [GitHub](https://github.com/cycleuser/flashexam)
234
+ - [PyPI](https://pypi.org/project/flashexam/)
235
+ - [Issues](https://github.com/cycleuser/flashexam/issues)
236
+
237
+ ---
238
+
239
+ # 中文文档
240
+
241
+ ## FlashExam - 智能在线考试系统
242
+
243
+ 基于 Flask 的智能在线考试系统,支持 AI 智能评分,兼容 macOS、Linux 和 Windows。
244
+
245
+ ### 功能特性
246
+
247
+ - **多题型支持**: 选择题、判断题、简答题、填空题、编程题、代码执行题
248
+ - **AI 智能评分**: 基于 Qwen 模型的主观题智能评分
249
+ - **代码执行**: 支持 Python、C、Java、Shell、JavaScript 在线执行
250
+ - **阅读理解**: 支持 TOEFL 风格阅读理解考试
251
+ - **实时监控**: 考试切屏检测、防作弊功能
252
+ - **批量导入**: 支持 Excel/CSV 批量导入题目和学生
253
+ - **管理面板**: 教师账户管理、系统配置
254
+ - **跨平台**: 支持 macOS、Linux、Windows
255
+
256
+ ### 快速开始
257
+
258
+ #### 安装
259
+
260
+ ```bash
261
+ # 从 PyPI 安装
262
+ pip install flashexam
263
+
264
+ # 或从源码安装
265
+ git clone https://github.com/cycleuser/flashexam.git
266
+ cd flashexam
267
+ pip install -e .
268
+ ```
269
+
270
+ #### 初始化数据库
271
+
272
+ ```bash
273
+ flashexam --init-db
274
+ ```
275
+
276
+ #### 启动服务
277
+
278
+ ```bash
279
+ # 开发模式 (默认)
280
+ flashexam
281
+
282
+ # 生产模式
283
+ flashexam --mode prod
284
+
285
+ # 高性能模式
286
+ flashexam --mode high-perf --workers 8
287
+
288
+ # 指定端口
289
+ flashexam --port 8080
290
+ ```
291
+
292
+ #### 访问系统
293
+
294
+ - 主页: http://localhost:5000
295
+ - 教师端: http://localhost:5000/teacher
296
+ - 学生端: http://localhost:5000/student
297
+ - 管理面板: http://localhost:5000/admin
298
+
299
+ 首次启动时需要设置管理员账户。
300
+
301
+ ### 命令行参数
302
+
303
+ ```
304
+ flashexam [选项]
305
+
306
+ 选项:
307
+ --mode {dev,prod,high-perf} 运行模式 (默认: dev)
308
+ --host HOST 绑定地址 (默认: 0.0.0.0)
309
+ --port PORT 端口号 (默认: 5000)
310
+ --workers N 工作进程数 (默认: 4)
311
+ --init-db 初始化数据库
312
+ --version 显示版本信息
313
+ ```
314
+
315
+ ### 项目结构
316
+
317
+ ```
318
+ flashexam/
319
+ ├── __init__.py # 应用工厂
320
+ ├── cli.py # 命令行入口
321
+ ├── database.py # 数据库操作
322
+ ├── teacher.py # 教师端路由
323
+ ├── student.py # 学生端路由
324
+ ├── auth.py # 认证模块
325
+ ├── admin.py # 管理模块
326
+ ├── api.py # API 接口
327
+ ├── code_executor.py # 代码执行器
328
+ ├── models.py # 数据模型
329
+ ├── utils.py # 工具函数
330
+ ├── templates/ # HTML 模板
331
+ ├── static/ # 静态资源
332
+ └── storage/ # 数据存储
333
+ ```
334
+
335
+ ### 开发
336
+
337
+ #### 安装开发依赖
338
+
339
+ ```bash
340
+ pip install -e ".[dev]"
341
+ ```
342
+
343
+ #### 运行测试
344
+
345
+ ```bash
346
+ # 运行所有测试
347
+ pytest
348
+
349
+ # 运行覆盖率测试
350
+ pytest --cov=flashexam
351
+
352
+ # 运行指定测试文件
353
+ pytest tests/test_code_executor.py -v
354
+ ```
355
+
356
+ #### 代码风格
357
+
358
+ ```bash
359
+ ruff check .
360
+ ruff format .
361
+ ```
362
+
363
+ ### 发布到 PyPI
364
+
365
+ ```bash
366
+ # Linux/macOS
367
+ ./upload_pypi.sh
368
+
369
+ # Windows
370
+ upload_pypi.bat
371
+ ```
372
+
373
+ ### 技术栈
374
+
375
+ - **后端**: Flask, SQLite, Flask-Login, Flask-Session
376
+ - **前端**: Bootstrap 5, jQuery
377
+ - **AI**: PyTorch, Transformers, Qwen (可选)
378
+ - **服务器**: Waitress (生产环境)
379
+
380
+ ### 许可证
381
+
382
+ 本项目采用 [GNU General Public License v3.0](LICENSE) 许可证。
383
+
384
+ ### 贡献
385
+
386
+ 欢迎提交 Issue 和 Pull Request!
387
+
388
+ 1. Fork 本仓库
389
+ 2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
390
+ 3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)
391
+ 4. 推送到分支 (`git push origin feature/AmazingFeature`)
392
+ 5. 创建 Pull Request
393
+
394
+ ### 作者
395
+
396
+ FlashExam Contributors
397
+
398
+ ### 链接
399
+
400
+ - [GitHub](https://github.com/cycleuser/flashexam)
401
+ - [PyPI](https://pypi.org/project/flashexam/)
402
+ - [问题反馈](https://github.com/cycleuser/flashexam/issues)