Repository navigation
Expand file tree
/
Copy pathgrading.http
More file actions
226 lines (152 loc) · 6.03 KB
/
Copy pathgrading.http
File metadata and controls
226 lines (152 loc) · 6.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
### Grading API Tests
Exercises the grading lifecycle with the VS Code REST Client: AI and manual
grades, a revision that keeps the manual grade, a student's petition, close,
and a teacher review after close. See docs/grading-architecture.md.
Select the `local` or `deployed` environment. `baseUrl`, `adminUid` and
`adminPassword` are the variables `toolchain.http` uses; this file also needs
`studentUid` and `studentPassword` for a student account. Set them all in the
Git-ignored `.vscode/settings.json`.
Run the requests in order. They work on a throwaway "[TEST]" assignment made
in step 2, so closing it in step 17 touches no real grades. Logging in again
replaces the JWT cookie, so each "Sign in" switches who the requests run as.
### 1. Sign in as the teacher
POST {{baseUrl}}/authenticate
Content-Type: application/json
{
"uid": "{{adminUid}}",
"password": "{{adminPassword}}"
}
### 2. Make a throwaway test assignment
# @name testAssignment
POST {{baseUrl}}/api/assignments/test
### 3. Switch it to link submissions so the student can edit it later
PUT {{baseUrl}}/api/assignments/{{testAssignment.response.body.$.id}}/details
Content-Type: application/json
{
"name": "{{testAssignment.response.body.$.name}}",
"type": "test",
"points": 1,
"dueDate": "{{testAssignment.response.body.$.dueDate}}",
"assignmentType": "link",
"description": "Created by api/grading.http"
}
### 4. Sign in as the student
POST {{baseUrl}}/authenticate
Content-Type: application/json
{
"uid": "{{studentUid}}",
"password": "{{studentPassword}}"
}
### 5. Look up the student's id
# @name student
GET {{baseUrl}}/api/person/get
### 6. Submit revision 1; the AI grades it straight away if it can
# @name submission
POST {{baseUrl}}/api/submissions/submit/{{testAssignment.response.body.$.id}}
Content-Type: application/json
{
"submitterId": {{student.response.body.$.id}},
"isGroup": false,
"content": { "type": "link", "url": "https://example.com/grading-http/v1", "notes": "" },
"comment": "First try"
}
### 7. Petition without a manual grade: expect 409 NO_MANUAL_OVERRIDE
POST {{baseUrl}}/api/grade-reviews/submission/{{submission.response.body.$.id}}/petition
Content-Type: application/json
{
"message": "Please look again"
}
### 8. Sign in as the teacher
POST {{baseUrl}}/authenticate
Content-Type: application/json
{
"uid": "{{adminUid}}",
"password": "{{adminPassword}}"
}
### 9. Set a manual grade for revision 1: expect MANUAL_GRADE_APPLIED
POST {{baseUrl}}/api/submissions/grade/{{submission.response.body.$.id}}?grade=0.5&feedback=Part%202%20is%20missing&revision=1
### 10. Sign in as the student
POST {{baseUrl}}/authenticate
Content-Type: application/json
{
"uid": "{{studentUid}}",
"password": "{{studentPassword}}"
}
### 11. Resubmit: revision 2 keeps the manual grade (grading.source is MANUAL, grade 0.5)
PUT {{baseUrl}}/api/submissions/{{submission.response.body.$.id}}
Content-Type: multipart/form-data; boundary=grading
--grading
Content-Disposition: form-data; name="contentType"
link
--grading
Content-Disposition: form-data; name="url"
https://example.com/grading-http/v2
--grading
Content-Disposition: form-data; name="comment"
Added part 2
--grading--
### 12. History: REVISED then MANUAL_OVERRIDE_KEPT_BY_REVISION at revision 2
GET {{baseUrl}}/api/submissions/{{submission.response.body.$.id}}/grading-history
### 13. Petition the kept grade: expect 201 REVIEW_OPENED
POST {{baseUrl}}/api/grade-reviews/submission/{{submission.response.body.$.id}}/petition
Content-Type: application/json
{
"message": "Revision 2 adds part 2"
}
### 14. The student's petitions, without the teacher's evidence
GET {{baseUrl}}/api/grade-reviews/submission/{{submission.response.body.$.id}}/petitions
### 15. Sign in as the teacher
POST {{baseUrl}}/authenticate
Content-Type: application/json
{
"uid": "{{adminUid}}",
"password": "{{adminPassword}}"
}
### 16. Open reviews on the assignment: the petition from step 13
# @name openReviews
GET {{baseUrl}}/api/grade-reviews/assignment/{{testAssignment.response.body.$.id}}/open
### 17. Grant it before close: expect MANUAL_GRADE_APPLIED (the gradebook waits for close)
POST {{baseUrl}}/api/grade-reviews/{{openReviews.response.body.$[0].id}}/decision
Content-Type: application/json
{
"decision": "ADJUST",
"rationale": "Part 2 is in revision 2",
"grade": 0.9,
"feedback": "Regraded revision 2"
}
### 18. A grade for revision 1 is out of date: expect 409 STALE_REVISION
POST {{baseUrl}}/api/submissions/grade/{{submission.response.body.$.id}}?grade=0.1&revision=1
### 19. Close: expect ASSIGNMENT_FINALIZED and grades copied to the gradebook (cannot be undone)
POST {{baseUrl}}/api/assignments/{{testAssignment.response.body.$.id}}/close
### 20. Closing again: expect 409 ASSIGNMENT_CLOSED
POST {{baseUrl}}/api/assignments/{{testAssignment.response.body.$.id}}/close
### 21. Grading after close: expect 409 ASSIGNMENT_CLOSED
POST {{baseUrl}}/api/submissions/grade/{{submission.response.body.$.id}}?grade=0.2
### 22. Open a teacher review: expect 201 REVIEW_OPENED
# @name review
POST {{baseUrl}}/api/grade-reviews/submission/{{submission.response.body.$.id}}
Content-Type: application/json
{
"reason": "REGRADE_REQUEST",
"evidence": "Checking the final grade"
}
### 23. Add identical submissions to the evidence
POST {{baseUrl}}/api/grade-reviews/{{review.response.body.$.review.id}}/similarity
### 24. Decide without a rationale: expect 400 RATIONALE_REQUIRED
POST {{baseUrl}}/api/grade-reviews/{{review.response.body.$.review.id}}/decision
Content-Type: application/json
{
"decision": "NO_CHANGE",
"rationale": ""
}
### 25. Keep the grade: expect REVIEW_NO_CHANGE
POST {{baseUrl}}/api/grade-reviews/{{review.response.body.$.review.id}}/decision
Content-Type: application/json
{
"decision": "NO_CHANGE",
"rationale": "The grade matches the rubric"
}
### 26. Every review of the submission, oldest first
GET {{baseUrl}}/api/grade-reviews/submission/{{submission.response.body.$.id}}
### 27. Clean up the test assignment
POST {{baseUrl}}/api/assignments/delete/{{testAssignment.response.body.$.id}}