Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question rating system #18

Open
developius opened this issue Sep 15, 2015 · 4 comments
Open

Question rating system #18

developius opened this issue Sep 15, 2015 · 4 comments
Assignees
Milestone

Comments

@developius
Copy link
Member

In @OliCallaghan's caching mechanism (#10), there needs to be two extra fields called rating and user_count. The user_count will be incremented every time a user rates an answer.
We will add that specific user's rating of the question to the rating field in the database for that question.
This is so that we can get the average rating by dividing rating by user_count.

For example. User A looks at a question and rates it as 4 out of 5. The rating field in the database will now equal 5 and the user_count will be 1. Now, User B looks at the same question and rates it as 5 out of 5. The rating field in the database for that question will now equal 9 (4 + 5) and the user_count will equal 2 (1 + 1).
Therefore the average rating for that particular question is now 9 / 2 = 4.5.

I'm thinking ⭐⭐⭐⭐⭐ for the front end rating.

I'm willing to do the front end rating and link it back into the application if perhaps @OliCallaghan makes an API so users can rate the questions? Questions are going to need a unique and numeric ID - pretty easy in MySQL but I'm not sure if you decided MySQL / MongoDB?

@developius developius self-assigned this Sep 15, 2015
@developius developius added this to the Release milestone Sep 15, 2015
@popey456963
Copy link
Member

If we do decide MongoDB, things already have a unique ID that is given to them (albeit it is alphanumerical, not numerical). The values will never be the same, and so we wouldn't have to worry about anything like that, but the ID for the question will need to be sent to the client each time.

@OliCallaghan does know how the Node.JS API writing works (at least how to capture get requests), so I would recommend he do that, however, if he sends me the ID (as I know Mongo), I could perhaps put it in? I would also have to make a wrapper so that a user could get the current rating as well.

@developius
Copy link
Member Author

@popey456963 with regards to the Node HTTP API, of course - I can just link the front end into that.

@developius
Copy link
Member Author

Can't be done until #10 is resolved @OliCallaghan.

@popey456963 popey456963 modified the milestones: Statisticians Enticement, Beta release Oct 21, 2015
@developius
Copy link
Member Author

Nearly complete due to the status of #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants