Skip to content

Commit 4453e9a

Browse files
committed
Add documentation
1 parent afe3e29 commit 4453e9a

File tree

2 files changed

+106
-249
lines changed

2 files changed

+106
-249
lines changed

source/index.html.md

+106-16
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ search: true
1616

1717
*Note: API is still a work in progress.*
1818

19-
For the students, view <a href="/student_api">the student api</a>
20-
19+
Most of the API is restricted to faculty, however the [Gradeables](#gradeables) section can be used by students or faculty.
2120
API provides an alternative way of interacting with Submitty. It facilitates testing, helps system administrators to modify resources and enables users to create customized frontends.
2221

2322
Note that as we rely on the Authorization header information to authenticate users, please make sure that you have a correct Apache configuration file as specified in [Installation Version Notes: v19.06.02](https://submitty.org/sysadmin/version_notes/v19.06.02).
@@ -171,18 +170,18 @@ curl --request GET \
171170
"data": {
172171
"unarchived_courses": [
173172
{
174-
"semester": "f19",
173+
"term": "f19",
175174
"title": "blank",
176175
"display_name": "",
177-
"display_semester": "Fall 2019"
176+
"display_term": "Fall 2019"
178177
}
179178
],
180179
"archived_courses": [
181180
{
182-
"semester": "f19",
181+
"term": "f19",
183182
"title": "sample",
184183
"display_name": "",
185-
"display_semester": "Fall 2019"
184+
"display_term": "Fall 2019"
186185
}
187186
]
188187
}
@@ -200,10 +199,10 @@ Get all the courses the user is taking or have taken.
200199
```shell
201200
curl --request POST \
202201
--url <base_url>/api/courses \
203-
--form course_semester=f19 \
202+
--form course_term=f19 \
204203
--form course_title=api \
205204
--form head_instructor=instructor \
206-
--form base_course_semester=f19 \
205+
--form base_course_term=f19 \
207206
--form base_course_title=sample \
208207
--header 'Authorization: my_token'
209208
```
@@ -220,10 +219,10 @@ Note that the endpoint builds a course based on a prior course offering (called
220219

221220
Parameter | Description
222221
--------- | -----------
223-
course_semester | Semester of the new course
222+
course_term | term of the new course
224223
course_title | Title (or code) of the new course
225224
head_instructor | Head instructor of the new course
226-
base_course_semester | Semester of the base course
225+
base_course_term | term of the base course
227226
base_course_title | Title (or code) of the base course
228227

229228
# Courses.Users
@@ -232,7 +231,7 @@ base_course_title | Title (or code) of the base course
232231

233232
```shell
234233
curl --request GET \
235-
--url <base_url>/api/<semester>/<course>/users \
234+
--url <base_url>/api/<term>/<course>/users \
236235
--header 'Authorization: my_token'
237236
```
238237

@@ -268,13 +267,13 @@ This end point gets all users in a course.
268267

269268
### HTTP Request
270269

271-
`GET /api/<semester>/<course>/users`
270+
`GET /api/<term>/<course>/users`
272271

273272
## Get Graders
274273

275274
```shell
276275
curl --request GET \
277-
--url <base_url>/api/<semester>/<course>/graders \
276+
--url <base_url>/api/<term>/<course>/graders \
278277
--header 'Authorization: my_token'
279278
```
280279

@@ -308,20 +307,111 @@ curl --request GET \
308307

309308
### HTTP Request
310309

311-
`GET /api/<semester>/<course>/graders`
310+
`GET /api/<term>/<course>/graders`
312311

313312
# Courses.Reports
314313

315314
## Generate Grade Summaries
316315

317316
```shell
318317
curl --request POST \
319-
--url <base_url>/api/<semester>/<course>/reports/summaries \
318+
--url <base_url>/api/<term>/<course>/reports/summaries \
320319
--header 'Authorization: my_token'
321320
```
322321

323322
This endpoint helps system administrators set up cron jobs for automatic grade summary generation.
324323

325324
### HTTP Request
326325

327-
`POST /api/<semester>/<course>/reports/summaries`
326+
`POST /api/<term>/<course>/reports/summaries`
327+
328+
329+
# Gradeables
330+
## Get gradeable values
331+
332+
```shell
333+
curl -X GET \
334+
<base_url>/api/<term>/<course>/gradeable/<gradeable_id>/values?user_id=<user_id>
335+
336+
```
337+
> Possible response examples:
338+
339+
```json
340+
{
341+
"status": "success",
342+
"data": {
343+
"is_queued": false,
344+
"queue_position": 3,
345+
"is_grading": false,
346+
"has_submission": true,
347+
"autograding_complete": true,
348+
"has_active_version": true,
349+
"highest_version": 1,
350+
"total_points": 0,
351+
"total_percent": 0
352+
}
353+
}
354+
```
355+
```json
356+
{
357+
"status": "fail",
358+
"message": "Gradeable does not exist"
359+
}
360+
```
361+
362+
The endpoint returns values associated with an autograded gradeable with the given gradeable_id, which allows for determining a score on an assignment, if it has been graded, etc.
363+
364+
### HTTP Request
365+
366+
`GET /api/<term>/<course>/gradeable/<gradeable_id>/values?user_id=<user_id>`
367+
368+
### Parameters
369+
370+
Parameter | Description
371+
--------- | -----------
372+
user_id | User's unique ID
373+
374+
## Submit VCS Gradeable
375+
376+
```shell
377+
curl -X POST \
378+
<base_url>/api/<term>/<course>/gradeable/<gradeable_id>/upload\
379+
-F user_id=student \
380+
-F vcs_checkout=true \
381+
-F git_repo_id=true
382+
```
383+
> Possible responses:
384+
385+
```json
386+
{
387+
"status": "success",
388+
"data": "Successfully uploaded version {#} for {Gradeable Title}"
389+
}
390+
```
391+
```json
392+
{
393+
"status": "fail",
394+
"message": "Invalid gradeable id '{Gradeable ID}'"
395+
}
396+
```
397+
```json
398+
{
399+
"status": "fail",
400+
"message": "Student API for upload only supports VCS gradeables"
401+
}
402+
```
403+
404+
405+
The endpoint requests for a VCS gradeable with the given gradeable_id to be submitted.
406+
407+
### HTTP Request
408+
409+
`POST /api/<term>/<course>/gradeable/<gradeable_id>/upload`
410+
411+
### Parameters
412+
413+
Parameter | Description
414+
--------- | -----------
415+
user_id | User's unique ID
416+
vcs_checkout | Required to be `true`
417+
git_repo_id | Required value, however no specific value is checked.

0 commit comments

Comments
 (0)