/login [POST]
{
username: (mail)
password: (password)
}
{
tocken: "token valid for 30 days",
expiration: "UNIX timestamp in seconds",
firstname: "The first name",
surname: "The family name",
uid: "the user id in the database used to make requests",
type: "1 SEKI, 2 SekII, 3 teacher, 4 admin",
}
The token will be saved as a cookie (called token) and will be send with every further request
/user/<userid> [GET]
/profile
None
{
firsname: "The first name",
surname: "The family name",
uid: "the user id in the database used to make requests",
type: "1 SEKI, 2 SekII, 3 teacher, 4 admin",
}
This request returns general userinfo used by the webiterface
/teacher/<teacherid>/courses [GET]
None
{
courses: [{
subject: "the kind of the course (math, physics etc.)",
cid: "the id",
generation: "SEKI/SEKII"
}{
...
}]
}
This will be fetched when the teacher is logging in and the client shows all courses the teacher teaches. classes he teaches like ma-4 etc.
/courses/<courseid>/students [GET]
None
{
subject: "...",
cid: "...",
generation: "",
students: [{
firsname: "The first name",
surname: "The family name",
uid: "the id of the student"
},{
...
}]
}
This is used to render the colums of the table with the grades
/courses/<cid>/marks
<cid>
{
meta: {
"<markmetaid>": {
name: "<row label>"
valance: "e.g. 0.25 for relative or 2 times for fixed"
},...
},
students: {
"<uid>":[
{
metaid: "<id>",
points: "0-15",
},...
]...
}
}
/student/marks
None
{
meta: {
"<markmetaid>": {
name: "<row label>"
valance: "e.g. 0.25 for relative or 2 times for fixed"
},...
},
courses: {
"<courseid>":[
{
metaid: "<id>",
points: "0-15",
},...
]...
}
}
/mark/<courseid>/<markmetaid>/<studentid> [GET/PUT/POST/DELETE]
points (PUT/POST) or none (GET/DELETE)
{
points: 0-15
}
{
error: 401/404,
msg: "Humanreadable Message",
}
Using authetification headers (like oauth)
Authorization
get set to <userid>:<token>
Example:
Accept: application/json
Authorization: 1:K3nnpiMFi8nEHnk0VK1RNR94a2PmOYC0
Origin: http://localhost:8080
Referer: http://localhost:8080/
...