Skip to content

nicole-malaquias/Kanvas

Repository files navigation

Kanvas

Features

  • Cadastro de usuário
  • Cadastro de Instrutor
  • Cadastro de Facilitador
  • Faz a autenticação do usuário
  • Cria um curso
  • Lista os cursos e os alunos matriculados
  • Retorna o curso com o id informado
  • Vincula os alunos ao curso
  • Cria uma nova atividade
  • Lista todas as atividades com suas respectivas submissões
  • Editando uma atividade
  • Faz a submissão de uma atividade
  • Altera a nota de uma submissão
  • Lista as submissões.

Routes

POST Create a user *****

/api/accounts/
{
    "username": "Instrutor Carlos",
    "password": "1234",
    "is_superuser": true,
    "is_staff": true
}

Response

{
    "id":1,
    "username": "Instrutor Carlos",
    "is_superuser": true,
    "is_staff": true
}

POST sign in *****

/api/login/
{
    "username": "Facilitador Fabio",
    "password": "1234"
}

Response

{
  "token": "4a18f48640e97cadf32137e480be3ec8d0b230b8"
}

POST Create a course *****

/api/courses/
{
    "name": "Django Rest Framework"
}

Response

{
  "id": 3,
  "name": "Django Rest Framework",
  "users": []
}

GET List all courses and students *****

/api/courses/
[
  {
    "id": 1,
    "name": "Django 3.22",
    "users": [
      {
        "id": 17,
        "username": "Studente Joanne"
      }
    ]
  },
  {
    "id": 2,
    "name": "Node.JS 3.2.8",
    "users": []
  }
]

GET get course by id *****

/api/courses/2/
{
  "id": 2,
  "name": "Node.JS 3.2.8",
  "users": []
}

PUT Add student in course by id *****

/api/courses/1/registrations/
{
    "user_ids": [17]
}

Response

{
  "id": 1,
  "name": "Django 3.2",
  "users": [
    {
      "id": 17,
      "username": "Studente Rafael"
    }
  ]
}

PUT Change course *****

	/api/courses/<int:course_id>/
{
    "name": "Django 3.2",
}

Response

{
  "id": 1,
  "name": "Django 3.2",
  "users": []
}

DELETE Delete course *****

	/api/courses/1/

POST Create a activity *****

/api/activities/
{
    "title": "Kenzie Club 1.5",
    "points": 10
}

Response

{
  "id": 4,
  "title": "Kenzie Club 1.5",
  "points": 10.0,
  "submissions": []
}

GET Get all activities and their submissions *****

/api/activities/
[
  {
    "id": 1,
    "title": "Kenzie Club 1.3",
    "points": 80.0,
    "submissions": [
      {
        "id": 1,
        "repo": "repositório do github 2",
        "user_id": 15,
        "grade": 8.0,
        "activity_id": 1
      }
    ]
  },
  {
    "id": 2,
    "title": "Kenzie Club 1.4",
    "points": 10.0,
    "submissions": []
  },
]

PUT Edit a specific activity *****

/api/activities/1/
  {
    "title": "Kenzie Club 1.3",
  }

Response

  {
    "id": 1,
    "title": "Kenzie Club 1.3",
    "points": 80.0,
    "submissions": []
  },

PUT Make a submission activity *****

	/api/activities/<int:activity_id>/submissions/
{
    "grade":10,
    "repo": "http://gitlab.com/kenzie_pet",
}

Response

	/api/activities/<int:activity_id>/submissions/
{
    "id": 7,
    "grade": null,
    "repo": "http://gitlab.com/kenzie_pet",
    "user_id": 3,
    "activity_id": 1
}
      

PUT Change grade *****

	/api/submissions/1/
  {
    "grade": 8,
  }

Response

{
  "id": 1,
  "repo": "http://gitlab.com/kenzie_pet",
  "user_id": 15,
  "grade": 8.0,
  "activity_id": 1
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages