Giter Site home page Giter Site logo

fcctop100's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fcctop100's Issues

Camper Leaderboard API potentially calculating points incorrectly

Issue Description

When using the suggested API call in the Camper Leaderboard project, the total calculated points for the recent and alltime do not match the API calls for recent by total points and alltime by total points.

Steps To Reproduce

When calling http://fcctop100.herokuapp.com/api/fccusers/top/recent the results were as follows (example):

{"username":"wearenotgroot","img":"https://avatars.githubusercontent.com/u/16578279?v=3","alltime":632,"recent":368,"lastUpdate":"2016-02-28T08:09:15.011Z"}, ...

However, comparing it to the call for recent points by total using http://fcctop100.herokuapp.com/api/fccusers/recent/total, you get:

{"_id":"56ace0f7a733c603005869e5","username":"wearenotgroot","pointsRecent":389,"challengesRecent":7,"algorithmsRecent":9,"projectsRecent":5,"communityRecent":368,"totalRecent":639,"lastUpdate":"2016-02-28T08:09:15.011Z","img":"https://avatars.githubusercontent.com/u/16578279?v=3"},..

Notice that the totalRecent key is 389 in the latter call, whereas recent is 368 in the former. It looks like the top/recent is only pulling the community points and not the total.

In this example, the suggested http://fcctop100.herokuapp.com/api/fccusers/top/recent call yields the user wearenotgroot as the 2nd highest in recent points. But if we check that users recent ranking using http://fcctop100.herokuapp.com/api/fccusers/ranking-r/wearenotgroot it yields

{"_id":"56ace0f7a733c603005869e5","username":"wearenotgroot","existing":true,"points":942,"challenges":260,"algorithms":42,"projects":8,"community":632,"total":1342,"pointsRecent":389,"challengesRecent":7,"algorithmsRecent":9,"projectsRecent":5,"communityRecent":368,"totalRecent":639,"lastUpdate":"2016-02-28T08:09:15.011Z","__v":0,"img":"https://avatars.githubusercontent.com/u/16578279?v=3","following":[],"ranking":28}

This shows the actual rank as 28, which matches the users position when calling http://fcctop100.herokuapp.com/api/fccusers/top/recent.

Similar seeming errors occur when using the alltime calls.

I'm not sure if this is intentional, but I wanted to point it out in case it is a bug.

Browser Information

  • Firefox, 44.0.2
  • Windows 10

Screenshot

Suggested API call http://fcctop100.herokuapp.com/api/fccusers/top/recent
Suggested API Call

Alternate API call http://fcctop100.herokuapp.com/api/fccusers/recent/total
Alternate API call

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.