courses Routes - SmartBeansGoe/smartbeans-backend GitHub Wiki
Output
{
"name": <String>,
"title": <String>,
"config": {
...
}
}
Errors
- 404: Invalid course
Returns all solved tasks as a list of taskids. Requires header Authorization: Bearer <valid (session) token>
.
Output
[<Integer>, ...]
Errors
- 400: Invalid header format
- 401: Invalid token
- 403: Course does not correspond with session course
Returns a list of all tasks for the given course.
Output
[
{
"taskid": <Integer>,
"task_description": <String>,
"lang": <String>,
"tags": <String>,
"order_by": <Integer>,
"prerequisites": <String>
},
...
]
Errors
- 404: Invalid course
Returns a single task.
Output
{
"taskid": <Integer>,
"task_description": <String>,
"lang": <String>,
"tags": <String>,
"order_by": <Integer>,
"prerequisites": <String>
}
Errors
- 404: Invalid course or task id
Returns all submissions for the user in this course. Requires header Authorization: Bearer <valid (session) token>
.
Output
[
{
"id": <Integer>,
"taskid": <Integer>,
"timestamp": <Integer>,
"content": <String>,
"result_type" <String>,
"simplified": {
"compiler": {
"stdout": <String>,
"statusCode": <Integer>
},
"testCase": {
"stdin": <String>,
"stdout": <String>,
"expectedStdout": <String>,
"statusCode": <Integer>
}
},
"score": <Float>
},
...
]
Errors
- 400: Invalid header format
- 401: Invalid token
- 403: Course does not correspond with session course
Returns the submissions for the user in this course and a given task. Requires header Authorization: Bearer <valid (session) token>
. Returns an empty array if the taskid is invalid.
Output
[
{
"id": <Integer>,
"taskid": <Integer>,
"timestamp": <Integer>,
"content": <String>,
"result_type" <String>,
"simplified": {
"compiler": {
"stdout": <String>,
"statusCode": <Integer>
},
"testCase": {
"stdin": <String>,
"stdout": <String>,
"expectedStdout": <String>,
"statusCode": <Integer>
}
},
"score": <Float>
},
...
]
Errors
- 400: Invalid header format
- 401: Invalid token
- 403: Course does not correspond with session course
Returns a specific submission for the user in this course. Requires header Authorization: Bearer <valid (session) token>
.
Output
{
"id": <Integer>,
"taskid": <Integer>,
"timestamp": <Integer>,
"content": <String>,
"result_type" <String>,
"simplified": {
"compiler": {
"stdout": <String>,
"statusCode": <Integer>
},
"testCase": {
"stdin": <String>,
"stdout": <String>,
"expectedStdout": <String>,
"statusCode": <Integer>
}
},
"score": <Float>
}
Errors
- 400: Invalid header format
- 401: Invalid token
- 403: Course does not correspond with session course
- 404: Submission not found
Submits a solution to the sandbox. Returns 200 on success. Requires header Authorization: Bearer <valid (session) token>
.
Input
{
"submission": <String>
}
Output
-
Errors
- 400: Invalid header or body format
- 401: Invalid token
- 403: Course does not correspond with session course