-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
Task Description:
Currently, posts that have not been rated by a user are incorrectly treated as having a rating of 0. This skews the average grading calculation, resulting in inaccurate grades. Since the grading system uses a maximum grade of 3, unrated posts should be excluded from the average calculation to ensure accuracy and fairness in the grading process.
Acceptance Criteria:
Exclusion of Unrated Posts:
- Posts that have not been rated by a user should not contribute to the average grading calculation.
Average Calculation Logic:
- The average grade should be calculated as the total sum of user ratings divided by the number of users who provided a rating.
- Example: If 3 users rated a post with scores of 3, 2, and 1 (maximum grade is 3), and 2 users did not rate the post, the average should be (3+2+1)/3 = 2.0, not (3+2+1+0+0)/5 = 1.2.
Database/Backend Updates:
- Update backend logic to handle unrated posts appropriately and calculate average grades based only on valid ratings.
Testing:
-
Add unit and integration tests to verify:
- Unrated posts do not affect the average grading calculation.
- Correct averages are displayed for posts with varying numbers of ratings within the range of 0 to 3.
- Posts with no ratings display the correct default message.
Documentation:
-
Update relevant documentation to reflect the new average grading logic, maximum grade enforcement (3), and any changes to the UI/UX for unrated posts.
Metadata
Metadata
Assignees
Labels
No labels