Prerequisites
Python 2.7, PHP 7, Composer, Node.js, couchDB, docker, MySQL
Follow the installation instruction in each app.
Service | Port |
---|---|
PublicServer | 5000 |
HintsProvider | 5001 |
StatsAnalyser | 5005 |
StatsUpdater | 5002 |
ExerciseManager | 5003 |
TestRunner | 5004 |
Title | Content |
---|---|
URL | /api/exercises |
Method Allowed | GET |
Headers Required | access_token=<token>, Content-Type=application/json |
Successful Response | Code: HTTP 200 OK, Content: { id : [string], name : [string], description: [string], template: [string] } |
Error Responses | HTTP 401 Unauthorized, HTTP 400 400 Bad Request |
Title | Content |
---|---|
URL | /api/stats |
Method Allowed | GET |
Headers Required | access_token=<token>, Content-Type=application/json |
Successful Response | Code: HTTP 200 OK, Content: { time_spent : [integer], student_id : [integer], average_time_spent : [integer] } |
Error Responses | HTTP 401 Unauthorized, HTTP 400 400 Bad Request |
Title | Content |
---|---|
URL | /api/hints |
Method Allowed | POST |
Headers Required | access_token=<token>, Content-Type=application/json |
Data Params | { exercise_id : [string], time_spent : [int], code : [string], hints_number : [int] } |
Successful Response | Code: HTTP 200 OK, Content: { student_id : [integer], exercise_id : [string], hints : [string] } |
Error Responses | HTTP 401 Unauthorized, HTTP 404 Not Found |
Title | Content |
---|---|
URL | /hints |
Method Allowed | POST |
Headers Required | Content-Type=application/json |
Data Params | { student_id : [integer], instructor_id : [integer], exercise_id : [string], time_spent : [int], code : [string], hints_number : [int] } |
Successful Response | Code: HTTP 200 OK, Content: { student_id : [integer], exercise_id : [string], hints : [string] } |
Error Responses | HTTP 401 Unauthorized, HTTP 404 Not Found |
Title | Content |
---|---|
URL | /docs/<instructor_id> |
Method Allowed | GET |
Successful Response | Code : HTTP 200 OK, Content: {docs: [list], exercise: [list], exercise_stats:[list], student_stats: [list] } |
Error Response | None |
Title | Content |
---|---|
URL | /docs/<instructor_id>/<exercise_id> |
Method Allowed | GET |
Successful Response | Code : HTTP 200 OK, Content: {docs: [list]} |
Error Response | None |
Title | Content |
---|---|
URL | /docs/<instructor_id>/<student_id> |
Method Allowed | GET |
Successful Response | Code : HTTP 200 OK, Content: {docs: [list]} |
Error Response | None |
Title | Content |
---|---|
URL | /average/<exercise_id> |
Method Allowed | GET |
Successful Response | Code : HTTP 200 OK, Content: {average_time_spent: [integer]} |
Error Response | None |
Title | Content |
---|---|
URL | /stats/<int:student_id>/<exercise_id> |
Method Allowed | POST |
Headers Required | Content-Type=application/json |
Data Params | { instructor_id : [integer], time_spent : [integer], code : [string], test_status : [string], hints_number : [integer] } |
Successful Response | Code: HTTP 201 Created, Content: { id : [string], rev : [string] } |
Error Responses | HTTP 400 Bad Request |
Title | Content |
---|---|
URL | /exercises |
Method Allowed | GET |
Headers Required | Content-Type=application/json |
Successful Response | Code: HTTP 200 OK, Content: { id : [string], name : [string], description: [string], template: [string] } |
Error Responses | HTTP 400 400 Bad Request |
Title | Content |
---|---|
URL | /exercises/<instructor_id> |
Method Allowed | GET |
Headers Required | Content-Type=application/json |
Successful Response | Code: HTTP 200 OK, Content: { id : [string], name : [string], description: [string], template: [string] } |
Error Responses | HTTP 400 400 Bad Request |
Title | Content |
---|---|
URL | /exercise/<exercise_id> |
Method Allowed | GET |
Headers Required | Content-Type=application/json |
Successful Response | Code: HTTP 200 OK, Content: { id : [string], rev : [string], instructor_id : [integer], name : [string], test_code : [string], hints : [string], description: [string], template: [string] } |
Error Responses | HTTP 400 400 Bad Request |
Title | Content |
---|---|
URL | /exercise/<instructor_id>/<exercise_index> |
Method Allowed | POST |
Headers Required | Content-Type=application/json |
Data Params | { name : [string], test_code : [string], hints : [string], description : [string], template : [string] } |
Successful Response | Code: HTTP 201 Created, Content: { id : [string], rev : [string] } |
Error Responses | HTTP 400 400 Bad Request |
Title | Content |
---|---|
URL | /names |
Method Allowed | POST |
Headers Required | Content-Type=application/json |
Data Params | { ids : [list] } |
Successful Response | Code: HTTP 200 OK, Content: { id : [string], name : [string] } |
Error Responses | HTTP 400 400 Bad Request |
Title | Content |
---|---|
URL | /test |
Method Allowed | POST |
Headers Required | Content-Type=application/json |
Data Params | { code : [string], testCode : [string] } |
Successful Response | Code: HTTP 200 OK, Content: { results:{ failed:{ number:[integer], tests:[list] }, passed: { number: [integer] } }, errors:[string], time: [string] } |
Error Responses | HTTP 400 400 Bad Request |