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\n Includes 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