Repository navigation
Expand file tree
/
Copy pathlessonfeedback.http
More file actions
115 lines (78 loc) · 2.87 KB
/
Copy pathlessonfeedback.http
File metadata and controls
115 lines (78 loc) · 2.87 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
### Lesson Feedback API Tests
Exercises both feedback steps, the locked ratings and the summary with the
VS Code REST Client. See docs/lesson-feedback-architecture.md.
Select the `local` or `deployed` environment. `baseUrl`, `adminUid`,
`adminPassword`, `studentUid` and `studentPassword` are the variables
`grading.http` uses. Set them in the Git-ignored `.vscode/settings.json`.
Run the requests in order. They work on a throwaway "[TEST]" assignment made
in step 2. It is not team-taught (only the Pages sync bot sets teamTeach), so
its homework doesn't wait for this feedback. 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. Sign in as the student
POST {{baseUrl}}/authenticate
Content-Type: application/json
{
"uid": "{{studentUid}}",
"password": "{{studentPassword}}"
}
### 4. Read your feedback before saving -> 200, every field null
GET {{baseUrl}}/api/lesson-feedback/{{testAssignment.response.body.$.id}}/mine
### 5. Save the lesson step with two ratings -> 200, lesson and popcorn locked
PUT {{baseUrl}}/api/lesson-feedback/{{testAssignment.response.body.$.id}}/lesson
Content-Type: application/json
{
"lesson": 4,
"popcorn": 3,
"pros": "Clear examples"
}
### 6. Try to change a saved rating -> 409
PUT {{baseUrl}}/api/lesson-feedback/{{testAssignment.response.body.$.id}}/lesson
Content-Type: application/json
{
"lesson": 5
}
### 7. Submission step without Grows -> 400 naming engage, homework and grows
PUT {{baseUrl}}/api/lesson-feedback/{{testAssignment.response.body.$.id}}/submission
Content-Type: application/json
{
"homework": 2
}
### 8. Complete the submission step -> 200, complete is true
PUT {{baseUrl}}/api/lesson-feedback/{{testAssignment.response.body.$.id}}/submission
Content-Type: application/json
{
"lesson": 4,
"engage": 5,
"popcorn": 3,
"homework": 2,
"grows": "Slow down on the hacks"
}
### 9. A student can't read the summary -> 403
GET {{baseUrl}}/api/lesson-feedback/{{testAssignment.response.body.$.id}}/summary
### 10. Sign in as the teacher again
POST {{baseUrl}}/authenticate
Content-Type: application/json
{
"uid": "{{adminUid}}",
"password": "{{adminPassword}}"
}
### 11. Live summary -> 200, responseCount 1, averages, counts and the comments
GET {{baseUrl}}/api/lesson-feedback/{{testAssignment.response.body.$.id}}/summary
### 12. Close the test assignment
POST {{baseUrl}}/api/assignments/{{testAssignment.response.body.$.id}}/close
### 13. Feedback is final after close -> 409
PUT {{baseUrl}}/api/lesson-feedback/{{testAssignment.response.body.$.id}}/lesson
Content-Type: application/json
{
"pros": "Too late"
}