Skip to content

Commit b5df784

Browse files
authored
Merge pull request #9 from MikaTech-dev/development
Development Created models Successfully integrated AI feedback function Created grading logic Streamlined Linter and fixed linting issues Created database seeder Added and linted requirement.txt and dev-requirement.txt of transitive dependencies Added and configured drf spectacular and swagger docs Added postman_collection.json
2 parents 680a3d7 + 7b2a174 commit b5df784

18 files changed

Lines changed: 684 additions & 35 deletions

.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
superusername=admin
2+
superuserpass=admin123
3+
4+
studentusername=student
5+
student=password123
6+
7+
GEMINI_API_KEY=<your GEMINI_API_KEY here>
8+
ENV=development

.github/workflows/pylint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Install dependencies
1818
run: |
1919
python -m pip install --upgrade pip
20-
pip install pylint-django djangorestframework django
20+
pip install pylint-django djangorestframework django drf-spectacular
2121
- name: Analysing the code with pylint (together with plugins)
2222
run: |
23-
pylint --load-plugins pylint_django --django-settings-module=assessment_engine.settings api/ assessment_engine/ api/
23+
pylint --load-plugins pylint_django --django-settings-module=assessment_engine.settings api/ assessment_engine/

.pylintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ disable=missing-module-docstring,
1111
invalid-name,
1212
imported-auth-user,
1313
too-many-ancestors,
14+
line-too-long
Lines changed: 253 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
{
2+
"info": {
3+
"_postman_id": "03abc79c-ae0e-4d4f-bb15-7a8cb56235be",
4+
"name": "Django Assessment Engine (Pro)",
5+
"description": "A complete API collection for the Mini Assessment Engine.\n\nIncludes endpoints for:\n- **Admin**: System management login.\n- **Student**: Exam listing, secure submissions, and history.\n- **Authentication**: Session/Basic auth handling with CSRF scripts included.",
6+
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
7+
},
8+
"item": [
9+
{
10+
"name": "Admin",
11+
"description": "Administrative endpoints for system management.",
12+
"item": [
13+
{
14+
"name": "Admin Login",
15+
"event": [
16+
{
17+
"listen": "test",
18+
"script": {
19+
"exec": [
20+
"var xsrfCookie = postman.getResponseCookie(\"csrftoken\");",
21+
"postman.setEnvironmentVariable('csrftoken', xsrfCookie.value);"
22+
],
23+
"type": "text/javascript"
24+
}
25+
}
26+
],
27+
"request": {
28+
"method": "POST",
29+
"header": [],
30+
"body": {
31+
"mode": "formdata",
32+
"formdata": [
33+
{
34+
"key": "username",
35+
"value": "admin",
36+
"type": "text"
37+
},
38+
{
39+
"key": "password",
40+
"value": "admin123",
41+
"type": "text"
42+
}
43+
]
44+
},
45+
"url": {
46+
"raw": "{{baseURL}}/admin/login/",
47+
"host": ["{{baseURL}}"],
48+
"path": ["admin", "login", ""]
49+
},
50+
"description": "Logs in the Superuser to access the Django Admin panel."
51+
}
52+
}
53+
]
54+
},
55+
{
56+
"name": "Student",
57+
"description": "Main student workflow: Login -> View Exams -> Submit -> View Results.",
58+
"item": [
59+
{
60+
"name": "Auth",
61+
"item": [
62+
{
63+
"name": "Student Login",
64+
"event": [
65+
{
66+
"listen": "test",
67+
"script": {
68+
"exec": [
69+
"var xsrfCookie = postman.getResponseCookie(\"csrftoken\");",
70+
"postman.setEnvironmentVariable('csrftoken', xsrfCookie.value);"
71+
],
72+
"type": "text/javascript"
73+
}
74+
}
75+
],
76+
"request": {
77+
"auth": {
78+
"type": "basic",
79+
"basic": [
80+
{
81+
"key": "username",
82+
"value": "student",
83+
"type": "string"
84+
},
85+
{
86+
"key": "password",
87+
"value": "password123",
88+
"type": "string"
89+
}
90+
]
91+
},
92+
"method": "POST",
93+
"header": [],
94+
"url": {
95+
"raw": "{{baseURL}}/api-auth/login/",
96+
"host": ["{{baseURL}}"],
97+
"path": ["api-auth", "login", ""]
98+
},
99+
"description": "Authenticates a student and sets the session cookie."
100+
}
101+
}
102+
]
103+
},
104+
{
105+
"name": "Exams",
106+
"description": "Read-only endpoints for viewing available assessments.",
107+
"item": [
108+
{
109+
"name": "Get All Exams",
110+
"request": {
111+
"method": "GET",
112+
"header": [],
113+
"url": {
114+
"raw": "{{baseURL}}/api/exams/",
115+
"host": ["{{baseURL}}"],
116+
"path": ["api", "exams", ""]
117+
},
118+
"description": "Lists all available exams with their associated questions."
119+
}
120+
},
121+
{
122+
"name": "Get Exam by ID",
123+
"request": {
124+
"method": "GET",
125+
"header": [],
126+
"url": {
127+
"raw": "{{baseURL}}/api/exams/:id",
128+
"host": ["{{baseURL}}"],
129+
"path": ["api", "exams", ":id"],
130+
"variable": [
131+
{
132+
"key": "id",
133+
"value": "5",
134+
"description": "The ID of the exam to retrieve."
135+
}
136+
]
137+
},
138+
"description": "Retrieves details for a specific exam."
139+
}
140+
}
141+
]
142+
},
143+
{
144+
"name": "Submissions",
145+
"description": "Endpoints for submitting answers and viewing graded history.",
146+
"item": [
147+
{
148+
"name": "Submit an Exam",
149+
"event": [
150+
{
151+
"listen": "test",
152+
"script": {
153+
"exec": [
154+
"var xsrfCookie = postman.getResponseCookie(\"csrftoken\");",
155+
"postman.setEnvironmentVariable('csrftoken', xsrfCookie.value);"
156+
],
157+
"type": "text/javascript"
158+
}
159+
}
160+
],
161+
"request": {
162+
"method": "POST",
163+
"header": [
164+
{
165+
"key": "X-CSRFToken",
166+
"value": "{{csrftoken}}",
167+
"type": "text"
168+
}
169+
],
170+
"body": {
171+
"mode": "raw",
172+
"raw": "{\n \"exam\": 5,\n \"answers\": [\n {\n \"question\": 13,\n \"student_answer\": {\n \"choice\": \"Newton\"\n }\n },\n {\n \"question\": 15,\n \"student_answer\": {\n \"text\": \"Velocity is speed with direction.\"\n }\n }\n ]\n}",
173+
"options": {
174+
"raw": {
175+
"language": "json"
176+
}
177+
}
178+
},
179+
"url": {
180+
"raw": "{{baseURL}}/api/submissions/",
181+
"host": ["{{baseURL}}"],
182+
"path": ["api", "submissions", ""]
183+
},
184+
"description": "Submits answers for grading. Triggers the AI feedback engine."
185+
},
186+
"response": [
187+
{
188+
"name": "Error: Invalid ID",
189+
"originalRequest": {
190+
"method": "POST",
191+
"body": {
192+
"mode": "raw",
193+
"raw": "{\"exam\": 5, \"answers\": [{\"question\": 999, \"student_answer\": {\"choice\": \"A\"}}]}"
194+
},
195+
"url": "{{baseURL}}/api/submissions/"
196+
},
197+
"status": "Bad Request",
198+
"code": 400,
199+
"_postman_previewlanguage": "json",
200+
"header": [],
201+
"body": "{\"answers\": [{\"question\": [\"Invalid pk \\\"999\\\" - object does not exist.\"]}]}"
202+
}
203+
]
204+
},
205+
{
206+
"name": "Get All Submissions",
207+
"request": {
208+
"method": "GET",
209+
"header": [],
210+
"url": {
211+
"raw": "{{baseURL}}/api/submissions/",
212+
"host": ["{{baseURL}}"],
213+
"path": ["api", "submissions", ""]
214+
},
215+
"description": "Retrieves the logged-in student's submission history."
216+
}
217+
},
218+
{
219+
"name": "Get Submission by ID",
220+
"request": {
221+
"method": "GET",
222+
"header": [],
223+
"url": {
224+
"raw": "{{baseURL}}/api/submissions/:id",
225+
"host": ["{{baseURL}}"],
226+
"path": ["api", "submissions", ":id"],
227+
"variable": [
228+
{
229+
"key": "id",
230+
"value": "1",
231+
"description": "The ID of the submission to view."
232+
}
233+
]
234+
},
235+
"description": "Views the specific details, score, and AI feedback for one submission."
236+
}
237+
}
238+
]
239+
}
240+
]
241+
}
242+
],
243+
"variable": [
244+
{
245+
"key": "baseURL",
246+
"value": "http://127.0.0.1:8000"
247+
},
248+
{
249+
"key": "csrftoken",
250+
"value": ""
251+
}
252+
]
253+
}

0 commit comments

Comments
 (0)