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

Adds average star rating calculations #4080

Merged
merged 5 commits into from
Apr 2, 2019

Conversation

SaptakS
Copy link
Contributor

@SaptakS SaptakS commented Apr 1, 2019

Description

Calculates the average star rating for a profile and returns a dictionary of different ratings.

Since the star rating PR hasn't been merged, I have commented out the calculation of the individual quality ratings so that once that gets merged, I can uncomment that.

Checklist
Affected core subsystem(s)
Refers/Fixes

Fixes #4059

@codecov
Copy link

codecov bot commented Apr 1, 2019

Codecov Report

Merging #4080 into master will decrease coverage by 0.05%.
The diff coverage is 9.09%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4080      +/-   ##
==========================================
- Coverage   30.28%   30.22%   -0.06%     
==========================================
  Files         206      206              
  Lines       16334    16345      +11     
  Branches     2149     2155       +6     
==========================================
- Hits         4946     4941       -5     
- Misses      11212    11228      +16     
  Partials      176      176
Impacted Files Coverage Δ
app/dashboard/views.py 12% <0%> (-0.02%) ⬇️
app/dashboard/models.py 54.07% <10%> (-0.29%) ⬇️
app/dashboard/embed.py 28.16% <0%> (-3.45%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0d76622...e3685b1. Read the comment docs.

danlipert
danlipert previously approved these changes Apr 2, 2019
Copy link
Contributor

@danlipert danlipert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

feedbacks = FeedbackEntry.objects.filter(receiver_profile=self).all()
average_rating = {}
average_rating['overall'] = sum([feedback.rating for feedback in feedbacks]) / feedbacks.count()
# average_rating['code_quality_rating'] = sum([feedback.code_quality_rating for feedback in feedbacks]) / feedbacks.count()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume these commented out lines are for upcoming features, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind - I see they are in Octavio's PR 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since that PR is merged now, I will remove the comments now. :)

@thelostone-mc thelostone-mc merged commit 786439c into gitcoinco:master Apr 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calculation of star ratings
4 participants