@@ -38,7 +38,7 @@ type HTTPTestHeader struct {
38
38
Value string
39
39
}
40
40
41
- type AssignmentDataHTTPTests struct {
41
+ type LessonDataHTTPTests struct {
42
42
HttpTests struct {
43
43
BaseURL * string
44
44
ContainsCompleteDir bool
@@ -70,7 +70,7 @@ type CLICommandTestCase struct {
70
70
StdoutLinesGt * int
71
71
}
72
72
73
- type AssignmentDataCLICommand struct {
73
+ type LessonDataCLICommand struct {
74
74
CLICommandData struct {
75
75
Commands []struct {
76
76
Command string
@@ -79,21 +79,21 @@ type AssignmentDataCLICommand struct {
79
79
}
80
80
}
81
81
82
- type Assignment struct {
83
- Assignment struct {
82
+ type Lesson struct {
83
+ Lesson struct {
84
84
Type string
85
- AssignmentDataHTTPTests * AssignmentDataHTTPTests
86
- AssignmentDataCLICommand * AssignmentDataCLICommand
85
+ LessonDataHTTPTests * LessonDataHTTPTests
86
+ LessonDataCLICommand * LessonDataCLICommand
87
87
}
88
88
}
89
89
90
- func FetchAssignment (uuid string ) (* Assignment , error ) {
91
- resp , err := fetchWithAuth ("GET" , "/v1/assignments /" + uuid )
90
+ func FetchLesson (uuid string ) (* Lesson , error ) {
91
+ resp , err := fetchWithAuth ("GET" , "/v1/lessons /" + uuid )
92
92
if err != nil {
93
93
return nil , err
94
94
}
95
95
96
- var data Assignment
96
+ var data Lesson
97
97
err = json .Unmarshal (resp , & data )
98
98
if err != nil {
99
99
return nil , err
@@ -111,12 +111,12 @@ type submitHTTPTestRequest struct {
111
111
ActualHTTPRequests any `json:"actualHTTPRequests"`
112
112
}
113
113
114
- func SubmitHTTPTestAssignment (uuid string , results any ) error {
114
+ func SubmitHTTPTestLesson (uuid string , results any ) error {
115
115
bytes , err := json .Marshal (submitHTTPTestRequest {ActualHTTPRequests : results })
116
116
if err != nil {
117
117
return err
118
118
}
119
- resp , code , err := fetchWithAuthAndPayload ("POST" , "/v1/assignments /" + uuid + "/http_tests" , bytes )
119
+ resp , code , err := fetchWithAuthAndPayload ("POST" , "/v1/lessons /" + uuid + "/http_tests" , bytes )
120
120
if err != nil {
121
121
return err
122
122
}
@@ -141,12 +141,12 @@ type CLICommandResult struct {
141
141
Stdout string
142
142
}
143
143
144
- func SubmitCLICommandAssignment (uuid string , results []CLICommandResult ) (* StructuredErrCLICommand , error ) {
144
+ func SubmitCLICommandLesson (uuid string , results []CLICommandResult ) (* StructuredErrCLICommand , error ) {
145
145
bytes , err := json .Marshal (submitCLICommandRequest {CLICommandResults : results })
146
146
if err != nil {
147
147
return nil , err
148
148
}
149
- resp , code , err := fetchWithAuthAndPayload ("POST" , "/v1/assignments /" + uuid + "/cli_command" , bytes )
149
+ resp , code , err := fetchWithAuthAndPayload ("POST" , "/v1/lessons /" + uuid + "/cli_command" , bytes )
150
150
if err != nil {
151
151
return nil , err
152
152
}
0 commit comments