You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: RESTful-API.md
+112Lines changed: 112 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1058,6 +1058,118 @@ NOTE: collect_current value meanings:
1058
1058
- true: collect most recent files submitted, regardless of assignment due date or late period.
1059
1059
- false: collect most recent files submitted before the due date, including any late period.
1060
1060
1061
+
### POST /api/courses/:course_id/assignments/:assignment_id/groups/:group_id/add_test_results
1062
+
1063
+
- description: Submit automated test results for the given group for the given assignment. This endpoint is used by the autotesting service to report test execution results.
1064
+
- required parameters:
1065
+
- test_results (object)
1066
+
- status (string: test execution status, e.g., "pass", "fail", "finished")
1067
+
- error (string or null: error message if test execution failed)
1068
+
- test_groups (array of objects)
1069
+
- time (integer or null: execution time in milliseconds)
1070
+
- tests (array of objects)
1071
+
- name (string: test name)
1072
+
- status (string: one of "pass", "partial", "fail", "error", "error_all")
1073
+
- marks_earned (integer: points earned)
1074
+
- marks_total (integer: maximum points)
1075
+
- output (string: test output/feedback)
1076
+
- time (integer or null: execution time in milliseconds)
- annotations (array of objects: code annotations to add)
1087
+
- content (string: annotation content)
1088
+
- filename (string: file to annotate)
1089
+
- type (string: "TextAnnotation", "ImageAnnotation", etc.)
1090
+
- line_start, line_end, column_start, column_end (integers: for text annotations)
1091
+
- x1, x2, y1, y2 (integers: for image/PDF annotations)
1092
+
- feedback (array of objects: feedback files to attach)
1093
+
- filename (string)
1094
+
- mime_type (string)
1095
+
- content (string: file content, may be base64 encoded)
1096
+
- compression (string: "gzip" if content is compressed)
1097
+
- tags (array of objects: tags to apply to the grouping)
1098
+
- name (string: tag name)
1099
+
- description (string: tag description)
1100
+
- overall_comment (string: overall comment to add to the result)
1101
+
- example request body (json):
1102
+
1103
+
```json
1104
+
{
1105
+
"test_results": {
1106
+
"status": "finished",
1107
+
"error": null,
1108
+
"test_groups": [
1109
+
{
1110
+
"time": 1250,
1111
+
"extra_info": {
1112
+
"name": "Correctness Tests",
1113
+
"test_group_id": 42,
1114
+
"display_output": 2,
1115
+
"criterion": "Correctness"
1116
+
},
1117
+
"tests": [
1118
+
{
1119
+
"name": "test_addition",
1120
+
"status": "pass",
1121
+
"marks_earned": 2,
1122
+
"marks_total": 2,
1123
+
"time": 125,
1124
+
"output": "All test cases passed"
1125
+
},
1126
+
{
1127
+
"name": "test_subtraction",
1128
+
"status": "fail",
1129
+
"marks_earned": 0,
1130
+
"marks_total": 2,
1131
+
"time": 98,
1132
+
"output": "Expected 5, got 3"
1133
+
}
1134
+
],
1135
+
"annotations": [
1136
+
{
1137
+
"content": "Consider edge cases for negative numbers",
1138
+
"filename": "calculator.py",
1139
+
"line_start": 10,
1140
+
"line_end": 12,
1141
+
"column_start": 0,
1142
+
"column_end": 20
1143
+
}
1144
+
],
1145
+
"tags": [
1146
+
{
1147
+
"name": "needs_review",
1148
+
"description": "Requires manual review"
1149
+
}
1150
+
],
1151
+
"overall_comment": "Good attempt, but edge cases need work"
1152
+
}
1153
+
]
1154
+
}
1155
+
}
1156
+
```
1157
+
1158
+
- example success response (json):
1159
+
1160
+
```json
1161
+
{
1162
+
"status": "success",
1163
+
"test_run_id": 1234
1164
+
}
1165
+
```
1166
+
1167
+
NOTE: This endpoint creates a TestRun record with associated test results, annotations, feedback files, and tags. All operations are performed atomically within a transaction.
1168
+
1169
+
NOTE: The request body is validated against a schema and must not exceed 10MB in size.
1170
+
1171
+
NOTE: Authentication is required via API key. The authenticated user's role is used as the creator of the test run.
1172
+
1061
1173
### POST /api/courses/:course_id/assignments/:assignment_id/groups/:group_id/extension
1062
1174
1063
1175
- description: Create an extension for the given group for the given assignment
0 commit comments