Giter Club home page Giter Club logo

prosas_challenge's Introduction

Prosas challenge

This is a project to calc grades of projects. These are the requirements for the project:

  • One endpoint to create or update projects.
  • One endpoint to return projects with pagination from 25 to 100 objects per page. I choose 25 for this project.
  • One endpoint to create or update criterias.
  • When a criteria is updated the application should recalculate the weighted_means and the average for the projects.
  • When a grade is updated the application should recalculate the weighted_means and the average for the projects.

How to run in development

First, up the dependencies services:

make dependencies.start.dev

Inside project directory do:

  • bundle install
  • RAILS_ENV=development bundle e rails db:create
  • RAILS_ENV=development bundle e rails db:migrate
  • RAILS_ENV=development bundle e rails s

How to run tests

First, up the dependencies services:

make dependencies.start.test

Then inside backend project directory do:

  • bundle install
  • RAILS_ENV=test bundle e rails db:create
  • RAILS_ENV=test rails db:migrate
  • bundle e rspec

To run Lints for this project

  • make rubocop

Api

POST /projects: /api/v1/projects

{
    "name": "p13",
    "assessments": [
        {
            "id": 24,
            "grades": [
                {
                    "grade": 10,
                    "criteria": {
                        "id": 28,
                        "weight": 30
                    }                    
                },
                {
                    "grade": 8,
                    "criteria": {
                        "id": 28,
                        "weight": 1.5
                    }                    
                }
            ]
        }
    ]
}

GET /projects: /api/v1/projects or GET /projects: /api/v1/projects?page={x}


POST /criterias: /api/v1/criterias

{
    "id": 1,
    "weight": 20
}

prosas_challenge's People

Contributors

leoneves avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.